bernhard-42 / vscode-ocp-cad-viewer

A viewer for OCP based Code-CAD (CadQuery, build123d) integrated into VS Code
Apache License 2.0
96 stars 10 forks source link

render_joints needs label != "" #4

Closed bernhard-42 closed 1 year ago

bernhard-42 commented 1 year ago
with BuildPart() as p:
    with BuildSketch() as sk:
        RectangleRounded(20, 50, 3)
        with GridLocations(15, 40, 2, 2) as screw_holes:
            Circle(1.3, mode=Mode.SUBTRACT)
    extrude(amount=3)

with BuildPart() as screw:
    with BuildSketch() as screw_sk:
        Circle(1.2)
    extrude(amount=8)

screw.part.label = "screw"  # <=. bug in viewer, label is needed!

screws = [copy.copy(screw.part) for loc in screw_holes.locations]

for idx, loc in enumerate(screw_holes.locations):
    RigidJoint(f"screw_hole{idx}", p.part, loc)
    RigidJoint("head", screws[idx])
    p.part.joints[f"screw_hole{idx}"].connect_to(screws[idx].joints["head"])

p.part.label = "p"  # <=. bug in viewer, label is needed!

show(p, screws, render_joints=True, transparent=True)
bernhard-42 commented 1 year ago

fixed in 0.93