new version scad2python script and batch script

4 views
Skip to first unread message

Matthieu Hendriks

unread,
Dec 1, 2025, 9:01:23 AMDec 1
to PythonSCAD

Hi all,

I’ve released a new version of scad2python (s2p.py), which now includes automatic generation of show() calls for created objects. All objects created at level 0, as well as those created through function calls, are collected in an objs list that will be shown automatically.

I also created a Python script (batchs2p.py) that recursively processes a folder and converts every .scad file into a .py file, including logging and related functionality, keeping original scad files.

The tools are working, but not perfect yet. A few current limitations:

  • Comments are skipped (handling inline comments turned out to be too complex for now)

  • Intersections of child objects are still not processed correctly

  • Not all syntax is converted correctly to python

I would really appreciate some help or collaboration if anyone is interested in contributing to this small project.


Thanks in advance!

Kind regards,

Matthieu



batchs2p.py
s2p.py

Guenther Sohler

unread,
Dec 1, 2025, 10:29:54 AMDec 1
to Matthieu Hendriks, PythonSCAD
Hey, that's great!

And yes: I am offering to collaborate!
And its great, as it uses a LEXER internally, which is huge benefit
Ideally we would sync this lexer to 

This is the  internal lexer/parser which openscad uses. If you get a 100% sync, we can be confident that  the converted can parse all openscad code.

But for good collaboration it would help to put this on a web control like git.
Without git there will be permanent synchronization issues like

* Can I put my changes in now ? Did you finish with your changes? Do I own the recent version
* And of course: communication will experience 0 communication delay

I could spare a nice place for that in the github repository if you liked



--
You received this message because you are subscribed to the Google Groups "PythonSCAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonscad+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pythonscad/4a1435fe-fd4e-45f7-b82d-9816b6f2a147n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

matthieu.hendriks

unread,
Dec 1, 2025, 11:32:24 AMDec 1
to Guenther Sohler, PythonSCAD
It is the most recent version and yes please add your changes and put it on GitHub. 
Thanks.



Verzonden vanaf mijn Galaxy


-------- Oorspronkelijk bericht --------
Van: Guenther Sohler <guenthe...@gmail.com>
Datum: 01-12-2025 16:29 (GMT+01:00)
Aan: Matthieu Hendriks <matthieu...@gmail.com>
Cc: PythonSCAD <pytho...@googlegroups.com>
Onderwerp: Re: new version scad2python script and batch script

Reply all
Reply to author
Forward
0 new messages