static EntityWrapperPtr createLine(const AttributeEntityMap& theAttributes);
static EntityWrapperPtr createCircle(const AttributeEntityMap& theAttributes);
static EntityWrapperPtr createArc(const AttributeEntityMap& theAttributes,
- PlaneGCSSolver_Storage* theStorage,
- std::list<GCSConstraintPtr>& theArcConstraints);
+ PlaneGCSSolver_Storage* theStorage);
PlaneGCSSolver_FeatureBuilder::PlaneGCSSolver_FeatureBuilder(
aResult = createCircle(myAttributes);
// Arc
else if (aFeatureKind == SketchPlugin_Arc::ID())
- aResult = createArc(myAttributes, myStorage, myFeatureConstraints);
+ aResult = createArc(myAttributes, myStorage);
// Point (it has low probability to be an attribute of constraint, so it is checked at the end)
else if (aFeatureKind == SketchPlugin_Point::ID() ||
aFeatureKind == SketchPlugin_IntersectionPoint::ID()) {
}
EntityWrapperPtr createArc(const AttributeEntityMap& theAttributes,
- PlaneGCSSolver_Storage* theStorage,
- std::list<GCSConstraintPtr>& theArcConstraints)
+ PlaneGCSSolver_Storage* theStorage)
{
std::shared_ptr<GCS::Arc> aNewArc(new GCS::Arc);
new GeomAPI_Dir2d((*aNewArc->end.x) - aCenter->x(), (*aNewArc->end.y) - aCenter->y()));
*aNewArc->endAngle = OX->angle(aDir);
- if (theStorage) {
- // Additional constaints to fix arc's extra DoF (if the arc is not external):
- // 1. distances from center till start and end points are equal to radius
- theArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PDistance(
- aNewArc->center, aNewArc->start, aNewArc->rad)));
- theArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PDistance(
- aNewArc->center, aNewArc->end, aNewArc->rad)));
- // 2. angles of start and end points should be equal to the arc angles
- theArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PAngle(
- aNewArc->center, aNewArc->start, aNewArc->startAngle)));
- theArcConstraints.push_back(GCSConstraintPtr(new GCS::ConstraintP2PAngle(
- aNewArc->center, aNewArc->end, aNewArc->endAngle)));
- }
-
return EntityWrapperPtr(new PlaneGCSSolver_EdgeWrapper(aNewArc));
}