diff --git a/tests/TestCadQuery.py b/tests/TestCadQuery.py index ddb038f5..ec1187cb 100644 --- a/tests/TestCadQuery.py +++ b/tests/TestCadQuery.py @@ -1876,4 +1876,28 @@ class TestCadQuery(BaseTest): #closed profile will generate a valid solid with 3 faces self.assertTrue(res_closed.solids().val().isValid()) - self.assertEqual(len(res_closed.faces().vals()),3) \ No newline at end of file + self.assertEqual(len(res_closed.faces().vals()),3) + + def testMakeShellSolid(self): + + c0 = math.sqrt(2)/4 + vertices = [[c0, -c0, c0], [c0, c0, -c0], [-c0, c0, c0], [-c0, -c0, -c0]] + faces_ixs = [[0, 1, 2, 0], [1, 0, 3, 1], [2, 3, 0, 2], [3, 2, 1, 3]] + + faces = [] + for ixs in faces_ixs: + lines = [] + for v1,v2 in zip(ixs,ixs[1:]): + lines.append(Edge.makeLine(Vector(*vertices[v1]), + Vector(*vertices[v2]))) + wire = Wire.combine(lines) + faces.append(Face.makeFromWires(wire)) + + shell = Shell.makeShell(faces) + solid = Solid.makeSolid(shell) + + self.assertTrue(shell.isValid()) + self.assertTrue(solid.isValid()) + + self.assertEqual(len(solid.Vertices()),4) + self.assertEqual(len(solid.Faces()),4) \ No newline at end of file