Convert Shape methods to properties: is_null, is_valid, shape_type

This commit is contained in:
gumyr 2025-05-27 14:38:21 -04:00
parent f445de32c9
commit 560a5369b7
14 changed files with 75 additions and 82 deletions

View file

@ -41,12 +41,12 @@ class TestShells(unittest.TestCase):
def test_shell_init(self):
box_faces = Solid.make_box(1, 1, 1).faces()
box_shell = Shell(box_faces)
self.assertTrue(box_shell.is_valid())
self.assertTrue(box_shell.is_valid)
def test_shell_init_single_face(self):
face = Solid.make_cone(1, 0, 2).faces().filter_by(GeomType.CONE).first
shell = Shell(face)
self.assertTrue(shell.is_valid())
self.assertTrue(shell.is_valid)
def test_center(self):
box_faces = Solid.make_box(1, 1, 1).faces()
@ -71,9 +71,9 @@ class TestShells(unittest.TestCase):
x_section = Rot(90) * Spline((0, -5), (-3, -2), (-2, 0), (-3, 2), (0, 5))
surface = sweep(x_section, Circle(5).wire())
single_face = Shell(surface.face())
self.assertTrue(single_face.is_valid())
self.assertTrue(single_face.is_valid)
single_face = Shell(surface.faces())
self.assertTrue(single_face.is_valid())
self.assertTrue(single_face.is_valid)
def test_sweep(self):
path_c1 = JernArc((0, 0), (-1, 0), 1, 180)