}
if(!aConstraintCoincidence.get()) {
- theError = "Error: one of the selected point does not have coicidence.";
+ theError = "Error: one of the selected point does not have coincidence.";
return false;
}
if (aFeature->getKind() == SketchPlugin_Point::ID())
++aNbPoints;
else if (aFeature->getKind() == SketchPlugin_Line::ID() ||
- aFeature->getKind() == SketchPlugin_Arc::ID())
+ aFeature->getKind() == SketchPlugin_Arc::ID() ||
+ aFeature->getKind() == SketchPlugin_EllipticArc::ID())
++aNbLines;
}
}
}
}
else {
- theError = "Unable to build transversal arc on %1";
+ theError = "Unable to build perpendicular arc on %1";
theError.arg(anAttrFeature->getKind());
return false;
}
GeomShapePtr anAttrShape = (*anEdgeShapes.begin())->shape();
std::shared_ptr<SketchPlugin_Feature> aSFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(anAttrFeature);
+ if (!aSFeature)
+ return false;
SketchPlugin_Sketch* aSketch = aSFeature->sketch();
std::shared_ptr<ModelAPI_Data> aData = aSketch->data();
std::shared_ptr<GeomAPI_Ellipse> anEllipse = anEdge->ellipse();
std::shared_ptr<GeomAPI_Dir> anEllipseNormal = anEllipse->normal();
double aDot = fabs(aNormal->dot(anEllipseNormal));
- bool aValid = aDot >= tolerance * tolerance;
+ bool aValid = fabs(aDot - 1.0) <= tolerance * tolerance;
if (!aValid)
- theError.arg(anEdge->isEllipse() ? "Error: Ellipse is orthogonal to the sketch plane."
- : "Error: Elliptic Arc is orthogonal to the sketch plane.");
+ theError.arg(anEdge->isClosed() ? "Error: Ellipse is orthogonal to the sketch plane."
+ : "Error: Elliptic Arc is orthogonal to the sketch plane.");
return aValid;
}