Skip to content

Commit f79d68c

Browse files
Fixed tests for new polygon() behavior, sending only 2D points to OpenSCAD
1 parent 455a19b commit f79d68c

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

solid/test/test_solidpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from solid.test.ExpandedTestCase import DiffOutput
1717

1818
scad_test_case_templates = [
19-
{'name': 'polygon', 'class': 'polygon' , 'kwargs': {'paths': [[0, 1, 2]]}, 'expected': '\n\npolygon(paths = [[0, 1, 2]], points = [[0, 0, 0], [1, 0, 0], [0, 1, 0]]);', 'args': {'points': [[0, 0, 0], [1, 0, 0], [0, 1, 0]]}, },
19+
{'name': 'polygon', 'class': 'polygon' , 'kwargs': {'paths': [[0, 1, 2]]}, 'expected': '\n\npolygon(paths = [[0, 1, 2]], points = [[0, 0], [1, 0], [0, 1]]);', 'args': {'points': [[0, 0, 0], [1, 0, 0], [0, 1, 0]]}, },
2020
{'name': 'circle', 'class': 'circle' , 'kwargs': {'segments': 12, 'r': 1}, 'expected': '\n\ncircle($fn = 12, r = 1);', 'args': {}, },
2121
{'name': 'circle_diam', 'class': 'circle' , 'kwargs': {'segments': 12, 'd': 1}, 'expected': '\n\ncircle($fn = 12, d = 1);', 'args': {}, },
2222
{'name': 'square', 'class': 'square' , 'kwargs': {'center': False, 'size': 1}, 'expected': '\n\nsquare(center = false, size = 1);', 'args': {}, },

solid/test/test_splines.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,6 @@ def test_bezier_points_3d(self):
7373
expected = [Point3(-2.00, -1.00, 0.00),Point3(0.00, 0.00, 0.75), Point3(2.00, 1.00, 0.00)]
7474
self.assertPointsListsEqual(expected, actual)
7575

76-
def test_bezier_polygon(self):
77-
# Notably, OpenSCAD won't render a polygon made of 3-tuples, even if it
78-
# lies in the XY plane. Verify that our generated polygon() code contains
79-
# only 2-tuples
80-
poly = bezier_polygon(self.bezier_controls, extrude_height=0, subdivisions=self.subdivisions)
81-
actual = all((isinstance(p, Point2) for p in poly.params['points']))
82-
expected = True
83-
self.assertEqual(expected, actual)
84-
8576
def test_catmull_rom_prism(self):
8677
sides = 3
8778
UP = Vector3(0,0,1)

0 commit comments

Comments
 (0)