Skip to content

Allow constraints involving complete subassys #1239

Open
@adam-urbanczyk

Description

@adam-urbanczyk

The following code does not work, but there is no reason why it shouldn't.

import cadquery as cq

piece=(cq.Workplane("XZ")
     .sketch()
     .trapezoid(10,5,60)
     .finalize()
     .extrude(1)
     )

combi=(cq.Assembly()
    .add(piece, name="top")
    .add(piece, name="bottom")
   
    .constrain("top@faces@<Z","bottom@faces@<Z","Plane")
   
    .solve()
    )

base=(cq.Workplane("XY")
      .rect(15,80)
      .extrude(1)
      )

assembly=(cq.Assembly()
          .add(base, name="base")
          .add(combi,
               name="combi_left",
               loc=cq.Location(cq.Vector(0,20,10))
               )
          .add(combi,
               name="combi_right",
               loc=cq.Location(cq.Vector(0,-20,10))
               )
          .constrain("combi_left", "Fixed")
          )

show_object(assembly)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions