CadQuery / cadquery

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

Suggestion: Add support for exploded views to assembly #870

Open martinbudden opened 3 years ago

martinbudden commented 3 years ago

As far as I can tell, assemblies don't yet support exploded views.

One way to support this would be to add an explode vector parameter to the add function which was used to how the part moved when the assembly was exploded, eg

door = (
    cq.Assembly()
    .add(make_vslot(H), name="left", explode=(-50, 0, 0))
    .add(make_vslot(H), name="right", explode=(50, 0, 0))
    .add(make_vslot(W), name="top", explode=(0, 0, 50))
    .add(make_vslot(W), name="bottom", explode=(0, 0, -50))
    .add(make_connector(), name="con_tl", color=cq.Color("black"))
   ...
marcus7070 commented 3 years ago

I would suggest we create a Shape or Workplane object that would render as a dashed line. The user would create a second Assembly for their exploded view and use regular constraints to attach Shapes to the start and end of a dashed line.

IMHO this method seems more flexible and extensible that directly implementing (one style of) exploded views.