|
1 | 1 | # system modules |
2 | 2 | import math |
| 3 | +import pytest |
3 | 4 | import unittest |
4 | 5 | from tests import BaseTest |
5 | 6 | from OCP.gp import gp_Vec, gp_Pnt, gp_Ax2, gp_Circ, gp_Elips, gp, gp_XYZ, gp_Trsf |
@@ -721,5 +722,18 @@ def testEdgeWrapperRadius(self): |
721 | 722 | self.assertAlmostEqual(many_rad.radius(), 1.0) |
722 | 723 |
|
723 | 724 |
|
| 725 | +@pytest.mark.parametrize( |
| 726 | + "points, close, expected_edges", |
| 727 | + [ |
| 728 | + (((0, 0, 0), (0, 1, 0), (1, 0, 0)), False, 2), |
| 729 | + (((0, 0, 0), (0, 1, 0), (1, 0, 0)), True, 3), |
| 730 | + (((0, 0, 0), (0, 1, 0), (1, 0, 0), (0, 0, 0)), False, 3), |
| 731 | + (((0, 0, 0), (0, 1, 0), (1, 0, 0), (0, 0, 0)), True, 3), |
| 732 | + ], |
| 733 | +) |
| 734 | +def test_wire_makepolygon(points, close, expected_edges): |
| 735 | + assert len(Wire.makePolygon(points, False, close).Edges()) == expected_edges |
| 736 | + |
| 737 | + |
724 | 738 | if __name__ == "__main__": |
725 | 739 | unittest.main() |
0 commit comments