discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Step through code?

JA
joe a
Wed, Feb 1, 2023 7:53 PM

Again the Noob.

Have some existing scad files I wish to modify.

I find myself wishing for a means to "step through" the code and have
the affected part in the rendered view become highlighted at least to
some "gross" degree.

Is it possible at this time?

Again the Noob. Have some existing scad files I wish to modify. I find myself wishing for a means to "step through" the code and have the affected part in the rendered view become highlighted at least to some "gross" degree. Is it possible at this time?
JB
Jordan Brown
Wed, Feb 1, 2023 7:57 PM

On 2/1/2023 11:53 AM, joe a wrote:

Have some existing scad files I wish to modify.

I find myself wishing for a means to "step through" the code and have
the affected part in the rendered view become highlighted at least to
some "gross" degree.

Is it possible at this time?

No.

But you might look at the modifiers; they can be helpful in that area.

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters

On 2/1/2023 11:53 AM, joe a wrote: > Have some existing scad files I wish to modify. > > I find myself wishing for a means to "step through" the code and have > the affected part in the rendered view become highlighted at least to > some "gross" degree. > > Is it possible at this time? No. But you might look at the modifiers; they can be helpful in that area. https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters
TP
Torsten Paul
Wed, Feb 1, 2023 7:57 PM

On 01.02.23 20:53, joe a wrote:

I find myself wishing for a means to "step through" the code and
have the affected part in the rendered view become highlighted at
least to some "gross" degree.

In classic sense: no.

You can add ! in front of something to render only this subtree.

You can add # in front of multiple parts to preview everything and
highlight those parts.

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters

You can right click in the view port (in preview mode) to jump to
the code generating this geometry - with some limitations.

ciao,
Torsten.

On 01.02.23 20:53, joe a wrote: > I find myself wishing for a means to "step through" the code and > have the affected part in the rendered view become highlighted at > least to some "gross" degree. In classic sense: no. You can add ! in front of something to render *only* this subtree. You can add # in front of multiple parts to preview everything and highlight those parts. https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters You can right click in the view port (in preview mode) to jump to the code generating this geometry - with some limitations. ciao, Torsten.
BC
Bob Carlson
Thu, Feb 2, 2023 3:52 AM

The # highlight works only when you do F5, not F6.

You can also use echo. It’s worth spending some time learning the various ways to use this. Use str() with it. Relevant to echo is all the threads, including the recent one, about order of execution. Echo can be really confusing if you do not understand order of execution when you do "A(args) B(args) C(args)" for example.

-Bob
Tucson AZ

On Feb 1, 2023, at 12:57, Torsten Paul Torsten.Paul@gmx.de wrote:

On 01.02.23 20:53, joe a wrote:

I find myself wishing for a means to "step through" the code and
have the affected part in the rendered view become highlighted at
least to some "gross" degree.

In classic sense: no.

You can add ! in front of something to render only this subtree.

You can add # in front of multiple parts to preview everything and
highlight those parts.

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters

You can right click in the view port (in preview mode) to jump to
the code generating this geometry - with some limitations.

ciao,
Torsten.


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

The # highlight works only when you do F5, not F6. You can also use echo. It’s worth spending some time learning the various ways to use this. Use str() with it. Relevant to echo is all the threads, including the recent one, about order of execution. Echo can be really confusing if you do not understand order of execution when you do "A(args) B(args) C(args)" for example. -Bob Tucson AZ On Feb 1, 2023, at 12:57, Torsten Paul <Torsten.Paul@gmx.de> wrote: On 01.02.23 20:53, joe a wrote: > I find myself wishing for a means to "step through" the code and > have the affected part in the rendered view become highlighted at > least to some "gross" degree. In classic sense: no. You can add ! in front of something to render *only* this subtree. You can add # in front of multiple parts to preview everything and highlight those parts. https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters You can right click in the view port (in preview mode) to jump to the code generating this geometry - with some limitations. ciao, Torsten. _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org
FH
Father Horton
Thu, Feb 2, 2023 4:01 AM

Also note that you can use echo() in a let statement. You have to supply a
dummy variable to receive the value of the function call, but it works.

On Wed, Feb 1, 2023 at 9:53 PM Bob Carlson bob@rjcarlson.com wrote:

The # highlight works only when you do F5, not F6.

You can also use echo. It’s worth spending some time learning the various
ways to use this. Use str() with it. Relevant to echo is all the threads,
including the recent one, about order of execution. Echo can be really
confusing if you do not understand order of execution when you do "A(args)
B(args) C(args)" for example.

-Bob
Tucson AZ

On Feb 1, 2023, at 12:57, Torsten Paul Torsten.Paul@gmx.de wrote:

On 01.02.23 20:53, joe a wrote:

I find myself wishing for a means to "step through" the code and
have the affected part in the rendered view become highlighted at
least to some "gross" degree.

In classic sense: no.

You can add ! in front of something to render only this subtree.

You can add # in front of multiple parts to preview everything and
highlight those parts.

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters

You can right click in the view port (in preview mode) to jump to
the code generating this geometry - with some limitations.

ciao,
Torsten.


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

Also note that you can use echo() in a let statement. You have to supply a dummy variable to receive the value of the function call, but it works. On Wed, Feb 1, 2023 at 9:53 PM Bob Carlson <bob@rjcarlson.com> wrote: > The # highlight works only when you do F5, not F6. > > You can also use echo. It’s worth spending some time learning the various > ways to use this. Use str() with it. Relevant to echo is all the threads, > including the recent one, about order of execution. Echo can be really > confusing if you do not understand order of execution when you do "A(args) > B(args) C(args)" for example. > > -Bob > Tucson AZ > > > > On Feb 1, 2023, at 12:57, Torsten Paul <Torsten.Paul@gmx.de> wrote: > > On 01.02.23 20:53, joe a wrote: > > I find myself wishing for a means to "step through" the code and > have the affected part in the rendered view become highlighted at > least to some "gross" degree. > > > In classic sense: no. > > You can add ! in front of something to render *only* this subtree. > > You can add # in front of multiple parts to preview everything and > highlight those parts. > > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters > > You can right click in the view port (in preview mode) to jump to > the code generating this geometry - with some limitations. > > ciao, > Torsten. > _______________________________________________ > 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 >
AM
Adrian Mariano
Thu, Feb 2, 2023 11:18 AM

You may need to use a dummy variable anyway, even in modules, do to order
of execution.  If you have this:

echo(myvariable);
x=f(myvariable);

then the assignment to x runs before the echo, which is a module, and if it
creates an error, it will stop your program and prevent the echo from ever
running, so then you don't understand why you got the error.  Changing it
to dummy=echo(myvariable) makes the echo into an assignment as well, and
then it runs before the x assignment.

On Wed, Feb 1, 2023 at 11:03 PM Father Horton fatherhorton@gmail.com
wrote:

Also note that you can use echo() in a let statement. You have to supply a
dummy variable to receive the value of the function call, but it works.

On Wed, Feb 1, 2023 at 9:53 PM Bob Carlson bob@rjcarlson.com wrote:

The # highlight works only when you do F5, not F6.

You can also use echo. It’s worth spending some time learning the various
ways to use this. Use str() with it. Relevant to echo is all the threads,
including the recent one, about order of execution. Echo can be really
confusing if you do not understand order of execution when you do "A(args)
B(args) C(args)" for example.

-Bob
Tucson AZ

On Feb 1, 2023, at 12:57, Torsten Paul Torsten.Paul@gmx.de wrote:

On 01.02.23 20:53, joe a wrote:

I find myself wishing for a means to "step through" the code and
have the affected part in the rendered view become highlighted at
least to some "gross" degree.

In classic sense: no.

You can add ! in front of something to render only this subtree.

You can add # in front of multiple parts to preview everything and
highlight those parts.

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters

You can right click in the view port (in preview mode) to jump to
the code generating this geometry - with some limitations.

ciao,
Torsten.


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


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

You may need to use a dummy variable anyway, even in modules, do to order of execution. If you have this: echo(myvariable); x=f(myvariable); then the assignment to x runs before the echo, which is a module, and if it creates an error, it will stop your program and prevent the echo from ever running, so then you don't understand why you got the error. Changing it to dummy=echo(myvariable) makes the echo into an assignment as well, and then it runs before the x assignment. On Wed, Feb 1, 2023 at 11:03 PM Father Horton <fatherhorton@gmail.com> wrote: > Also note that you can use echo() in a let statement. You have to supply a > dummy variable to receive the value of the function call, but it works. > > On Wed, Feb 1, 2023 at 9:53 PM Bob Carlson <bob@rjcarlson.com> wrote: > >> The # highlight works only when you do F5, not F6. >> >> You can also use echo. It’s worth spending some time learning the various >> ways to use this. Use str() with it. Relevant to echo is all the threads, >> including the recent one, about order of execution. Echo can be really >> confusing if you do not understand order of execution when you do "A(args) >> B(args) C(args)" for example. >> >> -Bob >> Tucson AZ >> >> >> >> On Feb 1, 2023, at 12:57, Torsten Paul <Torsten.Paul@gmx.de> wrote: >> >> On 01.02.23 20:53, joe a wrote: >> >> I find myself wishing for a means to "step through" the code and >> have the affected part in the rendered view become highlighted at >> least to some "gross" degree. >> >> >> In classic sense: no. >> >> You can add ! in front of something to render *only* this subtree. >> >> You can add # in front of multiple parts to preview everything and >> highlight those parts. >> >> https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters >> >> You can right click in the view port (in preview mode) to jump to >> the code generating this geometry - with some limitations. >> >> ciao, >> Torsten. >> _______________________________________________ >> 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 >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
FH
Father Horton
Thu, Feb 2, 2023 12:05 PM

Which is an example of why you can’t step through OpenSCAD code: execution
order is not necessarily linear.

On Thu, Feb 2, 2023 at 5:19 AM Adrian Mariano avm4@cornell.edu wrote:

You may need to use a dummy variable anyway, even in modules, do to order
of execution.  If you have this:

echo(myvariable);
x=f(myvariable);

then the assignment to x runs before the echo, which is a module, and if
it creates an error, it will stop your program and prevent the echo from
ever running, so then you don't understand why you got the error.
Changing it to dummy=echo(myvariable) makes the echo into an assignment as
well, and then it runs before the x assignment.

On Wed, Feb 1, 2023 at 11:03 PM Father Horton fatherhorton@gmail.com
wrote:

Also note that you can use echo() in a let statement. You have to supply
a dummy variable to receive the value of the function call, but it works.

On Wed, Feb 1, 2023 at 9:53 PM Bob Carlson bob@rjcarlson.com wrote:

The # highlight works only when you do F5, not F6.

You can also use echo. It’s worth spending some time learning the
various ways to use this. Use str() with it. Relevant to echo is all the
threads, including the recent one, about order of execution. Echo can be
really confusing if you do not understand order of execution when you do
"A(args) B(args) C(args)" for example.

-Bob
Tucson AZ

On Feb 1, 2023, at 12:57, Torsten Paul Torsten.Paul@gmx.de wrote:

On 01.02.23 20:53, joe a wrote:

I find myself wishing for a means to "step through" the code and
have the affected part in the rendered view become highlighted at
least to some "gross" degree.

In classic sense: no.

You can add ! in front of something to render only this subtree.

You can add # in front of multiple parts to preview everything and
highlight those parts.

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters

You can right click in the view port (in preview mode) to jump to
the code generating this geometry - with some limitations.

ciao,
Torsten.


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


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

Which is an example of why you can’t step through OpenSCAD code: execution order is not necessarily linear. On Thu, Feb 2, 2023 at 5:19 AM Adrian Mariano <avm4@cornell.edu> wrote: > You may need to use a dummy variable anyway, even in modules, do to order > of execution. If you have this: > > echo(myvariable); > x=f(myvariable); > > then the assignment to x runs before the echo, which is a module, and if > it creates an error, it will stop your program and prevent the echo from > ever running, so then you don't understand why you got the error. > Changing it to dummy=echo(myvariable) makes the echo into an assignment as > well, and then it runs before the x assignment. > > On Wed, Feb 1, 2023 at 11:03 PM Father Horton <fatherhorton@gmail.com> > wrote: > >> Also note that you can use echo() in a let statement. You have to supply >> a dummy variable to receive the value of the function call, but it works. >> >> On Wed, Feb 1, 2023 at 9:53 PM Bob Carlson <bob@rjcarlson.com> wrote: >> >>> The # highlight works only when you do F5, not F6. >>> >>> You can also use echo. It’s worth spending some time learning the >>> various ways to use this. Use str() with it. Relevant to echo is all the >>> threads, including the recent one, about order of execution. Echo can be >>> really confusing if you do not understand order of execution when you do >>> "A(args) B(args) C(args)" for example. >>> >>> -Bob >>> Tucson AZ >>> >>> >>> >>> On Feb 1, 2023, at 12:57, Torsten Paul <Torsten.Paul@gmx.de> wrote: >>> >>> On 01.02.23 20:53, joe a wrote: >>> >>> I find myself wishing for a means to "step through" the code and >>> have the affected part in the rendered view become highlighted at >>> least to some "gross" degree. >>> >>> >>> In classic sense: no. >>> >>> You can add ! in front of something to render *only* this subtree. >>> >>> You can add # in front of multiple parts to preview everything and >>> highlight those parts. >>> >>> https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Modifier_Characters >>> >>> You can right click in the view port (in preview mode) to jump to >>> the code generating this geometry - with some limitations. >>> >>> ciao, >>> Torsten. >>> _______________________________________________ >>> 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 >>> >> _______________________________________________ >> 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 >