discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Fw: Getting started with pythonscad

WF
William F. Adams
Mon, May 26, 2025 2:20 AM

On Sunday, May 25, 2025 at 12:27:45 PM EDT, Matthieu Hendriks via Discuss discuss@lists.openscad.org wrote:

Is there a separate mailinglist for asking beginner questions about pythonscad? 

Not yet. It would be great if there was one here.

  • a nice templatewith some best practices for starting 

The big thing is, it's Python, so one can do pretty much anything.

The basic template would be something like:

variables = values

at the top

Various calculations/logic based on the variables

make 3D elements using the variables --- note that 3D elements can go int variables and can be combined in various ways, see: https://old.reddit.com/r/OpenPythonSCAD/wiki/index#wiki_3d_operations

then use show() to make the finished 3D model visible at the end.

  • is it possibe to reuse my home made openscad library with some modules and functions  in pythonscad or do I have to rewrite those in pythonscad

I believe so, but you'll get a lot more performance if you re-write in Python.

I'm a bit lost. :(

I have tried to explain things in the afore-mentioned wiki, and Guenther has a tutorial at: https://pythonscad.org/tutorial/site/index.html and you may find: https://github.com/WillAdams/gcodepreview of interest if you are planning on using a CNC machine or need to interface with traditional CAD.

If you'll put up a bit of code you are having trouble with we'll gladly do our best to assist.

William

On Sunday, May 25, 2025 at 12:27:45 PM EDT, Matthieu Hendriks via Discuss <discuss@lists.openscad.org> wrote: >Is there a separate mailinglist for asking beginner questions about pythonscad?  Not yet. It would be great if there was one here. >- a nice templatewith some best practices for starting  The big thing is, it's Python, so one can do pretty much anything. The basic template would be something like: variables = values at the top Various calculations/logic based on the variables make 3D elements using the variables --- note that 3D elements can go int variables and can be combined in various ways, see: https://old.reddit.com/r/OpenPythonSCAD/wiki/index#wiki_3d_operations then use show() to make the finished 3D model visible at the end. >- is it possibe to reuse my home made openscad library with some modules and functions  in pythonscad or do I have to rewrite those in pythonscad I believe so, but you'll get a lot more performance if you re-write in Python. >I'm a bit lost. :( I have tried to explain things in the afore-mentioned wiki, and Guenther has a tutorial at: https://pythonscad.org/tutorial/site/index.html and you may find: https://github.com/WillAdams/gcodepreview of interest if you are planning on using a CNC machine or need to interface with traditional CAD. If you'll put up a bit of code you are having trouble with we'll gladly do our best to assist. William