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

Method testVertices

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

Source from the content-addressed store, hash-verified

36 self.assertTupleAlmostEquals((-2.0, -2.0, 0.0), s.plane.origin.toTuple(), 3)
37
38 def testVertices(self):
39 t = makeUnitSquareWire() # square box
40 c = CQ(t)
41
42 self.assertEqual(4, c.vertices().size())
43 self.assertEqual(4, c.edges().size())
44 self.assertEqual(0, c.vertices().edges().size()) # no edges on any vertices
45 # but selecting all edges still yields all vertices
46 self.assertEqual(4, c.edges().vertices().size())
47 self.assertEqual(1, c.wires().size()) # just one wire
48 self.assertEqual(0, c.faces().size())
49 # odd combinations all work but yield no results
50 self.assertEqual(0, c.vertices().faces().size())
51 self.assertEqual(0, c.edges().faces().size())
52 self.assertEqual(0, c.edges().vertices().faces().size())
53
54 def testEnd(self):
55 c = CQ(makeUnitSquareWire())

Callers

nothing calls this directly

Calls 6

makeUnitSquareWireFunction · 0.90
sizeMethod · 0.45
verticesMethod · 0.45
edgesMethod · 0.45
wiresMethod · 0.45
facesMethod · 0.45

Tested by

no test coverage detected