discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: Is there a "Polar" translate transformation?

JB
Jordan Brown
Mon, Aug 15, 2022 4:33 AM

Built-in?  No.

But it's a small amount of trig.

BOSL2 has a complete-looking set of coordinate transformations:
https://github.com/revarbat/BOSL2/wiki/coords.scad

Or if you want to work more from first principles, here's mine.

Built-in?  No. But it's a small amount of trig. BOSL2 has a complete-looking set of coordinate transformations: https://github.com/revarbat/BOSL2/wiki/coords.scad Or if you want to work more from first principles, here's mine.
JB
Jordan Brown
Mon, Aug 15, 2022 4:58 AM

In case it wasn't obvious, you would use mine something like

translate(torect([10, 30])) cube(1);

and the BOSL2 variant similarly:

include <BOSL2/coords.scad>

translate(polar_to_xy([10, 60])) cube(1);

In both cases the first element of the polar coordinate is rho, the
distance, and the second element is theta, the angle counterclockwise
from the +X axis.

The three-dimensional variants add phi, the angle down from the +Z axis.

In case it wasn't obvious, you would use mine something like translate(torect([10, 30])) cube(1); and the BOSL2 variant similarly: include <BOSL2/coords.scad> translate(polar_to_xy([10, 60])) cube(1); In both cases the first element of the polar coordinate is rho, the distance, and the second element is theta, the angle counterclockwise from the +X axis. The three-dimensional variants add phi, the angle down from the +Z axis.