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

Function test_curvature

tests/test_shapes.py:177–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175
176
177def test_curvature():
178
179 r = 10
180
181 c = circle(r)
182 w = polyline((0, 0), (1, 0), (1, 1))
183
184 assert c.curvatureAt(0) == approx(1 / r)
185
186 curvatures = c.curvatures([0, 0.5])
187
188 assert approx(curvatures[0]) == curvatures[1]
189
190 assert w.curvatureAt(0) == approx(w.curvatureAt(0.5))
191
192
193def test_normals():

Callers

nothing calls this directly

Calls 4

circleFunction · 0.90
polylineFunction · 0.90
curvaturesMethod · 0.80
curvatureAtMethod · 0.45

Tested by

no test coverage detected