Part: fix test failure and add setBounds for backward compatibility
This commit is contained in:
@@ -1706,8 +1706,12 @@ PyObject* BSplineSurfacePy::scaleKnotsToBounds(PyObject *args)
|
||||
}
|
||||
}
|
||||
|
||||
PyObject *BSplineSurfacePy::getCustomAttributes(const char* /*attr*/) const
|
||||
PyObject *BSplineSurfacePy::getCustomAttributes(const char* attr) const
|
||||
{
|
||||
// for backward compatibility
|
||||
if (strcmp(attr, "setBounds") == 0) {
|
||||
return PyObject_GetAttrString(const_cast<BSplineSurfacePy*>(this), "scaleKnotsToBounds");
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ class PartTestBSplineSurface(unittest.TestCase):
|
||||
bs = to.toBSpline()
|
||||
self.assertAlmostEqual(bs.bounds()[1], 2 * math.pi)
|
||||
self.assertAlmostEqual(bs.bounds()[3], 2 * math.pi)
|
||||
bs.setBounds(0.0, 1.0, 0.0, 1.0)
|
||||
bs.scaleKnotsToBounds(0.0, 1.0, 0.0, 1.0)
|
||||
self.assertAlmostEqual(bs.bounds()[1], 1.0)
|
||||
self.assertAlmostEqual(bs.bounds()[3], 1.0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user