MCPcopy
hub / github.com/CadQuery/cadquery / nested_assy

Function nested_assy

tests/test_assembly.py:62–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60
61@pytest.fixture
62def nested_assy():
63
64 b1 = cq.Workplane().box(1, 1, 1).faces("<Z").tag("top_face").end()
65 b2 = cq.Workplane().box(1, 1, 1).faces("<Z").tag("bottom_face").end()
66 b3 = (
67 cq.Workplane()
68 .pushPoints([(-2, 0), (2, 0)])
69 .tag("pts")
70 .box(1, 1, 0.5)
71 .tag("boxes")
72 )
73
74 assy = cq.Assembly(b1, loc=cq.Location(cq.Vector(0, 0, 0)), name="TOP")
75 assy2 = cq.Assembly(b2, loc=cq.Location(cq.Vector(0, 4, 0)), name="SECOND")
76 assy2.add(b3, loc=cq.Location(cq.Vector(0, 4, 0)), name="BOTTOM")
77
78 assy.add(assy2, color=cq.Color("green"))
79
80 return assy
81
82
83@pytest.fixture

Callers

nothing calls this directly

Calls 6

addMethod · 0.95
endMethod · 0.80
boxMethod · 0.80
pushPointsMethod · 0.80
tagMethod · 0.45
facesMethod · 0.45

Tested by

no test coverage detected