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

Method assertNFacesAndNVertices

tests/test_importers.py:101–119  ·  view source on GitHub ↗

Checks that the workplane has the number of faces and vertices expected in X, Y, and Z. :param workplane: The workplane to assess. :param nFacesXYZ: The number of faces expected in +X, +Y, and +Z planes. :param nVerticesXYZ: The number of vertices expected in

(self, workplane, nFacesXYZ, nVerticesXYZ)

Source from the content-addressed store, hash-verified

99 self.assertAlmostEqual(fusedShape.findSolid().Volume(), 8)
100
101 def assertNFacesAndNVertices(self, workplane, nFacesXYZ, nVerticesXYZ):
102 """
103 Checks that the workplane has the number of faces and vertices expected
104 in X, Y, and Z.
105 :param workplane: The workplane to assess.
106 :param nFacesXYZ: The number of faces expected in +X, +Y, and +Z planes.
107 :param nVerticesXYZ: The number of vertices expected in +X, +Y, and +Z planes.
108 """
109 nFacesX, nFacesY, nFacesZ = nFacesXYZ
110 nVerticesX, nVerticesY, nVerticesZ = nVerticesXYZ
111
112 self.assertEqual(workplane.faces("+X").size(), nFacesX)
113 self.assertEqual(workplane.faces("+X").vertices().size(), nVerticesX)
114
115 self.assertEqual(workplane.faces("+Y").size(), nFacesY)
116 self.assertEqual(workplane.faces("+Y").vertices().size(), nVerticesY)
117
118 self.assertEqual(workplane.faces("+Z").size(), nFacesZ)
119 self.assertEqual(workplane.faces("+Z").vertices().size(), nVerticesZ)
120
121 def testInvalidImportTypeRaisesRuntimeError(self):
122 fileName = os.path.join(OUTDIR, "tempSTEP.step")

Callers 2

importBoxMethod · 0.95
importCompoundMethod · 0.95

Calls 3

sizeMethod · 0.45
facesMethod · 0.45
verticesMethod · 0.45

Tested by

no test coverage detected