MCPcopy Index your code
hub / github.com/CadQuery/cadquery / testSplineWithScaleTrue

Method testSplineWithScaleTrue

tests/test_cadquery.py:792–806  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

790 self.assertTrue(spline3.val().IsClosed())
791
792 def testSplineWithScaleTrue(self):
793 points = [(0, 0), (1, 1), (2, 0), (1, -1)]
794 tangents = [(0, 1), (1, 0), (0, -1), (-1, 0)]
795 parameters = range(len(points))
796
797 spline = (
798 Workplane("XY")
799 .spline(points, tangents=tangents, parameters=parameters, scale=True)
800 .consolidateWires()
801 )
802
803 test_point = spline.edges().val().positionAt(0.5, mode="parameter")
804 expected_test_point = Vector(0.375, 0.875, 0.0)
805
806 self.assertAlmostEqual((test_point - expected_test_point).Length, 0)
807
808 def testSplineWithScaleFalse(self):
809 """

Callers

nothing calls this directly

Calls 7

WorkplaneClass · 0.85
VectorClass · 0.85
consolidateWiresMethod · 0.80
splineMethod · 0.45
positionAtMethod · 0.45
valMethod · 0.45
edgesMethod · 0.45

Tested by

no test coverage detected