Part: fix BSplineCurve2dPy::insertKnot

This commit is contained in:
wmayer
2023-11-24 11:26:02 +01:00
committed by wwmayer
parent a3f285cb46
commit 6d11e2206d
2 changed files with 10 additions and 3 deletions

View File

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

View File

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