discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Trouble with rotating Text to correct orientation

J
jjvbhh
Sun, Oct 11, 2020 11:10 AM

Hi, OpenSCAD people.
I started with OpenSCAD some weeks ago and I'd like to share some stuff,
I've create (finally then at github). But before I'd like to share and
discuss here. And I also need help.

To verify my designs I started creating a measure tool. But I have trouble
with the correct rotate command for the measure text.

Find attached a test script measure.scad
http://forum.openscad.org/file/t2988/measure.scad  and a screen shot
measure.png http://forum.openscad.org/file/t2988/measure.png

My requirement would be:
If you look at a measure with the "green" arrow to the left and the "red"
arrow to the right and the measure lines pointing down, then the text should
be positioned readable like the "green" text is.

I did this for the green text by the line
// !HELP NEEDED! correct rotate for all possible directions
rotate([90,0,0])

I know, I have to do trigonometric to find the correct rotation (similar as
in _measure_rjoin ) and also might need cross(p2-p1,d) to find the vertical
to the plane, but I'm struggling putting it all together.

Any help and comment is welcome.

As I said, I will happily share the result, when it finally is functional.

Regards.

--
Sent from: http://forum.openscad.org/

Hi, OpenSCAD people. I started with OpenSCAD some weeks ago and I'd like to share some stuff, I've create (finally then at github). But before I'd like to share and discuss here. And I also need help. To verify my designs I started creating a measure tool. But I have trouble with the correct rotate command for the measure text. Find attached a test script measure.scad <http://forum.openscad.org/file/t2988/measure.scad> and a screen shot measure.png <http://forum.openscad.org/file/t2988/measure.png> My requirement would be: If you look at a measure with the "green" arrow to the left and the "red" arrow to the right and the measure lines pointing down, then the text should be positioned readable like the "green" text is. I did this for the green text by the line // !HELP NEEDED! correct rotate for all possible directions rotate([90,0,0]) I know, I have to do trigonometric to find the correct rotation (similar as in _measure_rjoin ) and also might need cross(p2-p1,d) to find the vertical to the plane, but I'm struggling putting it all together. Any help and comment is welcome. As I said, I will happily share the result, when it finally is functional. Regards. -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Sun, Oct 11, 2020 10:21 PM

So in your example, you want 80mm rotated 90d anticlockwise,
and presumably 63.7mm too, so they align to the black lines?


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

So in your example, you want 80mm rotated 90d anticlockwise, and presumably 63.7mm too, so they align to the black lines? ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Sun, Oct 11, 2020 10:24 PM

...Blue line...


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

...Blue line... ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/
J
jjvbhh
Mon, Oct 12, 2020 4:51 AM

Jordan Brown wrote

I would expect that you would construct the whole assembly, arrows, lines,
and text, with the line
being measured starting at [0,0,0] and heading +X along the X axis, with
the text and measure
lines in -Z, and then translate and rotate it into place.

Thanks for the hint! Sometimes one goes into details too much and gets lost
of the whole overview. I came up with that by myself in the meantime. I will
try the next days and post the results here.

--
Sent from: http://forum.openscad.org/

Jordan Brown wrote > I would expect that you would construct the whole assembly, arrows, lines, > and text, with the line > being measured starting at [0,0,0] and heading +X along the X axis, with > the text and measure > lines in -Z, and then translate and rotate it into place. Thanks for the hint! Sometimes one goes into details too much and gets lost of the whole overview. I came up with that by myself in the meantime. I will try the next days and post the results here. -- Sent from: http://forum.openscad.org/