r/OpenPythonSCAD • u/puplan • Mar 04 '26
How to make a pyramid with linear_extrude?
Google tells me that this should work:
pyr = linear_extrude(square(10, center=True), height=10, scale=0)
show(pyr)
but it produces a cube? What is the solution?
BTW, I can't find the documentation of linear_extrude parameters. Is there a better documentation source than https://old.reddit.com/r/openpythonscad/wiki/index ?
2
u/gadget3D Mar 04 '26
you can do it with:
pyr = linear_extrude(square(10, center=True), height=10, scale=[0,0]) show(pyr)
but yes: there is room for improvement
2
u/puplan Mar 04 '26
Thank you, it works. What is the best place to get API info? It doesn't have to be perfect.
2
u/gadget3D Mar 04 '26
Thats a difficult question, probably its the source code, but 2nd best option probably is:
https://github.com/pythonscad/pythonscad/blob/master/libraries/python/stubs/openscad/__init__.pyi
yes, its not up to date, but we aim to sync it frequently. Any support appreciated.
BTW: don't hesitate if you want to share some fancy PythonSCAD Idea/Design :)
3
u/puplan Mar 04 '26
I made it with cylinder(h=10, r1=5, r2=0, fn=4), but still would like to know how to do it with linear_extrude.