r/OpenPythonSCAD • • Mar 15 '25

This raises PythonSCAD into a new Dimension

So far, OpenSCAD was only dealing with 2D and 3D objects and it was always towards 3D objects.

Since Today (2025-03-15) PythonSCAD is improved. You can turn a solid into its faces, turn a face into its edges

and of course you can extrude back edges to faces and faces back to prisms, so you can freely walk between 1D and 3D to create your designs

Here is a small example which briefly demonstrates the new Abilities.

'''

from openscad import *

c=cube(10)

faces = c.faces()

f=min(faces, key = lambda f : f.matrix[0][3]) # lowest x

edges=f.edges()

e=min(edges, key = lambda f : f.matrix[1][3]) # lowest y

c2=e.linear_extrude(height=1).linear_extrude(height=1)

show(c|c2)

# create a cube by extrudeing an edge

cube3=edge(4).linear_extrude(height=4).linear_extrude(height=2)

'''

Of course it would make sense to extrude an edge into an cylinder, too, but I am not yet sure about the details,

happy to receive ideas

Demsontration how to walk between the Dimensions
4 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/kolloid1 Mar 16 '25

Thanks for the explanation. I'll have to play a bit with this and see what happens. No, I guess that I haven't seen this before ...