As a newbie I can't figure out how to add objects (polygons, boxes, etc) to an Assembly programmatically. Naively I would have guessed that something like this would work:
######################
import cadquery as cq
# a list of objects, polygons in my case
polys = [poly1, poly2, poly3]
asym = cq.Assembly()
for ply in polys:
asym.add(ply)
#save to step file, including just in case this causes an issue
asym.save('polys.step')
#########################
But that doesn't work. Additionally, I would like to know how to programmatically add to a union. The pseudo code would look like this I would think:
#########################
import cadquery as cq
# a list of polygons, not specified
polys = [poly1, poly2, poly3]
asym = cq.Assembly()
for i in len(polys):
if i==0:
mainpoly = polys[i]
else:
mainpoly.union(polys[i])
#########################
What's the right way to do this?
Thanks.