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

Function test_fixed_rotation

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

Source from the content-addressed store, hash-verified

2237
2238
2239def test_fixed_rotation(simple_assy2):
2240
2241 assy = simple_assy2
2242
2243 assy.constrain("b1", "Fixed")
2244 assy.constrain("b2", "FixedPoint", (0, 0, -3))
2245 assy.constrain("b2@faces@>Z", "FixedRotation", (45, 0, 0))
2246
2247 assy.solve()
2248
2249 w = cq.Workplane().add(assy.toCompound())
2250
2251 assert w.solids(">Z").val().Center().Length == pytest.approx(0)
2252 assert w.solids("<Z").val().Center().z == pytest.approx(-3)
2253 assert w.solids("<Z").edges(">Z").size() == 1
2254
2255
2256def test_constraint_validation(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