discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: Is there a "Polar" translate transformation?

HL
Hans L
Mon, Aug 15, 2022 4:53 AM

If your direction can be given as a unit vector, then you can just:
translate(dist*dir) ....

To normalize a vector you can divide by its norm:  unit = v / norm(v);

On Sun, Aug 14, 2022 at 10:19 PM William Lugg via Discuss <
discuss@lists.openscad.org> wrote:

---------- Forwarded message ----------
From: William Lugg luggw1@protonmail.com
To: "Jan Öhman via Discuss" discuss@lists.openscad.org
Cc:
Bcc:
Date: Mon, 15 Aug 2022 03:18:37 +0000
Subject: [OpenSCAD] Is there a "Polar" translate transformation?
I have a situation where it would be helpful to be able to specify a
transformation as a distance and a direction, say as a rotation about
the Z axis from the positive X axis, for example.  Is there such a tool
in OpenSCAD?

I looked on the cheat sheet and one didn't pop out at me, but I wondered
if I might have missed it.

Thanks
Bill Lugg

---------- Forwarded message ----------
From: William Lugg via Discuss discuss@lists.openscad.org
To: "Jan Öhman via Discuss" discuss@lists.openscad.org
Cc: William Lugg luggw1@protonmail.com
Bcc:
Date: Mon, 15 Aug 2022 03:18:37 +0000
Subject: [OpenSCAD] Is there a "Polar" translate transformation?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

If your direction can be given as a unit vector, then you can just: translate(dist*dir) .... To normalize a vector you can divide by its norm: unit = v / norm(v); On Sun, Aug 14, 2022 at 10:19 PM William Lugg via Discuss < discuss@lists.openscad.org> wrote: > > > > ---------- Forwarded message ---------- > From: William Lugg <luggw1@protonmail.com> > To: "Jan Öhman via Discuss" <discuss@lists.openscad.org> > Cc: > Bcc: > Date: Mon, 15 Aug 2022 03:18:37 +0000 > Subject: [OpenSCAD] Is there a "Polar" translate transformation? > I have a situation where it would be helpful to be able to specify a > transformation as a distance and a direction, say as a rotation about > the Z axis from the positive X axis, for example. Is there such a tool > in OpenSCAD? > > I looked on the cheat sheet and one didn't pop out at me, but I wondered > if I might have missed it. > > Thanks > Bill Lugg > > > > ---------- Forwarded message ---------- > From: William Lugg via Discuss <discuss@lists.openscad.org> > To: "Jan Öhman via Discuss" <discuss@lists.openscad.org> > Cc: William Lugg <luggw1@protonmail.com> > Bcc: > Date: Mon, 15 Aug 2022 03:18:37 +0000 > Subject: [OpenSCAD] Is there a "Polar" translate transformation? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >