CadQuery / cadquery

A python parametric CAD scripting framework based on OCCT
https://cadquery.readthedocs.io
Other
3.08k stars 286 forks source link

Workplane.save() #1153

Open roipoussiere opened 2 years ago

roipoussiere commented 2 years ago

I like the simplicity of Assembly.save():

asm = ( cq.Assembly()
    .add(box)
    .save('box.step')
)

To export a model, in the other hand, the syntax is not as nice:

box = cq.Workplane().box(1, 2, 3)
cq.exporters.export(box, 'box.step')

I wonder if the assembly export syntax could be applied on a model as well, for consistency and simplicity:

box = ( cq.Workplane()
    .box(1, 2, 3)
    .save('box.step')
)
adam-urbanczyk commented 1 year ago

It would be nice indeed. @jmwright @lorenzncode would you agree?

lorenzncode commented 1 year ago

Yes, that might be convenient and I think it could support saving to BREP file too!

jmwright commented 1 year ago

+1