discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

mouse3D moves in BOSL2

L
larry
Tue, Jun 24, 2025 4:34 PM

On Mon, 2025-06-23 at 21:45 -0400, Adrian Mariano via Discuss wrote:

For furtle in 2D there is really no reason not to simply wrap your
turtle command in move().  There's no reason for me to implement a
new option that just calls move for you.  Basically you're asking for
move(pt,turtle(....)) to be augmented with an identically acting
turtle(....., move=pt).   You can of course in either turtle,
specify a starting state, though whether that counts as "easy" is
debatable.  

I took a closer look at turtle3d(), and it turns out that the "state"
parameter can accept a transformation matrix as an argument.  So
actually the desired feature already exists---it just wasn't
documented.   In other words, you can do turtle3d(.....,
state=move(pt)) to start the turtle at pt.   I did notice that if I
give a transformation matrix with a rotation I sometimes get the
reverse of the expected effect.  I'm not sure what is going on
there.  

Could I prevail on you to show an example of the use of
turtle3d(.....,state=move(pt)) using Jon Bondy's example?

I am probably not getting something in the right place.

On Mon, Jun 23, 2025 at 8:45 PM Father Horton via Discuss
discuss@lists.openscad.org wrote:

I would love an easy way to set the starting point for a turtle, 2D
or 3D. 

On Mon, Jun 23, 2025 at 7:14 PM jon jonbondy.com via Discuss
discuss@lists.openscad.org wrote:

I have a list  of 3D points I'm trying to hit, so starting at one
of the points would be optimal, rather than adding the offsets
after the fact.
Not sure if anyone else would find this feature to be useful.
Jon

On 6/23/2025 7:13 PM, Adrian Mariano wrote:

I think it depends on what you're doing.  If you're just
getting a path then you can move() the path you get.  But if
you're getting a transform list then you would need to move
everything in the transform list, which is somewhat more
trouble.  If you pass the transform list to sweep() you could
move() the result of sweep.  I wonder if turtle3d needs a
special option for this.  

On Mon, Jun 23, 2025 at 7:03 PM Jon Bondy jon@jonbondy.com
wrote:

How do I start a turtle3D at a specific spot.  I don't need
to jump (skip a segment).  I want to start at a location
different than the origin.

On 6/23/2025 6:58 PM, Adrian Mariano via Discuss wrote:

Ah, right.  I think you need to start a new turtle at the
desired spot.  Since turtle returns a path there's no way
to skip a segment.  

On Mon, Jun 23, 2025 at 6:00 PM jon jonbondy.com via
Discuss discuss@lists.openscad.org wrote:

In fact, "jump" does leave a turtle trail, so it does not
do what I want:
include <BOSL2/std.scad>
include <BOSL2/turtle3d.scad>
naPath = turtle3d([
        "move", 20,
        "jump", [50, 50, 50],
        "move", 10    
        ]);
    path_sweep(circle(r = 1, $fn = 6), naPath);

On 6/23/2025 5:09 PM, Jon Bondy via Discuss wrote:

Adrian:
Yes, I mean turtle3d.  I get my vertebrates and and
invertebrates confused.  Perhaps it was the mouse that
was in my paw when I wrote the question.
The definition of "move" is "move the turtle", and the
definition of "jump" is "move the turtle.  Since the
descriptions were virtually identical, I figured they
did the same thing.  I guess I figured wrong.
Thanks!
Jon

On 6/23/2025 4:27 PM, Adrian Mariano via Discuss wrote:

Do you mean turtle3d?  Doesn't "jump" do what you
want?

On Mon, Jun 23, 2025 at 9:29 AM Jon Bondy via Discuss
discuss@lists.openscad.org wrote:

Is there a way to jump to a point in 3D space
(without leaving a mouse
trail) and then start a mouse trail?


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

On Mon, 2025-06-23 at 21:45 -0400, Adrian Mariano via Discuss wrote: > For furtle in 2D there is really no reason not to simply wrap your > turtle command in move().  There's no reason for me to implement a > new option that just calls move for you.  Basically you're asking for > `move(pt,turtle(....))` to be augmented with an identically acting > `turtle(....., move=pt)`.   You can of course in either turtle, > specify a starting state, though whether that counts as "easy" is > debatable.   > > I took a closer look at turtle3d(), and it turns out that the "state" > parameter can accept a transformation matrix as an argument.  So > actually the desired feature already exists---it just wasn't > documented.   In other words, you can do turtle3d(....., > state=move(pt)) to start the turtle at pt.   I did notice that if I > give a transformation matrix with a rotation I sometimes get the > reverse of the expected effect.  I'm not sure what is going on > there.   Could I prevail on you to show an example of the use of turtle3d(.....,state=move(pt)) using Jon Bondy's example? I am probably not getting something in the right place. > On Mon, Jun 23, 2025 at 8:45 PM Father Horton via Discuss > <discuss@lists.openscad.org> wrote: > > I would love an easy way to set the starting point for a turtle, 2D > > or 3D.  > > > > On Mon, Jun 23, 2025 at 7:14 PM jon jonbondy.com via Discuss > > <discuss@lists.openscad.org> wrote: > > > I have a list  of 3D points I'm trying to hit, so starting at one > > > of the points would be optimal, rather than adding the offsets > > > after the fact. > > > Not sure if anyone else would find this feature to be useful. > > > Jon > > > > > > On 6/23/2025 7:13 PM, Adrian Mariano wrote: > > > > I think it depends on what you're doing.  If you're just > > > > getting a path then you can move() the path you get.  But if > > > > you're getting a transform list then you would need to move > > > > everything in the transform list, which is somewhat more > > > > trouble.  If you pass the transform list to sweep() you could > > > > move() the result of sweep.  I wonder if turtle3d needs a > > > > special option for this.   > > > > > > > > On Mon, Jun 23, 2025 at 7:03 PM Jon Bondy <jon@jonbondy.com> > > > > wrote: > > > > > How do I start a turtle3D at a specific spot.  I don't need > > > > > to jump (skip a segment).  I want to start at a location > > > > > different than the origin. > > > > > > > > > > On 6/23/2025 6:58 PM, Adrian Mariano via Discuss wrote: > > > > > > Ah, right.  I think you need to start a new turtle at the > > > > > > desired spot.  Since turtle returns a path there's no way > > > > > > to skip a segment.   > > > > > > > > > > > > On Mon, Jun 23, 2025 at 6:00 PM jon jonbondy.com via > > > > > > Discuss <discuss@lists.openscad.org> wrote: > > > > > > > In fact, "jump" does leave a turtle trail, so it does not > > > > > > > do what I want: > > > > > > > include <BOSL2/std.scad> > > > > > > > include <BOSL2/turtle3d.scad> > > > > > > > naPath = turtle3d([ > > > > > > >         "move", 20, > > > > > > >         "jump", [50, 50, 50], > > > > > > >         "move", 10     > > > > > > >         ]); > > > > > > >     path_sweep(circle(r = 1, $fn = 6), naPath); > > > > > > > > > > > > > > On 6/23/2025 5:09 PM, Jon Bondy via Discuss wrote: > > > > > > > > Adrian: > > > > > > > > Yes, I mean turtle3d.  I get my vertebrates and and > > > > > > > > invertebrates confused.  Perhaps it was the mouse that > > > > > > > > was in my paw when I wrote the question. > > > > > > > > The definition of "move" is "move the turtle", and the > > > > > > > > definition of "jump" is "move the turtle.  Since the > > > > > > > > descriptions were virtually identical, I figured they > > > > > > > > did the same thing.  I guess I figured wrong. > > > > > > > > Thanks! > > > > > > > > Jon > > > > > > > > > > > > > > > > On 6/23/2025 4:27 PM, Adrian Mariano via Discuss wrote: > > > > > > > > > Do you mean turtle3d?  Doesn't "jump" do what you > > > > > > > > > want? > > > > > > > > > > > > > > > > > > > > > > > > > > > On Mon, Jun 23, 2025 at 9:29 AM Jon Bondy via Discuss > > > > > > > > > <discuss@lists.openscad.org> wrote: > > > > > > > > > > Is there a way to jump to a point in 3D space > > > > > > > > > > (without leaving a mouse > > > > > > > > > > trail) and then start a mouse trail? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > > OpenSCAD mailing list > > > > > > > > > > To unsubscribe send an email to > > > > > > > > > > discuss-leave@lists.openscad.org
L
larry
Tue, Jun 24, 2025 7:50 PM

On Tue, 2025-06-24 at 10:34 -0600, larry via Discuss wrote:

On Mon, 2025-06-23 at 21:45 -0400, Adrian Mariano via Discuss wrote:

For furtle in 2D there is really no reason not to simply wrap your
turtle command in move().  There's no reason for me to implement a
new option that just calls move for you.  Basically you're asking for
move(pt,turtle(....)) to be augmented with an identically acting
turtle(....., move=pt).   You can of course in either turtle,
specify a starting state, though whether that counts as "easy" is
debatable.  

I took a closer look at turtle3d(), and it turns out that the "state"
parameter can accept a transformation matrix as an argument.  So
actually the desired feature already exists---it just wasn't
documented.   In other words, you can do turtle3d(.....,
state=move(pt)) to start the turtle at pt.   I did notice that if I
give a transformation matrix with a rotation I sometimes get the
reverse of the expected effect.  I'm not sure what is going on
there.  

Could I prevail on you to show an example of the use of
turtle3d(.....,state=move(pt)) using Jon Bondy's example?

include <BOSL2/std.scad>
include <BOSL2/turtle3d.scad>

naPath = turtle3d([
"move", 20,
"jump", [50, 50, 50],
"move", 10,
],
state=move([5,10,15]));
path_sweep(circle(r = 5, $fn = 180), naPath);

On Tue, 2025-06-24 at 10:34 -0600, larry via Discuss wrote: > On Mon, 2025-06-23 at 21:45 -0400, Adrian Mariano via Discuss wrote: > > For furtle in 2D there is really no reason not to simply wrap your > > turtle command in move().  There's no reason for me to implement a > > new option that just calls move for you.  Basically you're asking for > > `move(pt,turtle(....))` to be augmented with an identically acting > > `turtle(....., move=pt)`.   You can of course in either turtle, > > specify a starting state, though whether that counts as "easy" is > > debatable.   > > > > I took a closer look at turtle3d(), and it turns out that the "state" > > parameter can accept a transformation matrix as an argument.  So > > actually the desired feature already exists---it just wasn't > > documented.   In other words, you can do turtle3d(....., > > state=move(pt)) to start the turtle at pt.   I did notice that if I > > give a transformation matrix with a rotation I sometimes get the > > reverse of the expected effect.  I'm not sure what is going on > > there.   > > Could I prevail on you to show an example of the use of > turtle3d(.....,state=move(pt)) using Jon Bondy's example? include <BOSL2/std.scad> include <BOSL2/turtle3d.scad> naPath = turtle3d([ "move", 20, "jump", [50, 50, 50], "move", 10, ], state=move([5,10,15])); path_sweep(circle(r = 5, $fn = 180), naPath);
JB
Jon Bondy
Tue, Jun 24, 2025 8:00 PM

Thanks, but that is not intuitive at all!

Jon

On 6/24/2025 3:50 PM, larry via Discuss wrote:

include <BOSL2/std.scad>
include <BOSL2/turtle3d.scad>

naPath = turtle3d([
"move", 20,
"jump", [50, 50, 50],
"move", 10,
],
state=move([5,10,15]));
path_sweep(circle(r = 5, $fn = 180), naPath);

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

Thanks, but that is not intuitive at all! Jon On 6/24/2025 3:50 PM, larry via Discuss wrote: > include <BOSL2/std.scad> > include <BOSL2/turtle3d.scad> > > naPath = turtle3d([ > "move", 20, > "jump", [50, 50, 50], > "move", 10, > ], > state=move([5,10,15])); > path_sweep(circle(r = 5, $fn = 180), naPath); -- This email has been checked for viruses by AVG antivirus software. www.avg.com
AM
Adrian Mariano
Tue, Jun 24, 2025 9:04 PM

I didn't see that Jon posted an example and am not sure what the point of
confusion is.

include<BOSL2-fork/std.scad>
include<BOSL2-fork/turtle3d.scad>
path = [ "move", 25, "arcright", 7,  "move", 25];
start_pt=move([3,3,20]);
sweep(circle(r=5, $fn=32), turtle3d(path, transforms=true));
color("lightblue")
sweep(circle(r=5, $fn=32), turtle3d(path, state=start_pt,
transforms=true));

[image: image.png]

On Tue, Jun 24, 2025 at 4:00 PM Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:

Thanks, but that is not intuitive at all!

Jon

On 6/24/2025 3:50 PM, larry via Discuss wrote:

include <BOSL2/std.scad>
include <BOSL2/turtle3d.scad>

naPath = turtle3d([
"move", 20,
"jump", [50, 50, 50],
"move", 10,
],
state=move([5,10,15]));
path_sweep(circle(r = 5, $fn = 180), naPath);

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com


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

I didn't see that Jon posted an example and am not sure what the point of confusion is. include<BOSL2-fork/std.scad> include<BOSL2-fork/turtle3d.scad> path = [ "move", 25, "arcright", 7, "move", 25]; start_pt=move([3,3,20]); sweep(circle(r=5, $fn=32), turtle3d(path, transforms=true)); color("lightblue") sweep(circle(r=5, $fn=32), turtle3d(path, state=start_pt, transforms=true)); [image: image.png] On Tue, Jun 24, 2025 at 4:00 PM Jon Bondy via Discuss < discuss@lists.openscad.org> wrote: > Thanks, but that is not intuitive at all! > > Jon > > On 6/24/2025 3:50 PM, larry via Discuss wrote: > > include <BOSL2/std.scad> > > include <BOSL2/turtle3d.scad> > > > > naPath = turtle3d([ > > "move", 20, > > "jump", [50, 50, 50], > > "move", 10, > > ], > > state=move([5,10,15])); > > path_sweep(circle(r = 5, $fn = 180), naPath); > > -- > This email has been checked for viruses by AVG antivirus software. > www.avg.com > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
JB
Jon Bondy
Tue, Jun 24, 2025 9:20 PM

As I conceive of it, the "path" is a list of moves, so having another
move that is not within "path" is counter-intuitive. I would have
expected something like "start", start_pt, "move"... within the "path"
specification.

And if there were a parameter to specify the starting point of a path, I
would not call it "state": I would call it "init_pos" or "start".

Just me.

Jon

On 6/24/2025 5:04 PM, Adrian Mariano via Discuss wrote:

I didn't see that Jon posted an example and am not sure what the point
of confusion is.

include<BOSL2-fork/std.scad>
include<BOSL2-fork/turtle3d.scad>
path = [ "move", 25, "arcright", 7,  "move", 25];
start_pt=move([3,3,20]);
sweep(circle(r=5, $fn=32), turtle3d(path, transforms=true));
color("lightblue")
    sweep(circle(r=5, $fn=32), turtle3d(path, state=start_pt,
transforms=true));

image.png

On Tue, Jun 24, 2025 at 4:00 PM Jon Bondy via Discuss
discuss@lists.openscad.org wrote:

 Thanks, but that is not intuitive at all!

 Jon

 On 6/24/2025 3:50 PM, larry via Discuss wrote:

include <BOSL2/std.scad>
include <BOSL2/turtle3d.scad>

naPath = turtle3d([
    "move", 20,
    "jump", [50, 50, 50],
    "move", 10,
    ],
    state=move([5,10,15]));
    path_sweep(circle(r = 5, $fn = 180), naPath);

 -- 
 This email has been checked for viruses by AVG antivirus software.
 www.avg.com <http://www.avg.com>
 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org

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

As I conceive of it, the "path" is a list of moves, so having another move that is not within "path" is counter-intuitive. I would have expected something like "start", start_pt, "move"... within the "path" specification. And if there were a parameter to specify the starting point of a path, I would not call it "state": I would call it "init_pos" or "start". Just me. Jon On 6/24/2025 5:04 PM, Adrian Mariano via Discuss wrote: > I didn't see that Jon posted an example and am not sure what the point > of confusion is. > > include<BOSL2-fork/std.scad> > include<BOSL2-fork/turtle3d.scad> > path = [ "move", 25, "arcright", 7,  "move", 25]; > start_pt=move([3,3,20]); > sweep(circle(r=5, $fn=32), turtle3d(path, transforms=true)); > color("lightblue") >     sweep(circle(r=5, $fn=32), turtle3d(path, state=start_pt, > transforms=true)); > > image.png > > > On Tue, Jun 24, 2025 at 4:00 PM Jon Bondy via Discuss > <discuss@lists.openscad.org> wrote: > > Thanks, but that is not intuitive at all! > > Jon > > On 6/24/2025 3:50 PM, larry via Discuss wrote: > > include <BOSL2/std.scad> > > include <BOSL2/turtle3d.scad> > > > > naPath = turtle3d([ > >    "move", 20, > >    "jump", [50, 50, 50], > >    "move", 10, > >    ], > >    state=move([5,10,15])); > >    path_sweep(circle(r = 5, $fn = 180), naPath); > > -- > This email has been checked for viruses by AVG antivirus software. > www.avg.com <http://www.avg.com> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
AM
Adrian Mariano
Tue, Jun 24, 2025 10:02 PM

How do you imagine that stroke() or path_sweep() or sweep() can take a path
or transform list and somehow skip a section in the middle?

How would a path produced by turtle or a sequence of
transformations produced by turtle3d() indicate that something was
skipped?

My point is that the thing you are asking for is impossible on the output
side.  Basically the only way to do it would be to have
turtle3d recursively call itself multiple times and return a list of lists
of paths/transforms.  Then you'd have to deal with this complication all
the time for the normal use without skips.  And any time you wanted to use
it e.g. with sweep() you'd still have to run a loop over the list.  So
nothing has been gained.

The reason it's called "state" is because you're setting the turtle's
initial state, which you are permitted to do in a simplified fashion by
just giving a transformation or direction instead of having to give the
full state.  You can give the full state if you want---the starting
transform, initial direction and spin, move distance and default angle.  I
think the theory was that you'd get a full state state like that from a
previous turtle call and then continue from there, though I don't know how
useful that is.

On Tue, Jun 24, 2025 at 5:20 PM Jon Bondy jon@jonbondy.com wrote:

As I conceive of it, the "path" is a list of moves, so having another move
that is not within "path" is counter-intuitive. I would have expected
something like "start", start_pt, "move"... within the "path" specification.

And if there were a parameter to specify the starting point of a path, I
would not call it "state": I would call it "init_pos" or "start".

Just me.

Jon

On 6/24/2025 5:04 PM, Adrian Mariano via Discuss wrote:

I didn't see that Jon posted an example and am not sure what the point of
confusion is.

include<BOSL2-fork/std.scad>
include<BOSL2-fork/turtle3d.scad>
path = [ "move", 25, "arcright", 7,  "move", 25];
start_pt=move([3,3,20]);
sweep(circle(r=5, $fn=32), turtle3d(path, transforms=true));
color("lightblue")
sweep(circle(r=5, $fn=32), turtle3d(path, state=start_pt,
transforms=true));

[image: image.png]

On Tue, Jun 24, 2025 at 4:00 PM Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:

Thanks, but that is not intuitive at all!

Jon

On 6/24/2025 3:50 PM, larry via Discuss wrote:

include <BOSL2/std.scad>
include <BOSL2/turtle3d.scad>

naPath = turtle3d([
"move", 20,
"jump", [50, 50, 50],
"move", 10,
],
state=move([5,10,15]));
path_sweep(circle(r = 5, $fn = 180), naPath);

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com


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

How do you imagine that stroke() or path_sweep() or sweep() can take a path or transform list and somehow skip a section in the middle? How would a path produced by turtle or a sequence of transformations produced by turtle3d() indicate that something was skipped? My point is that the thing you are asking for is impossible on the *output* side. Basically the only way to do it would be to have turtle3d recursively call itself multiple times and return a list of lists of paths/transforms. Then you'd have to deal with this complication all the time for the normal use without skips. And any time you wanted to use it e.g. with sweep() you'd still have to run a loop over the list. So nothing has been gained. The reason it's called "state" is because you're setting the turtle's initial state, which you are permitted to do in a simplified fashion by just giving a transformation or direction instead of having to give the full state. You can give the full state if you want---the starting transform, initial direction and spin, move distance and default angle. I think the theory was that you'd get a full state state like that from a previous turtle call and then continue from there, though I don't know how useful that is. On Tue, Jun 24, 2025 at 5:20 PM Jon Bondy <jon@jonbondy.com> wrote: > As I conceive of it, the "path" is a list of moves, so having another move > that is not within "path" is counter-intuitive. I would have expected > something like "start", start_pt, "move"... within the "path" specification. > > And if there were a parameter to specify the starting point of a path, I > would not call it "state": I would call it "init_pos" or "start". > > Just me. > > Jon > > > On 6/24/2025 5:04 PM, Adrian Mariano via Discuss wrote: > > I didn't see that Jon posted an example and am not sure what the point of > confusion is. > > include<BOSL2-fork/std.scad> > include<BOSL2-fork/turtle3d.scad> > path = [ "move", 25, "arcright", 7, "move", 25]; > start_pt=move([3,3,20]); > sweep(circle(r=5, $fn=32), turtle3d(path, transforms=true)); > color("lightblue") > sweep(circle(r=5, $fn=32), turtle3d(path, state=start_pt, > transforms=true)); > > [image: image.png] > > > On Tue, Jun 24, 2025 at 4:00 PM Jon Bondy via Discuss < > discuss@lists.openscad.org> wrote: > >> Thanks, but that is not intuitive at all! >> >> Jon >> >> On 6/24/2025 3:50 PM, larry via Discuss wrote: >> > include <BOSL2/std.scad> >> > include <BOSL2/turtle3d.scad> >> > >> > naPath = turtle3d([ >> > "move", 20, >> > "jump", [50, 50, 50], >> > "move", 10, >> > ], >> > state=move([5,10,15])); >> > path_sweep(circle(r = 5, $fn = 180), naPath); >> >> -- >> This email has been checked for viruses by AVG antivirus software. >> www.avg.com >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > Virus-free.www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > <#m_-3146537591323994909_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >
SP
Sanjeev Prabhakar
Wed, Jun 25, 2025 2:52 AM

This makes me think about what could be the best way to create a path from
a user perspective.

something like [0,0]x10y10ay45,sqrt(50)a-x45,sqrt(50)
maybe easier for users to understand and write

In the above example it means
start at origin [0,0]
x10 means move 10mm in "x" direction
y10 means move 10 mm in "y" direction
ay45,sqrt(50) means angle from positive 'y' axis of 45 deg with length of
square root 50
and so on

Similar arrangement could be thought for 3d path as well

On Wed, 25 Jun 2025 at 03:33, Adrian Mariano via Discuss <
discuss@lists.openscad.org> wrote:

How do you imagine that stroke() or path_sweep() or sweep() can take a
path or transform list and somehow skip a section in the middle?

How would a path produced by turtle or a sequence of
transformations produced by turtle3d() indicate that something was
skipped?

My point is that the thing you are asking for is impossible on the
output side.  Basically the only way to do it would be to have
turtle3d recursively call itself multiple times and return a list of lists
of paths/transforms.  Then you'd have to deal with this complication all
the time for the normal use without skips.  And any time you wanted to use
it e.g. with sweep() you'd still have to run a loop over the list.  So
nothing has been gained.

The reason it's called "state" is because you're setting the turtle's
initial state, which you are permitted to do in a simplified fashion by
just giving a transformation or direction instead of having to give the
full state.  You can give the full state if you want---the starting
transform, initial direction and spin, move distance and default angle.  I
think the theory was that you'd get a full state state like that from a
previous turtle call and then continue from there, though I don't know how
useful that is.

On Tue, Jun 24, 2025 at 5:20 PM Jon Bondy jon@jonbondy.com wrote:

As I conceive of it, the "path" is a list of moves, so having another
move that is not within "path" is counter-intuitive. I would have expected
something like "start", start_pt, "move"... within the "path" specification.

And if there were a parameter to specify the starting point of a path, I
would not call it "state": I would call it "init_pos" or "start".

Just me.

Jon

On 6/24/2025 5:04 PM, Adrian Mariano via Discuss wrote:

I didn't see that Jon posted an example and am not sure what the point of
confusion is.

include<BOSL2-fork/std.scad>
include<BOSL2-fork/turtle3d.scad>
path = [ "move", 25, "arcright", 7,  "move", 25];
start_pt=move([3,3,20]);
sweep(circle(r=5, $fn=32), turtle3d(path, transforms=true));
color("lightblue")
sweep(circle(r=5, $fn=32), turtle3d(path, state=start_pt,
transforms=true));

[image: image.png]

On Tue, Jun 24, 2025 at 4:00 PM Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:

Thanks, but that is not intuitive at all!

Jon

On 6/24/2025 3:50 PM, larry via Discuss wrote:

include <BOSL2/std.scad>
include <BOSL2/turtle3d.scad>

naPath = turtle3d([
"move", 20,
"jump", [50, 50, 50],
"move", 10,
],
state=move([5,10,15]));
path_sweep(circle(r = 5, $fn = 180), naPath);

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com


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


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

This makes me think about what could be the best way to create a path from a user perspective. something like [0,0]x10y10ay45,sqrt(50)a-x45,sqrt(50) maybe easier for users to understand and write In the above example it means start at origin [0,0] x10 means move 10mm in "x" direction y10 means move 10 mm in "y" direction ay45,sqrt(50) means angle from positive 'y' axis of 45 deg with length of square root 50 and so on Similar arrangement could be thought for 3d path as well On Wed, 25 Jun 2025 at 03:33, Adrian Mariano via Discuss < discuss@lists.openscad.org> wrote: > How do you imagine that stroke() or path_sweep() or sweep() can take a > path or transform list and somehow skip a section in the middle? > > How would a path produced by turtle or a sequence of > transformations produced by turtle3d() indicate that something was > skipped? > > My point is that the thing you are asking for is impossible on the > *output* side. Basically the only way to do it would be to have > turtle3d recursively call itself multiple times and return a list of lists > of paths/transforms. Then you'd have to deal with this complication all > the time for the normal use without skips. And any time you wanted to use > it e.g. with sweep() you'd still have to run a loop over the list. So > nothing has been gained. > > The reason it's called "state" is because you're setting the turtle's > initial state, which you are permitted to do in a simplified fashion by > just giving a transformation or direction instead of having to give the > full state. You can give the full state if you want---the starting > transform, initial direction and spin, move distance and default angle. I > think the theory was that you'd get a full state state like that from a > previous turtle call and then continue from there, though I don't know how > useful that is. > > On Tue, Jun 24, 2025 at 5:20 PM Jon Bondy <jon@jonbondy.com> wrote: > >> As I conceive of it, the "path" is a list of moves, so having another >> move that is not within "path" is counter-intuitive. I would have expected >> something like "start", start_pt, "move"... within the "path" specification. >> >> And if there were a parameter to specify the starting point of a path, I >> would not call it "state": I would call it "init_pos" or "start". >> >> Just me. >> >> Jon >> >> >> On 6/24/2025 5:04 PM, Adrian Mariano via Discuss wrote: >> >> I didn't see that Jon posted an example and am not sure what the point of >> confusion is. >> >> include<BOSL2-fork/std.scad> >> include<BOSL2-fork/turtle3d.scad> >> path = [ "move", 25, "arcright", 7, "move", 25]; >> start_pt=move([3,3,20]); >> sweep(circle(r=5, $fn=32), turtle3d(path, transforms=true)); >> color("lightblue") >> sweep(circle(r=5, $fn=32), turtle3d(path, state=start_pt, >> transforms=true)); >> >> [image: image.png] >> >> >> On Tue, Jun 24, 2025 at 4:00 PM Jon Bondy via Discuss < >> discuss@lists.openscad.org> wrote: >> >>> Thanks, but that is not intuitive at all! >>> >>> Jon >>> >>> On 6/24/2025 3:50 PM, larry via Discuss wrote: >>> > include <BOSL2/std.scad> >>> > include <BOSL2/turtle3d.scad> >>> > >>> > naPath = turtle3d([ >>> > "move", 20, >>> > "jump", [50, 50, 50], >>> > "move", 10, >>> > ], >>> > state=move([5,10,15])); >>> > path_sweep(circle(r = 5, $fn = 180), naPath); >>> >>> -- >>> This email has been checked for viruses by AVG antivirus software. >>> www.avg.com >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> >> >> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> >> Virus-free.www.avg.com >> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> >> <#m_3904504837394086555_m_-3146537591323994909_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
L
larry
Wed, Jun 25, 2025 3:19 AM

On Tue, 2025-06-24 at 16:00 -0400, Jon Bondy wrote:

Thanks, but that is not intuitive at all!

Looking at it now, I think it's at least somewhat intuitive.
From now on I will think of it this way...

Define a path using turtle movement 'commands'.
Then set one or more of starting position, direction, spin, etc.
Then sweep the path with 2D geometry..

On 6/24/2025 3:50 PM, larry via Discuss wrote:

include <BOSL2/std.scad>
include <BOSL2/turtle3d.scad>

naPath = turtle3d([
"move", 20,
"jump", [50, 50, 50],
"move", 10,
],
state=move([5,10,15]));
path_sweep(circle(r = 5, $fn = 180), naPath);

On Tue, 2025-06-24 at 16:00 -0400, Jon Bondy wrote: > Thanks, but that is not intuitive at all! Looking at it now, I think it's at least somewhat intuitive. From now on I will think of it this way... Define a path using turtle movement 'commands'. Then set one or more of starting position, direction, spin, etc. Then sweep the path with 2D geometry.. > On 6/24/2025 3:50 PM, larry via Discuss wrote: > > include <BOSL2/std.scad> > > include <BOSL2/turtle3d.scad> > > > > naPath = turtle3d([ > > "move", 20, > > "jump", [50, 50, 50], > > "move", 10, > > ], > > state=move([5,10,15])); > > path_sweep(circle(r = 5, $fn = 180), naPath); >
RW
Raymond West
Wed, Jun 25, 2025 9:39 AM

On 25/06/2025 03:52, Sanjeev Prabhakar via Discuss wrote:

This makes me think about what could be the best way to create a path
from a user perspective.

G-code has been used for years.

On 25/06/2025 03:52, Sanjeev Prabhakar via Discuss wrote: > This makes me think about what could be the best way to create a path > from a user perspective. > G-code has been used for years.
GH
gene heskett
Wed, Jun 25, 2025 3:38 PM

On 6/25/25 05:39, Raymond West via Discuss wrote:

On 25/06/2025 03:52, Sanjeev Prabhakar via Discuss wrote:

This makes me think about what could be the best way to create a path
from a user perspective.

G-code has been used for years.

G-Code, aka RS-274--D, first proposed in the 1960's by NIST is a moving
target, as canned routines are added to ever more capable machines.

Some steam release by someone who has both:  Its one major downfall is
that its (RS-274-D) designed to be a subtractive process, whereas
OpenSCAD is more of an additive process when applied to generating
G-Code for a 3d printer. Because of this difference, writing a loop for
a printer is difficult, primarily because there is not enough fast 3d
memory to serve as an "I've been there, move to miss it" reference, or
the cpu that can do the interference checking in real time.  I wish we
did have, but we are stuck with layer at a time slicers to generate the
G-Code needed.  That's not likely to change in my remaining lifetime at
a price only large nations can afford. Compared to a routine I wrote for
a milling machine a decade back that finished sharpening a 10" carbide
table saw blade, (they, carbide tipped blades, don't come sharp
regardless of the brand) takes 3 days to run & wears out a dremel
grinder, making a blade that cut several hundred board ft of mahogany,
hard maple, white ash, oak and cherry w/o a single burn mark. Its only
90 lines of code in loops! In comparison, 3d printers are still learning
how to walk in a reasonably straight line.

OpenSCAD is an ideal way to design the 1 or 3 offs of a creative mind
but the result is likely to be a gigabyte or more of GCode for what
looks like a simple project, because the slicer has to totally unwind
what could be a 5000 line loop.

Steam off.

Cheers, Gene Heskett, CET.

"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.

  • Louis D. Brandeis
On 6/25/25 05:39, Raymond West via Discuss wrote: > > On 25/06/2025 03:52, Sanjeev Prabhakar via Discuss wrote: >> This makes me think about what could be the best way to create a path >> from a user perspective. >> > G-code has been used for years. G-Code, aka RS-274--D, first proposed in the 1960's by NIST is a moving target, as canned routines are added to ever more capable machines. Some steam release by someone who has both:  Its one major downfall is that its (RS-274-D) designed to be a subtractive process, whereas OpenSCAD is more of an additive process when applied to generating G-Code for a 3d printer. Because of this difference, writing a loop for a printer is difficult, primarily because there is not enough fast 3d memory to serve as an "I've been there, move to miss it" reference, or the cpu that can do the interference checking in real time.  I wish we did have, but we are stuck with layer at a time slicers to generate the G-Code needed.  That's not likely to change in my remaining lifetime at a price only large nations can afford. Compared to a routine I wrote for a milling machine a decade back that finished sharpening a 10" carbide table saw blade, (they, carbide tipped blades, don't come sharp regardless of the brand) takes 3 days to run & wears out a dremel grinder, making a blade that cut several hundred board ft of mahogany, hard maple, white ash, oak and cherry w/o a single burn mark. Its only 90 lines of code in loops! In comparison, 3d printers are still learning how to walk in a reasonably straight line. OpenSCAD is an ideal way to design the 1 or 3 offs of a creative mind but the result is likely to be a gigabyte or more of GCode for what looks like a simple project, because the slicer has to totally unwind what could be a 5000 line loop. Steam off. Cheers, Gene Heskett, CET. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author, 1940) If we desire respect for the law, we must first make the law respectable. - Louis D. Brandeis