Part: add unit test for PR #13507

This commit is contained in:
wmayer
2024-04-20 11:15:15 +02:00
committed by wwmayer
parent 7eeb389422
commit 95b57d4dd4
3 changed files with 28 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View 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)