[OpenSCAD] Rotate about user defined axis ?

Hans L thehans at gmail.com
Fri Nov 1 04:07:01 EDT 2019


The builtin rotate module can rotate about any vector which goes
through the origin.  If you want to pivot around something not on the
origin, then you'll have to do additional translations.

Here is a "one-liner" module to do it for you.  just specify the pivot point p.

module rotate_about(a, v, p=[0,0,0]) {
     translate(p) rotate(a,v) translate(-p) children();
}

-Hans

On Thu, Oct 31, 2019 at 4:48 PM adrianv <avm4 at cornell.edu> wrote:
>
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



More information about the Discuss mailing list