double* aEndAngle = std::dynamic_pointer_cast<PlaneGCSSolver_ScalarWrapper>(*aSubIt++)->scalar();
double* aRadius = std::dynamic_pointer_cast<PlaneGCSSolver_ScalarWrapper>(*aSubIt)->scalar();
- FeaturePtr anArcFeature = theArc->baseFeature();
+ std::shared_ptr<SketchPlugin_Feature> anArcFeature =
+ std::dynamic_pointer_cast<SketchPlugin_Feature>(theArc->baseFeature());
std::shared_ptr<GeomDataAPI_Point2D> aCenterAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
anArcFeature->attribute(SketchPlugin_Arc::CENTER_ID()));
std::shared_ptr<GeomDataAPI_Point2D> aStartAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
return;
anArcEdge->getRange(*aStartAngle, *aEndAngle);
+ // do not constraint copied arc
+ if (anArcFeature->isCopy())
+ return;
// No need to add constraints if they are already exist
std::map<EntityWrapperPtr, std::vector<GCSConstraintPtr> >::const_iterator
aFound = myArcConstraintMap.find(theArc);
std::vector<EntityWrapperPtr>::iterator aBIt = aBaseList.begin();
std::vector<EntityWrapperPtr>::iterator aMIt = aMirrorList.begin();
for (; aBIt != aBaseList.end(); ++aBIt, ++aMIt) {
- if ((*aBIt)->type() == ENTITY_ARC) {
- // add new points on arcs and mirror them
- EntityWrapperPtr aBasePnt = myStorage->calculateMiddlePoint(*aBIt, 0.5);
- EntityWrapperPtr aMirrPnt = myStorage->calculateMiddlePoint(*aMIt, 0.5);
- // point on base arc
- aNewConstraints = aBuilder->createConstraint(myBaseConstraint, myGroupID, mySketchID,
- CONSTRAINT_PT_ON_CIRCLE, 0.0, aBasePnt, EntityWrapperPtr(), *aBIt);
- aMirConstrList.insert(aMirConstrList.end(), aNewConstraints.begin(), aNewConstraints.end());
- // point on mirrored arc
- aNewConstraints = aBuilder->createConstraint(myBaseConstraint, myGroupID, mySketchID,
- CONSTRAINT_PT_ON_CIRCLE, 0.0, aMirrPnt, EntityWrapperPtr(), *aMIt);
- aMirConstrList.insert(aMirConstrList.end(), aNewConstraints.begin(), aNewConstraints.end());
- // mirror these points
- aNewConstraints = aBuilder->createConstraint(myBaseConstraint, myGroupID, mySketchID,
- aConstrType, 0.0, aBasePnt, aMirrPnt, aMirrorLine);
- aMirConstrList.insert(aMirConstrList.end(), aNewConstraints.begin(), aNewConstraints.end());
- }
aNewConstraints = aBuilder->createConstraint(
myBaseConstraint, myGroupID, mySketchID, aConstrType,
0.0, *aBIt, *aMIt, aMirrorLine);
for (aMIt = aMirrorList.begin(); aMIt != aMirrorList.end(); ++aMIt)
myStorage->update((*aMIt)->baseFeature(), myGroupID);
myStorage->addConstraint(myBaseConstraint, aMirConstrList);
+
+ adjustConstraint();
}