I eventually want the "route" to be specified turtle-style: move
forward N, turn left N, et cetera. However, that adds significant
trickiness. First, there's the obvious thing that the positions are all
relative and to get the position and look direction at time N you have
to add up all of the moves before that point.
Trickier, though, is that the position isn't simply added (even rotated
by the look angle) because a forward move combined with a turn yields an
arc.
It would also be tempting to add turtle-style view navigation to the
OpenSCAD UI, so that you could move forward or back, and turn the camera
left/right/up/down. Any interest?
I thought about mentioning this when I first saw your example: I've
implemented turtle both in 2d and 3d versions, including turns with arcs.
The 3d version produces a transformation list as output, so it would give
you look angle as well as position. (Accumulating to time N isn't hard in a
turtle implementation. You compute the next "move" and multiply its matrix
by the current transform (in the appropriate way). The hardest thing about
a 3d turtle is deciding what rotations actually mean and how to calculate
them.
https://github.com/revarbat/BOSL2/wiki/turtle3d.scad
JordanBrown wrote
I eventually want the "route" to be specified turtle-style: move
forward N, turn left N, et cetera. However, that adds significant
trickiness. First, there's the obvious thing that the positions are all
relative and to get the position and look direction at time N you have
to add up all of the moves before that point.
Trickier, though, is that the position isn't simply added (even rotated
by the look angle) because a forward move combined with a turn yields an
arc.
It would also be tempting to add turtle-style view navigation to the
OpenSCAD UI, so that you could move forward or back, and turn the camera
left/right/up/down. Any interest?
OpenSCAD mailing list
Discuss@.openscad
--
Sent from: http://forum.openscad.org/