discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Maintaining and debugging scripts

WF
William F. Adams
Thu, Aug 6, 2020 1:38 AM

The thing which I'd really like is an optional Block view like BlockSCAD:
https://www.blockscad3d.com/
William

-----Original Message-----
From: Ron Wheeler via Discuss discuss@lists.openscad.org
To: discuss@lists.openscad.org
Cc: Ron Wheeler rwheeler@artifact-software.com
Sent: Wed, Aug 5, 2020 9:29 pm
Subject: Re: [OpenSCAD] Maintaining and debugging scripts

What would you like in the editor that the OpenSCAD editor lacks?

  • Outline view?
  • Snippets?
  • Projects

On 2020-08-05 2:34 p.m., John Lussmyer wrote:

On Wed Aug 05 10:56:24 PDT 2020 dgarrett@acm.org said:

This doesn't help with debugging, but you can get somewhat smarter editing
using Visual Studio Code with the SCAD extension.

On Wed, Aug 5, 2020 at 10:25 AM ken@volksswitch.org wrote:

I?d love that functionality ? and be willing to pay for it.  I?ve already
donated to OpenSCAD and I hope that others are doing the same.

What I?m really missing is:

Code refactoring / renaming

I keep hoping that somebody will make an SCAD plugin for Eclipse.

--

Bobcats and Cougars, oh my!  http://john.casadelgato.com/Pets

_______________________________________________OpenSCAD mailing listDiscuss@lists.openscad.orghttp://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
Ron Wheeler
Artifact Software
438-345-3369
rwheeler@artifact-software.com _______________________________________________
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

The thing which I'd really like is an optional Block view like BlockSCAD: https://www.blockscad3d.com/ William -----Original Message----- From: Ron Wheeler via Discuss <discuss@lists.openscad.org> To: discuss@lists.openscad.org Cc: Ron Wheeler <rwheeler@artifact-software.com> Sent: Wed, Aug 5, 2020 9:29 pm Subject: Re: [OpenSCAD] Maintaining and debugging scripts What would you like in the editor that the OpenSCAD editor lacks? - Outline view? - Snippets? - Projects On 2020-08-05 2:34 p.m., John Lussmyer wrote: On Wed Aug 05 10:56:24 PDT 2020 dgarrett@acm.org said: This doesn't help with debugging, but you can get somewhat smarter editing using Visual Studio Code with the SCAD extension. On Wed, Aug 5, 2020 at 10:25 AM <ken@volksswitch.org> wrote: I?d love that functionality ? and be willing to pay for it. I?ve already donated to OpenSCAD and I hope that others are doing the same. What I?m really missing is: Code refactoring / renaming I keep hoping that somebody will make an SCAD plugin for Eclipse. -- Bobcats and Cougars, oh my! http://john.casadelgato.com/Pets _______________________________________________OpenSCAD mailing listDiscuss@lists.openscad.orghttp://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Ron Wheeler Artifact Software 438-345-3369 rwheeler@artifact-software.com _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
JL
John Lussmyer
Thu, Aug 6, 2020 2:08 AM

On Wed Aug 05 18:29:40 PDT 2020 discuss@lists.openscad.org said:

What would you like in the editor that the OpenSCAD editor lacks?

  • Outline view?
  • Snippets?
  • Projects

Syntax checking
auto code formatting
code-completion

--

Bobcats and Cougars, oh my!  http://john.casadelgato.com/Pets

On Wed Aug 05 18:29:40 PDT 2020 discuss@lists.openscad.org said: >What would you like in the editor that the OpenSCAD editor lacks? > >- Outline view? >- Snippets? >- Projects Syntax checking auto code formatting code-completion -- Bobcats and Cougars, oh my! http://john.casadelgato.com/Pets
J
jon
Thu, Aug 6, 2020 7:08 AM

If you do this, please allow it to be turned off as an option

On 8/5/2020 10:08 PM, John Lussmyer wrote:

On Wed Aug 05 18:29:40 PDT 2020 discuss@lists.openscad.org said:

What would you like in the editor that the OpenSCAD editor lacks?

  • Outline view?
  • Snippets?
  • Projects

Syntax checking
auto code formatting
code-completion

If you do this, please allow it to be turned off as an option On 8/5/2020 10:08 PM, John Lussmyer wrote: > On Wed Aug 05 18:29:40 PDT 2020 discuss@lists.openscad.org said: >> What would you like in the editor that the OpenSCAD editor lacks? >> >> - Outline view? >> - Snippets? >> - Projects > Syntax checking > auto code formatting > code-completion >
PO
peter_osc@xs4all.nl
Thu, Aug 6, 2020 11:41 AM

I have 20 modules and I can identify about 7 sections in my code that can be
broken up in different files:

  • Parameters.scad (contains all external parameters)
  • Intermediate_results.scad (contains all intermediate constants to
    size, rotate and translate the objects)
  • Modules.scad (Contains all modules. Might be split up into more
    files)
  • Drawing.scad (contains the actual drawing statements)
  • Debug_statements.scad (A big one. Contains all debug echo's)
  • Export.scad (contains all echo stuff to export results to the
    outside world)
  • Visualization_options.scad (contains Booleans which parts are drawn
    and which not)

The project calculates the size and position of all individual pieces and
there might be several thousands of them.

From: Discuss discuss-bounces@lists.openscad.org On Behalf Of Ron Wheeler
via Discuss
Sent: Wednesday, August 5, 2020 17:26
To: discuss@lists.openscad.org
Cc: Ron Wheeler rwheeler@artifact-software.com
Subject: Re: [OpenSCAD] Maintaining and debugging scripts

How many separate modules do you have now?

I was able to break a project up into about 10 modules. Each one is under 80
lines and most are much smaller.

It is probably quite different but the final project consists of over 300
identifiable pieces, each one of which is generated using parameters.

If you can refactor it successfully, you should be able to test each module
separately which helps a lot.

You may have to create some test scaffolding but these might be worthwhile
in reducing the time to test and in reducing the complexity of debugging
individual shapes or sub-assemblies.

I hope that these comments help.

Ron

On 2020-08-05 10:05 a.m., peter_osc@xs4all.nl mailto:peter_osc@xs4all.nl
wrote:

I've been working on a aerodynamics project for modelling alternative shapes
for some weeks now using OpenSCAD. The shapes are dynamically generated upon
a list of parameters, sometimes calculating several (sub)shapes depending on
surrounding shapes.

Now that my code is going towards 1000+ lines I must restructure and
refactor it. OpenSCAD uses a scripting language and I'm running into some
problems that others might have experienced too but I cannot find much
information about: Are there any tools that ease the development of (large)
scripts?

What I'm really missing is:

A debugger and breakpoints

I'm now debugging using echo statements, which is in fact back to the 80's.
It seems to be impossible to stop the script at an arbitrary point. Not even
a pause statement.

Code refactoring / renaming

Is a simple text search and replace that doesn't know any context.

Warnings

For example constants that are defined but never used.

Any ideas?


OpenSCAD mailing list
Discuss@lists.openscad.org mailto:Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
Ron Wheeler
Artifact Software
438-345-3369
rwheeler@artifact-software.com mailto:rwheeler@artifact-software.com

I have 20 modules and I can identify about 7 sections in my code that can be broken up in different files: * Parameters.scad (contains all external parameters) * Intermediate_results.scad (contains all intermediate constants to size, rotate and translate the objects) * Modules.scad (Contains all modules. Might be split up into more files) * Drawing.scad (contains the actual drawing statements) * Debug_statements.scad (A big one. Contains all debug echo's) * Export.scad (contains all echo stuff to export results to the outside world) * Visualization_options.scad (contains Booleans which parts are drawn and which not) The project calculates the size and position of all individual pieces and there might be several thousands of them. From: Discuss <discuss-bounces@lists.openscad.org> On Behalf Of Ron Wheeler via Discuss Sent: Wednesday, August 5, 2020 17:26 To: discuss@lists.openscad.org Cc: Ron Wheeler <rwheeler@artifact-software.com> Subject: Re: [OpenSCAD] Maintaining and debugging scripts How many separate modules do you have now? I was able to break a project up into about 10 modules. Each one is under 80 lines and most are much smaller. It is probably quite different but the final project consists of over 300 identifiable pieces, each one of which is generated using parameters. If you can refactor it successfully, you should be able to test each module separately which helps a lot. You may have to create some test scaffolding but these might be worthwhile in reducing the time to test and in reducing the complexity of debugging individual shapes or sub-assemblies. I hope that these comments help. Ron On 2020-08-05 10:05 a.m., peter_osc@xs4all.nl <mailto:peter_osc@xs4all.nl> wrote: I've been working on a aerodynamics project for modelling alternative shapes for some weeks now using OpenSCAD. The shapes are dynamically generated upon a list of parameters, sometimes calculating several (sub)shapes depending on surrounding shapes. Now that my code is going towards 1000+ lines I must restructure and refactor it. OpenSCAD uses a scripting language and I'm running into some problems that others might have experienced too but I cannot find much information about: Are there any tools that ease the development of (large) scripts? What I'm really missing is: A debugger and breakpoints I'm now debugging using echo statements, which is in fact back to the 80's. It seems to be impossible to stop the script at an arbitrary point. Not even a pause statement. Code refactoring / renaming Is a simple text search and replace that doesn't know any context. Warnings For example constants that are defined but never used. Any ideas? _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Ron Wheeler Artifact Software 438-345-3369 rwheeler@artifact-software.com <mailto:rwheeler@artifact-software.com>
PO
peter_osc@xs4all.nl
Thu, Aug 6, 2020 11:42 AM

Thanks! I will try that.

From: Discuss discuss-bounces@lists.openscad.org On Behalf Of nop head
Sent: Wednesday, August 5, 2020 18:03
To: OpenSCAD general discussion discuss@lists.openscad.org
Subject: Re: [OpenSCAD] Maintaining and debugging scripts

Using assert() instead of echo with stop on first warning is a bit like a breakpoint in that you will get a stack trace as well as any info you add to the assert message.

On Wed, 5 Aug 2020 at 16:26, Ron Wheeler via Discuss <discuss@lists.openscad.org mailto:discuss@lists.openscad.org > wrote:

How many separate modules do you have now?

I was able to break a project up into about 10 modules. Each one is under 80 lines and most are much smaller.

It is probably quite different but the final project consists of over 300 identifiable pieces, each one of which is generated using parameters.

If you can refactor it successfully, you should be able to test each module separately which helps a lot.

You may have to create some test scaffolding but these might be worthwhile in reducing the time to test and in reducing the complexity of debugging individual shapes or sub-assemblies.

I hope that these comments help.

Ron

On 2020-08-05 10:05 a.m., peter_osc@xs4all.nl mailto:peter_osc@xs4all.nl  wrote:

I’ve been working on a aerodynamics project for modelling alternative shapes for some weeks now using OpenSCAD. The shapes are dynamically generated upon a list of parameters, sometimes calculating several (sub)shapes depending on surrounding shapes.

Now that my code is going towards 1000+ lines I must restructure and refactor it. OpenSCAD uses a scripting language and I’m running into some problems that others might have experienced too but I cannot find much information about: Are there any tools that ease the development of (large) scripts?

What I’m really missing is:

A debugger and breakpoints

I’m now debugging using echo statements, which is in fact back to the 80’s. It seems to be impossible to stop the script at an arbitrary point. Not even a pause statement.

Code refactoring / renaming

Is a simple text search and replace that doesn’t know any context.

Warnings

For example constants that are defined but never used.

Any ideas?


OpenSCAD mailing list
Discuss@lists.openscad.org mailto:Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
Ron Wheeler
Artifact Software
438-345-3369
rwheeler@artifact-software.com mailto:rwheeler@artifact-software.com


OpenSCAD mailing list
Discuss@lists.openscad.org mailto:Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Thanks! I will try that. From: Discuss <discuss-bounces@lists.openscad.org> On Behalf Of nop head Sent: Wednesday, August 5, 2020 18:03 To: OpenSCAD general discussion <discuss@lists.openscad.org> Subject: Re: [OpenSCAD] Maintaining and debugging scripts Using assert() instead of echo with stop on first warning is a bit like a breakpoint in that you will get a stack trace as well as any info you add to the assert message. On Wed, 5 Aug 2020 at 16:26, Ron Wheeler via Discuss <discuss@lists.openscad.org <mailto:discuss@lists.openscad.org> > wrote: How many separate modules do you have now? I was able to break a project up into about 10 modules. Each one is under 80 lines and most are much smaller. It is probably quite different but the final project consists of over 300 identifiable pieces, each one of which is generated using parameters. If you can refactor it successfully, you should be able to test each module separately which helps a lot. You may have to create some test scaffolding but these might be worthwhile in reducing the time to test and in reducing the complexity of debugging individual shapes or sub-assemblies. I hope that these comments help. Ron On 2020-08-05 10:05 a.m., peter_osc@xs4all.nl <mailto:peter_osc@xs4all.nl> wrote: I’ve been working on a aerodynamics project for modelling alternative shapes for some weeks now using OpenSCAD. The shapes are dynamically generated upon a list of parameters, sometimes calculating several (sub)shapes depending on surrounding shapes. Now that my code is going towards 1000+ lines I must restructure and refactor it. OpenSCAD uses a scripting language and I’m running into some problems that others might have experienced too but I cannot find much information about: Are there any tools that ease the development of (large) scripts? What I’m really missing is: A debugger and breakpoints I’m now debugging using echo statements, which is in fact back to the 80’s. It seems to be impossible to stop the script at an arbitrary point. Not even a pause statement. Code refactoring / renaming Is a simple text search and replace that doesn’t know any context. Warnings For example constants that are defined but never used. Any ideas? _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Ron Wheeler Artifact Software 438-345-3369 rwheeler@artifact-software.com <mailto:rwheeler@artifact-software.com> _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
PO
peter_osc@xs4all.nl
Thu, Aug 6, 2020 11:46 AM

Notepad++ has comparable options.
OpenSCAD's search & replace should be used with care as it doesn't have
options like case sensitivity and whole words only.
In the beginning I messed up my code regularly using the replace option.

Peter

-----Original Message-----
From: Discuss discuss-bounces@lists.openscad.org On Behalf Of Tim V.
Shaporev
Sent: Wednesday, August 5, 2020 19:00
To: discuss@lists.openscad.org
Subject: Re: [OpenSCAD] Maintaining and debugging scripts

For search and rename I use UNIX tools (e.g. MinGW for Windoze):
grep, sed, vi/vim

grep could also help to find all instances of the given name.

Just my $0.02
Tim

On 8/5/2020 5:05 PM, peter_osc@xs4all.nl wrote:

I've been working on a aerodynamics project for modelling alternative
shapes for some weeks now using OpenSCAD. The shapes are dynamically
generated upon a list of parameters, sometimes calculating several
(sub)shapes depending on surrounding shapes.

Now that my code is going towards 1000+ lines I must restructure and
refactor it. OpenSCAD uses a scripting language and I'm running into
some problems that others might have experienced too but I cannot find
much information about: Are there any tools that ease the development
of
(large) scripts?

What I'm really missing is:

A debugger and breakpoints

I'm now debugging using echo statements, which is in fact back to the
80's. It seems to be impossible to stop the script at an arbitrary
point. Not even a pause statement.

Code refactoring / renaming

Is a simple text search and replace that doesn't know any context.

Warnings

For example constants that are defined but never used.

Any ideas?


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Notepad++ has comparable options. OpenSCAD's search & replace should be used with care as it doesn't have options like case sensitivity and whole words only. In the beginning I messed up my code regularly using the replace option. Peter -----Original Message----- From: Discuss <discuss-bounces@lists.openscad.org> On Behalf Of Tim V. Shaporev Sent: Wednesday, August 5, 2020 19:00 To: discuss@lists.openscad.org Subject: Re: [OpenSCAD] Maintaining and debugging scripts For search and rename I use UNIX tools (e.g. MinGW for Windoze): grep, sed, vi/vim grep could also help to find all instances of the given name. Just my $0.02 Tim On 8/5/2020 5:05 PM, peter_osc@xs4all.nl wrote: > I've been working on a aerodynamics project for modelling alternative > shapes for some weeks now using OpenSCAD. The shapes are dynamically > generated upon a list of parameters, sometimes calculating several > (sub)shapes depending on surrounding shapes. > > Now that my code is going towards 1000+ lines I must restructure and > refactor it. OpenSCAD uses a scripting language and I'm running into > some problems that others might have experienced too but I cannot find > much information about: Are there any tools that ease the development > of > (large) scripts? > > What I'm really missing is: > > A debugger and breakpoints > > I'm now debugging using echo statements, which is in fact back to the > 80's. It seems to be impossible to stop the script at an arbitrary > point. Not even a pause statement. > > Code refactoring / renaming > > Is a simple text search and replace that doesn't know any context. > > Warnings > > For example constants that are defined but never used. > > Any ideas? > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
RW
Ron Wheeler
Thu, Aug 6, 2020 12:10 PM

Looks like you have a very well thought out plan.

It sounds like you are right about breaking up Modules.scad. That should
make it easier to test.

Ron

On 2020-08-06 7:41 a.m., peter_osc@xs4all.nl wrote:

I have 20 modules and I can identify about 7 sections in my code that
can be broken up in different files:

  • Parameters.scad (contains all external parameters)
  • Intermediate_results.scad (contains all intermediate constants to
    size, rotate and translate the objects)
  • Modules.scad (Contains all modules. Might be split up into more files)
  • Drawing.scad (contains the actual drawing statements)
  • Debug_statements.scad (A big one. Contains all debug echo’s)
  • Export.scad (contains all echo stuff to export results to the
    outside world)
  • Visualization_options.scad (contains Booleans which parts are
    drawn and which not)

The project calculates the size and position of all individual pieces
and there might be several thousands of them.

From: Discuss discuss-bounces@lists.openscad.org *On Behalf Of
*Ron Wheeler via Discuss
Sent: Wednesday, August 5, 2020 17:26
To: discuss@lists.openscad.org
Cc: Ron Wheeler rwheeler@artifact-software.com
Subject: Re: [OpenSCAD] Maintaining and debugging scripts

How many separate modules do you have now?

I was able to break a project up into about 10 modules. Each one is
under 80 lines and most are much smaller.

It is probably quite different but the final project consists of over
300 identifiable pieces, each one of which is generated using parameters.

If you can refactor it successfully, you should be able to test each
module separately which helps a lot.

You may have to create some test scaffolding but these might be
worthwhile in reducing the time to test and in reducing the complexity
of debugging individual shapes or sub-assemblies.

I hope that these comments help.

Ron

On 2020-08-05 10:05 a.m., peter_osc@xs4all.nl
mailto:peter_osc@xs4all.nl wrote:

 I’ve been working on a aerodynamics project for modelling
 alternative shapes for some weeks now using OpenSCAD. The shapes
 are dynamically generated upon a list of parameters, sometimes
 calculating several (sub)shapes depending on surrounding shapes.

 Now that my code is going towards 1000+ lines I must restructure
 and refactor it. OpenSCAD uses a scripting language and I’m
 running into some problems that others might have experienced too
 but I cannot find much information about: Are there any tools that
 ease the development of (large) scripts?

 What I’m really missing is:

 A debugger and breakpoints

 I’m now debugging using echo statements, which is in fact back to
 the 80’s. It seems to be impossible to stop the script at an
 arbitrary point. Not even a pause statement.

 Code refactoring / renaming

 Is a simple text search and replace that doesn’t know any context.

 Warnings

 For example constants that are defined but never used.

 Any ideas?



 _______________________________________________

 OpenSCAD mailing list

 Discuss@lists.openscad.org  <mailto:Discuss@lists.openscad.org>

 http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
Ron Wheeler
Artifact Software
438-345-3369
rwheeler@artifact-software.com  mailto:rwheeler@artifact-software.com

--
Ron Wheeler
Artifact Software
438-345-3369
rwheeler@artifact-software.com

Looks like you have a very well thought out plan. It sounds like you are right about breaking up Modules.scad. That should make it easier to test. Ron On 2020-08-06 7:41 a.m., peter_osc@xs4all.nl wrote: > > I have 20 modules and I can identify about 7 sections in my code that > can be broken up in different files: > > * Parameters.scad (contains all external parameters) > * Intermediate_results.scad (contains all intermediate constants to > size, rotate and translate the objects) > * Modules.scad (Contains all modules. Might be split up into more files) > * Drawing.scad (contains the actual drawing statements) > * Debug_statements.scad (A big one. Contains all debug echo’s) > * Export.scad (contains all echo stuff to export results to the > outside world) > * Visualization_options.scad (contains Booleans which parts are > drawn and which not) > > The project calculates the size and position of all individual pieces > and there might be several thousands of them. > > *From:* Discuss <discuss-bounces@lists.openscad.org> *On Behalf Of > *Ron Wheeler via Discuss > *Sent:* Wednesday, August 5, 2020 17:26 > *To:* discuss@lists.openscad.org > *Cc:* Ron Wheeler <rwheeler@artifact-software.com> > *Subject:* Re: [OpenSCAD] Maintaining and debugging scripts > > How many separate modules do you have now? > > I was able to break a project up into about 10 modules. Each one is > under 80 lines and most are much smaller. > > It is probably quite different but the final project consists of over > 300 identifiable pieces, each one of which is generated using parameters. > > > If you can refactor it successfully, you should be able to test each > module separately which helps a lot. > > You may have to create some test scaffolding but these might be > worthwhile in reducing the time to test and in reducing the complexity > of debugging individual shapes or sub-assemblies. > > I hope that these comments help. > > Ron > > On 2020-08-05 10:05 a.m., peter_osc@xs4all.nl > <mailto:peter_osc@xs4all.nl> wrote: > > I’ve been working on a aerodynamics project for modelling > alternative shapes for some weeks now using OpenSCAD. The shapes > are dynamically generated upon a list of parameters, sometimes > calculating several (sub)shapes depending on surrounding shapes. > > Now that my code is going towards 1000+ lines I must restructure > and refactor it. OpenSCAD uses a scripting language and I’m > running into some problems that others might have experienced too > but I cannot find much information about: Are there any tools that > ease the development of (large) scripts? > > What I’m really missing is: > > A debugger and breakpoints > > I’m now debugging using echo statements, which is in fact back to > the 80’s. It seems to be impossible to stop the script at an > arbitrary point. Not even a pause statement. > > Code refactoring / renaming > > Is a simple text search and replace that doesn’t know any context. > > Warnings > > For example constants that are defined but never used. > > Any ideas? > > > > _______________________________________________ > > OpenSCAD mailing list > > Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org> > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > > -- > Ron Wheeler > Artifact Software > 438-345-3369 > rwheeler@artifact-software.com <mailto:rwheeler@artifact-software.com> -- Ron Wheeler Artifact Software 438-345-3369 rwheeler@artifact-software.com
AH
Alex Harms
Sat, Aug 8, 2020 3:09 PM

My workflow has been to open up the file(s) in my editor of choice, and have only the preview window and the console open from openscad. Simply never  using the openscad editor has been much nicer. I found some openscad syntax highlighting for vim, so I’m set there.

Lately I’ve been developing some scripts to use the command line interface, and the terminal program I’m using can display graphics (kitty) so I’m not interacting with the GUI at all anymore, which is even better.

The script is bash, and it’s in github, under the name openscad-cli. Note, the readme is outdated because it’s baby and I haven’t made it a thing yet. I’m only telling y’all in case it helps somebody with their projects.

(I really love openscad, and I’m glad the GUI exists. I’d never have gotten started otherwise.)

Note: If anything I said seems like gibberish and you’d like to know more, please ask. I’m happy to share more.

On Aug 5, 2020, at 13:57, Don Garrett dgarrett@acm.org wrote:


This doesn't help with debugging, but you can get somewhat smarter editing using Visual Studio Code with the SCAD extension.

On Wed, Aug 5, 2020 at 10:25 AM ken@volksswitch.org wrote:
I’d love that functionality – and be willing to pay for it.  I’ve already donated to OpenSCAD and I hope that others are doing the same.

Maybe the people who develop OpenSCAD will consider developing it.  I know that there are some complexities around order of statement execution that can make things very complex.

From: peter_osc@xs4all.nl peter_osc@xs4all.nl
Sent: Wednesday, August 5, 2020 8:06 AM
To: discuss@lists.openscad.org
Subject: [OpenSCAD] Maintaining and debugging scripts

I’ve been working on a aerodynamics project for modelling alternative shapes for some weeks now using OpenSCAD. The shapes are dynamically generated upon a list of parameters, sometimes calculating several (sub)shapes depending on surrounding shapes.

Now that my code is going towards 1000+ lines I must restructure and refactor it. OpenSCAD uses a scripting language and I’m running into some problems that others might have experienced too but I cannot find much information about: Are there any tools that ease the development of (large) scripts?

What I’m really missing is:

A debugger and breakpoints

I’m now debugging using echo statements, which is in fact back to the 80’s. It seems to be impossible to stop the script at an arbitrary point. Not even a pause statement.

Code refactoring / renaming

Is a simple text search and replace that doesn’t know any context.

Warnings

For example constants that are defined but never used.

Any ideas?


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

My workflow has been to open up the file(s) in my editor of choice, and have only the preview window and the console open from openscad. Simply never using the openscad editor has been much nicer. I found some openscad syntax highlighting for vim, so I’m set there. Lately I’ve been developing some scripts to use the command line interface, and the terminal program I’m using can display graphics (kitty) so I’m not interacting with the GUI at all anymore, which is even better. The script is bash, and it’s in github, under the name openscad-cli. Note, the readme is outdated because it’s baby and I haven’t made it a thing yet. I’m only telling y’all in case it helps somebody with their projects. (I really love openscad, and I’m glad the GUI exists. I’d never have gotten started otherwise.) Note: If anything I said seems like gibberish and you’d like to know more, please ask. I’m happy to share more. > On Aug 5, 2020, at 13:57, Don Garrett <dgarrett@acm.org> wrote: > >  > This doesn't help with debugging, but you can get somewhat smarter editing using Visual Studio Code with the SCAD extension. > > >> On Wed, Aug 5, 2020 at 10:25 AM <ken@volksswitch.org> wrote: >> I’d love that functionality – and be willing to pay for it. I’ve already donated to OpenSCAD and I hope that others are doing the same. >> >> >> >> Maybe the people who develop OpenSCAD will consider developing it. I know that there are some complexities around order of statement execution that can make things very complex. >> >> >> >> From: peter_osc@xs4all.nl <peter_osc@xs4all.nl> >> Sent: Wednesday, August 5, 2020 8:06 AM >> To: discuss@lists.openscad.org >> Subject: [OpenSCAD] Maintaining and debugging scripts >> >> >> >> I’ve been working on a aerodynamics project for modelling alternative shapes for some weeks now using OpenSCAD. The shapes are dynamically generated upon a list of parameters, sometimes calculating several (sub)shapes depending on surrounding shapes. >> >> >> >> Now that my code is going towards 1000+ lines I must restructure and refactor it. OpenSCAD uses a scripting language and I’m running into some problems that others might have experienced too but I cannot find much information about: Are there any tools that ease the development of (large) scripts? >> >> >> >> What I’m really missing is: >> >> >> >> A debugger and breakpoints >> >> I’m now debugging using echo statements, which is in fact back to the 80’s. It seems to be impossible to stop the script at an arbitrary point. Not even a pause statement. >> >> >> >> Code refactoring / renaming >> >> Is a simple text search and replace that doesn’t know any context. >> >> >> >> Warnings >> >> For example constants that are defined but never used. >> >> >> >> Any ideas? >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > -- > Don > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org