Part: add unit test for PR #13507
This commit is contained in:
@@ -64,6 +64,7 @@ set(CompoundTools_Scripts
|
||||
|
||||
set(Part_tests
|
||||
parttests/__init__.py
|
||||
parttests/BRep_tests.py
|
||||
parttests/Geom2d_tests.py
|
||||
parttests/part_test_objects.py
|
||||
parttests/regression_tests.py
|
||||
|
||||
@@ -27,6 +27,7 @@ from FreeCAD import Units
|
||||
from FreeCAD import Base
|
||||
App = FreeCAD
|
||||
|
||||
from parttests.BRep_tests import BRepTests
|
||||
from parttests.Geom2d_tests import Geom2dTests
|
||||
from parttests.regression_tests import RegressionTests
|
||||
from parttests.TopoShapeListTest import TopoShapeListTest
|
||||
|
||||
26
src/Mod/Part/parttests/BRep_tests.py
Normal file
26
src/Mod/Part/parttests/BRep_tests.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import FreeCAD as App
|
||||
import Part
|
||||
|
||||
import unittest
|
||||
|
||||
class BRepTests(unittest.TestCase):
|
||||
|
||||
def testProject(self):
|
||||
"""
|
||||
This is a unit test for PR #13507
|
||||
"""
|
||||
num = 18
|
||||
alt = [0,1] * num
|
||||
pts = [App.Vector(i, alt[i], 0) for i in range(num)]
|
||||
|
||||
bsc = Part.BSplineCurve()
|
||||
bsc.buildFromPoles(pts, False, 1)
|
||||
edge = bsc.toShape()
|
||||
|
||||
rts = Part.RectangularTrimmedSurface(Part.Plane(), -50, 50, -50, 50)
|
||||
plane_shape = rts.toShape()
|
||||
|
||||
proj = plane_shape.project([edge])
|
||||
self.assertFalse(proj.isNull())
|
||||
self.assertEqual(len(proj.Edges), 1)
|
||||
|
||||
Reference in New Issue
Block a user