Part: fix BSplineCurve2dPy::insertKnot
This commit is contained in:
@@ -166,10 +166,12 @@ PyObject* BSplineCurve2dPy::incrementMultiplicity(PyObject * args)
|
||||
|
||||
PyObject* BSplineCurve2dPy::insertKnot(PyObject * args)
|
||||
{
|
||||
double U, tol = 0.0;
|
||||
double U;
|
||||
double tol = 0.0;
|
||||
int M=1;
|
||||
if (!PyArg_ParseTuple(args, "d|idO!", &U, &M, &tol))
|
||||
if (!PyArg_ParseTuple(args, "d|id", &U, &M, &tol)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
try {
|
||||
Handle(Geom2d_BSplineCurve) curve = Handle(Geom2d_BSplineCurve)::DownCast
|
||||
|
||||
@@ -17,4 +17,9 @@ class Geom2dTests(unittest.TestCase):
|
||||
e1 = l12.toShape()
|
||||
e2 = l12.toShape(surf)
|
||||
self.assertNotEqual(e1.curveOnSurface(0), None)
|
||||
self.assertNotEqual(e2.curveOnSurface(0), None)
|
||||
self.assertNotEqual(e2.curveOnSurface(0), None)
|
||||
|
||||
def test_insertKnot(self):
|
||||
with self.assertRaises(TypeError):
|
||||
curve = Part.Geom2d.BSplineCurve2d()
|
||||
curve.insertKnot(0.5, 1, 0.01, 2)
|
||||
|
||||
Reference in New Issue
Block a user