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

Function test_PointInPlane_param

tests/test_assembly.py:2049–2060  ·  view source on GitHub ↗
(box_and_vertex, param0, param1)

Source from the content-addressed store, hash-verified

2047@pytest.mark.parametrize("param1", [-1, 0, 2])
2048@pytest.mark.parametrize("param0", [-2, 0, 0.01])
2049def test_PointInPlane_param(box_and_vertex, param0, param1):
2050
2051 box_and_vertex.constrain("vertex", "box@faces@>Z", "PointInPlane", param=param0)
2052 box_and_vertex.constrain("vertex", "box@faces@>X", "PointInPlane", param=param1)
2053 box_and_vertex.solve()
2054 solve_result_check(box_and_vertex._solve_result)
2055
2056 vertex_translation_part = (
2057 box_and_vertex.children[0].loc.wrapped.Transformation().TranslationPart()
2058 )
2059 assert vertex_translation_part.Z() - 1.5 == pytest.approx(param0, abs=1e-6)
2060 assert vertex_translation_part.X() - 0.5 == pytest.approx(param1, abs=1e-6)
2061
2062
2063def test_constraint_getPln():

Callers

nothing calls this directly

Calls 3

solve_result_checkFunction · 0.85
constrainMethod · 0.45
solveMethod · 0.45

Tested by

no test coverage detected