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

Function test_unary_constraints

tests/test_assembly.py:2222–2236  ·  view source on GitHub ↗
(simple_assy2)

Source from the content-addressed store, hash-verified

2220
2221
2222def test_unary_constraints(simple_assy2):
2223
2224 assy = simple_assy2
2225
2226 assy.constrain("b1", "Fixed")
2227 assy.constrain("b2", "FixedPoint", (0, 0, -3))
2228 assy.constrain("b2@faces@>Z", "FixedAxis", (0, 1, 1))
2229
2230 assy.solve()
2231
2232 w = cq.Workplane().add(assy.toCompound())
2233
2234 assert w.solids(">Z").val().Center().Length == pytest.approx(0)
2235 assert w.solids("<Z").val().Center().z == pytest.approx(-3)
2236 assert w.solids("<Z").edges(">Z").size() == 1
2237
2238
2239def test_fixed_rotation(simple_assy2):

Callers

nothing calls this directly

Calls 9

toCompoundMethod · 0.80
constrainMethod · 0.45
solveMethod · 0.45
addMethod · 0.45
CenterMethod · 0.45
valMethod · 0.45
solidsMethod · 0.45
sizeMethod · 0.45
edgesMethod · 0.45

Tested by

no test coverage detected