fixes and typos

This commit is contained in:
tomate44
2020-11-15 12:37:54 +01:00
committed by wwmayer
parent 3c93dba15a
commit ae6c2b7d30
2 changed files with 4 additions and 6 deletions

View File

@@ -161,9 +161,9 @@ ensures that:
<UserDocu>Interpolates a list of constraints.
Each constraint is a list of a point and some optional derivatives
An optional list of parameters can be passed. It must be of same size as constraint list.
Otherwise, a simple uniform parametrisation is used.
Otherwise, a simple uniform parametrization is used.
Example :
bezier.interpolate([[pt1, deriv11, deriv12], [pt2,], [pt3, deriv31]], [0, 0.5, 1.0])</UserDocu>
bezier.interpolate([[pt1, deriv11, deriv12], [pt2,], [pt3, deriv31]], [0, 0.4, 1.0])</UserDocu>
</Documentation>
</Methode>
</PythonExport>

View File

@@ -418,9 +418,7 @@ PyObject* BezierCurvePy::interpolate(PyObject * args)
int num_poles = 0;
for (Py::Sequence::iterator it1 = constraints.begin(); it1 != constraints.end(); ++it1) {
Py::Sequence row(*it1);
for (Py::Sequence::iterator it2 = row.begin(); it2 != row.end(); ++it2) {
num_poles++;
}
num_poles += (int)row.size();
}
if (num_poles > curve->MaxDegree())
Standard_Failure::Raise("number of constraints exceeds bezier curve capacity");
@@ -440,7 +438,7 @@ PyObject* BezierCurvePy::interpolate(PyObject * args)
Py::Sequence row(*it1);
math_Matrix bezier_eval(1, row.size(), 1, num_poles, 0.0);
Standard_Integer first_non_zero;
Standard_Integer error_code = BSplCLib::EvalBsplineBasis(row.size()-1, num_poles, knots, params(cons_idx), first_non_zero, bezier_eval, Standard_False);
BSplCLib::EvalBsplineBasis(row.size()-1, num_poles, knots, params(cons_idx), first_non_zero, bezier_eval, Standard_False);
int idx2 = 1;
for (Py::Sequence::iterator it2 = row.begin(); it2 != row.end(); ++it2) {
OCCmatrix.SetRow(row_idx, bezier_eval.Row(idx2));