if (!aFilletPoint2D.get())
return false;
- std::set<FeaturePtr> aFilletFeatures =
- SketchPlugin_Tools::findFeaturesCoincidentToPoint(aFilletPoint2D);
+ std::set<AttributePoint2DPtr> aCoincidentPoints =
+ SketchPlugin_Tools::findPointsCoincidentToPoint(aFilletPoint2D);
+ std::set<FeaturePtr> aFilletFeatures;
+ for (std::set<AttributePoint2DPtr>::iterator aCPIt = aCoincidentPoints.begin();
+ aCPIt != aCoincidentPoints.end(); ++aCPIt) {
+ std::shared_ptr<SketchPlugin_Feature> anOwner =
+ std::dynamic_pointer_cast<SketchPlugin_Feature>(
+ ModelAPI_Feature::feature((*aCPIt)->owner()));
+ if (anOwner && !anOwner->isExternal())
+ aFilletFeatures.insert(anOwner);
+ }
if (aFilletFeatures.size() != 2) {
setError("Error: Selected point does not have two suitable edges for fillet.");
return false;
AttributePoint2DPtr aCoord = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
anApex->attribute(SketchPlugin_Point::COORD_ID()));
aCoord->setValue(theCoordinates);
+ anApex->boolean(SketchPlugin_Point::AUXILIARY_ID())->setValue(true);
// additional coincidence constraints
static Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
AttributePoint2DPtr aFlyoutAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
aLength->attribute(SketchPlugin_ConstraintLength::FLYOUT_VALUE_PNT()));
if (aFlyoutAttr && aFlyoutAttr->isInitialized())
- aNewLength.myFlyoutPoint = aFlyoutAttr->pnt();
+ aNewLength.myFlyoutPoint = SketchPlugin_Tools::flyoutPointCoordinates(aLength);
AttributeIntegerPtr aLocationAttr =
aLength->integer(SketchPlugin_ConstraintLength::LOCATION_TYPE_ID());
if (aLocationAttr && aLocationAttr->isInitialized())
if (anEdge)
aLengths[i] = anEdge->length();
}
- return std::min(aLengths[0], aLengths[1]) / 6.0;
+ return (aLengths[0] < aLengths[1] ? aLengths[0] : aLengths[1]) / 6.0;
}
std::set<FeaturePtr> findFeaturesToRemove(const FeaturePtr theFeature,