Sketcher: Delete non-suported BSpline constraints on NURBS conversion

This commit is contained in:
Abdullah Tahiri 2017-02-20 00:17:50 +01:00 committed by wmayer
parent c1f4fd9490
commit 5133a874ad

View File

@ -3806,6 +3806,21 @@ bool SketchObject::ConvertToNURBS(int GeoId)
else { // normal geometry
newVals[GeoId] = bspline;
const std::vector< Sketcher::Constraint * > &cvals = Constraints.getValues();
std::vector< Constraint * > newcVals(cvals);
int index = cvals.size()-1;
// delete constraints on this elements other than coincident constraints (bspline does not support them currently)
for (; index >= 0; index--) {
if (cvals[index]->Type != Sketcher::Coincident && ( cvals[index]->First == GeoId || cvals[index]->Second == GeoId || cvals[index]->Third == GeoId)) {
newcVals.erase(newcVals.begin()+index);
}
}
this->Constraints.setValues(newcVals);
}
Geometry.setValues(newVals);