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

Method testParallelEdgeFilter

tests/test_selectors.py:214–224  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

212 self.assertAlmostEqual(c.y, 0.5)
213
214 def testParallelEdgeFilter(self):
215 c = CQ(makeUnitCube())
216 for sel, vec in zip(
217 ["|X", "|Y", "|Z"], [Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)]
218 ):
219 edges = c.edges(sel)
220 # each direction should have 4 edges
221 self.assertEqual(4, edges.size())
222 # each edge should be parallel with vec and have a cross product with a length of 0
223 for e in edges.vals():
224 self.assertAlmostEqual(e.tangentAt(0).cross(vec).Length, 0.0)
225
226 def testCenterNthSelector(self):
227 sel = selectors.CenterNthSelector

Callers

nothing calls this directly

Calls 7

makeUnitCubeFunction · 0.90
VectorClass · 0.85
crossMethod · 0.80
edgesMethod · 0.45
sizeMethod · 0.45
valsMethod · 0.45
tangentAtMethod · 0.45

Tested by

no test coverage detected