| 2220 | |
| 2221 | |
| 2222 | def 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 | |
| 2239 | def test_fixed_rotation(simple_assy2): |