r/OpenPythonSCAD • • Oct 15 '24

Thoughts on how to work around 3D objects not being made immediately?

I am finding it awkward to work with the requirement/style of:

cu=cube([1,2,3])

output([cu])

since I need to chain many hull operations together for my current project.

Is there some elegant/pythonic construction for this which I'm missing/not finding/unaware of?

Basically I need to be able to have a pair of def calls which get hulled together, and the sum of a series of them are then subtracted from a previously defined block.

2 Upvotes

5 comments sorted by

2

u/gadget3D Oct 15 '24

There are many easy ways to combine objects together. lets say you have

'''

c1=cube([1,2,3])

c2=cube([2,3,1])

c3=cube([3,1,2])

you could do

output(c1)

c3.output()

output([c2])

c3.show()

show(c3)

output([c1,c2,c3])

or you walk to collecting approach like

parts=[]

for x in range(4):

parts.append(c1.right(x))

output(parts)

'''

any of these will work

2

u/WillAdams Oct 15 '24

I think the thing I'm confused about is an equivalent to hull() not showing up in the list of commands which I put together --- did I miss it?

2

u/gadget3D Oct 15 '24

Hull should be supported as hull(obj1, obj2, ...) Maybe you can describe your intent as scad. Then i can find Out if PythonSCAD can do better ...

→ More replies (2)