PyObject* BSplineCurvePy::isPeriodic(PyObject *args) { if (!PyArg_ParseTuple(args, "")) return 0; Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast (getGeometryPtr()->handle()); Standard_Boolean val = curve->IsPeriodic(); return PyBool_FromLong(val ? 1 : 0); }
Py::List BSplineCurvePy::getKnotSequence(void) const { Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast (getGeometryPtr()->handle()); Standard_Integer m = 0; if (curve->IsPeriodic()) { // knots=poles+2*degree-mult(1)+2 m = curve->NbPoles() + 2*curve->Degree() - curve->Multiplicity(1) + 2; } else { // knots=poles+degree+1 for (int i=1; i<= curve->NbKnots(); i++) m += curve->Multiplicity(i); } TColStd_Array1OfReal k(1,m); curve->KnotSequence(k); Py::List list; for (Standard_Integer i=k.Lower(); i<=k.Upper(); i++) { list.append(Py::Float(k(i))); } return list; }