discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

python-engine

TA
Todd Allen
Thu, May 1, 2025 5:48 PM

I apologize if this has already been discussed and I missed it, but I see
there now is a python-engine which can be enabled under
preferences/features.  I want to know more about it but did not see
anything at https://openscad.org/documentation.html.    Can anyone direct
me to documentation of the feature or a tutorial or just a simple "Hello
world" example using this feature?

I apologize if this has already been discussed and I missed it, but I see there now is a python-engine which can be enabled under preferences/features. I want to know more about it but did not see anything at https://openscad.org/documentation.html. Can anyone direct me to documentation of the feature or a tutorial or just a simple "Hello world" example using this feature?
WF
William F. Adams
Thu, May 1, 2025 6:37 PM

On Thursday, May 1, 2025 at 01:49:25 PM EDT, Todd Allen via Discuss discuss@lists.openscad.org wrote:

I apologize if this has already been discussed and I missed it, but I see there now is a python-engine which 
can be enabled under preferences/features.  I want to know more about it but did not see anything

 at https://openscad.org/documentation.html.    Can anyone direct me to documentation of the feature 

or a tutorial or just a simple "Hello world" example using this feature?

Easiest way to access it is to download a build which has it enabled:

https://pythonscad.org/

Then, as noted on the Windows Installation Instructions, make a .py file containing:

from openscad import *
a=cube(1)
a.show()

and render that.

William

On Thursday, May 1, 2025 at 01:49:25 PM EDT, Todd Allen via Discuss <discuss@lists.openscad.org> wrote: >I apologize if this has already been discussed and I missed it, but I see there now is a python-engine which  >can be enabled under preferences/features.  I want to know more about it but did not see anything  at https://openscad.org/documentation.html.    Can anyone direct me to documentation of the feature  >or a tutorial or just a simple "Hello world" example using this feature? Easiest way to access it is to download a build which has it enabled: https://pythonscad.org/ Then, as noted on the Windows Installation Instructions, make a .py file containing: from openscad import * a=cube(1) a.show() and render that. William
TA
Todd Allen
Fri, May 2, 2025 4:00 PM

I downloaded a .appimage from pythonscad.org and have begun going through
the tutorials.  My initial impression is excitement this has potential to
provide a big advance in capabilities for scripted CAD.

But I'm stuck at how to fix an error of 'file not trusted' for "use
<test.py>" in a .scad file.

On Thu, May 1, 2025 at 1:37 PM William F. Adams via Discuss <
discuss@lists.openscad.org> wrote:

On Thursday, May 1, 2025 at 01:49:25 PM EDT, Todd Allen via Discuss <
discuss@lists.openscad.org> wrote:

I apologize if this has already been discussed and I missed it, but I see

there now is a python-engine which

can be enabled under preferences/features.  I want to know more about it

but did not see anything
at https://openscad.org/documentation.html.    Can anyone direct me to
documentation of the feature

or a tutorial or just a simple "Hello world" example using this feature?

Easiest way to access it is to download a build which has it enabled:

https://pythonscad.org/

Then, as noted on the Windows Installation Instructions, make a .py file
containing:

from openscad import *
a=cube(1)
a.show()

and render that.

William


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

I downloaded a .appimage from pythonscad.org and have begun going through the tutorials. My initial impression is excitement this has potential to provide a big advance in capabilities for scripted CAD. But I'm stuck at how to fix an error of 'file not trusted' for "use <test.py>" in a .scad file. On Thu, May 1, 2025 at 1:37 PM William F. Adams via Discuss < discuss@lists.openscad.org> wrote: > On Thursday, May 1, 2025 at 01:49:25 PM EDT, Todd Allen via Discuss < > discuss@lists.openscad.org> wrote: > > >I apologize if this has already been discussed and I missed it, but I see > there now is a python-engine which > >can be enabled under preferences/features. I want to know more about it > but did not see anything > at https://openscad.org/documentation.html. Can anyone direct me to > documentation of the feature > >or a tutorial or just a simple "Hello world" example using this feature? > > Easiest way to access it is to download a build which has it enabled: > > https://pythonscad.org/ > > Then, as noted on the Windows Installation Instructions, make a .py file > containing: > > from openscad import * > a=cube(1) > a.show() > > and render that. > > William > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
WF
William F. Adams
Fri, May 2, 2025 4:13 PM

On Friday, May 2, 2025 at 12:01:07 PM EDT, Todd Allen speedebikes@gmail.com wrote:

I downloaded a .appimage from pythonscad.org and have begun going through the tutorials.  
My initial impression is excitement this has potential to provide a big advance in capabilities for scripted CAD.

Agreed!

But I'm stuck at how to fix an error of 'file not trusted' for "use <test.py>" in a .scad file.

My solution was to edit the icon to just trust everything as noted at: https://github.com/WillAdams/gcodepreview/blob/main/gcodepreview.py

#icon "C:\Program Files\PythonSCAD\bin\openscad.exe" --trust-python

I believe it will work to open the test.py file and then run it, which will add it to the list of trusted files.

There are some notes on calling Python from .scad in:

https://old.reddit.com/r/OpenPythonSCAD/wiki/index#wiki_programming_in_openscad_and_calling_python

which hopefully will be helpful.

William

On Friday, May 2, 2025 at 12:01:07 PM EDT, Todd Allen <speedebikes@gmail.com> wrote: >I downloaded a .appimage from pythonscad.org and have begun going through the tutorials.   >My initial impression is excitement this has potential to provide a big advance in capabilities for scripted CAD. Agreed! >But I'm stuck at how to fix an error of 'file not trusted' for "use <test.py>" in a .scad file. My solution was to edit the icon to just trust everything as noted at: https://github.com/WillAdams/gcodepreview/blob/main/gcodepreview.py #icon "C:\Program Files\PythonSCAD\bin\openscad.exe" --trust-python I believe it will work to open the test.py file and then run it, which will add it to the list of trusted files. There are some notes on calling Python from .scad in: https://old.reddit.com/r/OpenPythonSCAD/wiki/index#wiki_programming_in_openscad_and_calling_python which hopefully will be helpful. William
TA
Todd Allen
Fri, May 2, 2025 4:52 PM

Thanks!  The command line option --trust-python fixed the error.

Without the command line option I was able to load and execute test.py but
that did not fix the trust error for "use <test.py>" inside a .scad file.
Perhaps that works with the Windows version but not under Linux?

On Fri, May 2, 2025 at 11:13 AM William F. Adams willadams@aol.com wrote:

On Friday, May 2, 2025 at 12:01:07 PM EDT, Todd Allen <
speedebikes@gmail.com> wrote:

I downloaded a .appimage from pythonscad.org and have begun going

through the tutorials.

My initial impression is excitement this has potential to provide a big

advance in capabilities for scripted CAD.

Agreed!

But I'm stuck at how to fix an error of 'file not trusted' for "use

<test.py>" in a .scad file.

My solution was to edit the icon to just trust everything as noted at:
https://github.com/WillAdams/gcodepreview/blob/main/gcodepreview.py

#icon "C:\Program Files\PythonSCAD\bin\openscad.exe" --trust-python

I believe it will work to open the test.py file and then run it, which
will add it to the list of trusted files.

There are some notes on calling Python from .scad in:

https://old.reddit.com/r/OpenPythonSCAD/wiki/index#wiki_programming_in_openscad_and_calling_python

which hopefully will be helpful.

William

Thanks! The command line option --trust-python fixed the error. Without the command line option I was able to load and execute test.py but that did not fix the trust error for "use <test.py>" inside a .scad file. Perhaps that works with the Windows version but not under Linux? On Fri, May 2, 2025 at 11:13 AM William F. Adams <willadams@aol.com> wrote: > On Friday, May 2, 2025 at 12:01:07 PM EDT, Todd Allen < > speedebikes@gmail.com> wrote: > > >I downloaded a .appimage from pythonscad.org and have begun going > through the tutorials. > >My initial impression is excitement this has potential to provide a big > advance in capabilities for scripted CAD. > > Agreed! > > >But I'm stuck at how to fix an error of 'file not trusted' for "use > <test.py>" in a .scad file. > > My solution was to edit the icon to just trust everything as noted at: > https://github.com/WillAdams/gcodepreview/blob/main/gcodepreview.py > > #icon "C:\Program Files\PythonSCAD\bin\openscad.exe" --trust-python > > > I believe it will work to open the test.py file and then run it, which > will add it to the list of trusted files. > > There are some notes on calling Python from .scad in: > > > https://old.reddit.com/r/OpenPythonSCAD/wiki/index#wiki_programming_in_openscad_and_calling_python > > which hopefully will be helpful. > > William > >
GS
Guenther Sohler
Fri, May 2, 2025 5:30 PM

For linux its the same

just add : --trust-python
to the end of your AppImage invocation

On Fri, May 2, 2025 at 6:53 PM Todd Allen via Discuss <
discuss@lists.openscad.org> wrote:

Thanks!  The command line option --trust-python fixed the error.

Without the command line option I was able to load and execute test.py but
that did not fix the trust error for "use <test.py>" inside a .scad file.
Perhaps that works with the Windows version but not under Linux?

On Fri, May 2, 2025 at 11:13 AM William F. Adams willadams@aol.com
wrote:

On Friday, May 2, 2025 at 12:01:07 PM EDT, Todd Allen <
speedebikes@gmail.com> wrote:

I downloaded a .appimage from pythonscad.org and have begun going

through the tutorials.

My initial impression is excitement this has potential to provide a big

advance in capabilities for scripted CAD.

Agreed!

But I'm stuck at how to fix an error of 'file not trusted' for "use

<test.py>" in a .scad file.

My solution was to edit the icon to just trust everything as noted at:
https://github.com/WillAdams/gcodepreview/blob/main/gcodepreview.py

#icon "C:\Program Files\PythonSCAD\bin\openscad.exe" --trust-python

I believe it will work to open the test.py file and then run it, which
will add it to the list of trusted files.

There are some notes on calling Python from .scad in:

https://old.reddit.com/r/OpenPythonSCAD/wiki/index#wiki_programming_in_openscad_and_calling_python

which hopefully will be helpful.

William


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

For linux its the same just add : --trust-python to the end of your AppImage invocation On Fri, May 2, 2025 at 6:53 PM Todd Allen via Discuss < discuss@lists.openscad.org> wrote: > Thanks! The command line option --trust-python fixed the error. > > Without the command line option I was able to load and execute test.py but > that did not fix the trust error for "use <test.py>" inside a .scad file. > Perhaps that works with the Windows version but not under Linux? > > On Fri, May 2, 2025 at 11:13 AM William F. Adams <willadams@aol.com> > wrote: > >> On Friday, May 2, 2025 at 12:01:07 PM EDT, Todd Allen < >> speedebikes@gmail.com> wrote: >> >> >I downloaded a .appimage from pythonscad.org and have begun going >> through the tutorials. >> >My initial impression is excitement this has potential to provide a big >> advance in capabilities for scripted CAD. >> >> Agreed! >> >> >But I'm stuck at how to fix an error of 'file not trusted' for "use >> <test.py>" in a .scad file. >> >> My solution was to edit the icon to just trust everything as noted at: >> https://github.com/WillAdams/gcodepreview/blob/main/gcodepreview.py >> >> #icon "C:\Program Files\PythonSCAD\bin\openscad.exe" --trust-python >> >> >> I believe it will work to open the test.py file and then run it, which >> will add it to the list of trusted files. >> >> There are some notes on calling Python from .scad in: >> >> >> https://old.reddit.com/r/OpenPythonSCAD/wiki/index#wiki_programming_in_openscad_and_calling_python >> >> which hopefully will be helpful. >> >> William >> >> _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >