openscad/openscad — Issue #29: Rotation does not perform as described in documentation
Author: thehans
Created: 2011-10-11 00:33:14+00:00
State: open

I would like to use the feature of rotation around an arbitrary origin as described here:
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#rotate
> The optional argument 'v' allows you to set an arbitrary origin about which the object will be rotated.
>
> Example with arbitrary origin.
>
> rotate(a=[0,180,0], [10,10,10]) { ... }

When I tried this example it did not perform as expected. Below is a code example of what I tested and the results I saw:

// initial reference cube
cube(1);

// sphere representing "arbitrary origin" reference point
translate([10,10,10]) sphere(1, $fn=20);

// seems to ignore v, and just rotates "a" angle around [0,0,0] origin
rotate(a=[0,180,0], v=[10,10,10]) cube(1);

// seems to ignore "a" and use the second vector as the rotation angle around [0,0,0] origin
rotate(a=[0,180,0], [10,10,10]) cube(1);

// Equivalent expected results for both above examples
translate([10,10,10]) rotate([0,180,0]) translate([-10,-10,-10]) cube(1);