"Compile to CGAL" command?

6 views
Skip to first unread message

William Adams

unread,
Jul 13, 2025, 10:10:12 PMJul 13
to PythonSCAD
Would it be reasonable to have a command/option/mechanism for running Python on a file, but having an analogue to the "show()" command instead return the CGAL structure? Perhaps outputting it to a file?

Maybe a pair of commands?

buildcgl() --- makes the CGAL structure and returns it (I'm sure some more clever person would be able to do something interesting/useful with that)
savecgl(<filename>) --- makes the CGAL and just saves it to a file. (maybe there are other programs which open CGAL files which would/could do something useful?)

Perhaps that latter command could be extended to all the file formats which OpenSCAD supports?

I think the the new build was successful at running the 1_64 file which was crashing the previous version, but it's been stuck at 999/1000 and "Rendering Polygon Mesh using CGAL..." for a long while now....

William

Guenther Sohler

unread,
Jul 14, 2025, 2:42:29 AMJul 14
to William Adams, PythonSCAD
Hi,

do i  correctly understand,, that you experience big evaluation times and you want to split the tasks into 2 parts 
Python-> CSG 
CSG describes the big tree
Evaluate CSG and output STL


YEs, I think you wanted to express CSG instead of CGAL,. is that right?





--
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/03fa69ae-deaf-41a5-a724-1baa2708e3e7n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Adams

unread,
Jul 14, 2025, 7:14:42 AMJul 14
to PythonSCAD
Yes, you're right --- I was confused by the display in my (still running) copy of OpenPythonSCAD.

"Compile to CSG" is what I meant, and I think it (along with the other options) would be a nice programmatic option.

William

Guenther Sohler

unread,
Jul 14, 2025, 7:57:26 AMJul 14
to William Adams, PythonSCAD
Sometimes you just need to be bold enough to try the unexpected

* Open a Python Design
* Choose File->Export CSG
* Save CSG
* open openscad/pythonSCAD with saved csg file ( please ignore errors about r, fn, these are for edge fleeting and not known by CSG importer)



William Adams

unread,
Jul 14, 2025, 10:10:17 AMJul 14
to PythonSCAD
Yes, I know that works, I was more curious about directly generating the CSG file programmatically --- might be someone could make use of that (or maybe my optimism is showing?).

William

Guenther Sohler

unread,
Jul 14, 2025, 10:17:21 AMJul 14
to William Adams, PythonSCAD
Did not explicitly try that this time.
But its quite likely that it could work with

export(solid, "file.csg")

The only issue which i see is:
it will evaluate python
it will render the result(will take huge time)
it will output the csg file(which would also be available without rendering first)

let me try to address that later, when relevant



Reply all
Reply to author
Forward
0 new messages