From 1ac0449ef966c932d04d85f2c0f30e50f6849dd7 Mon Sep 17 00:00:00 2001 From: dbv Date: Fri, 13 May 2016 18:59:30 +0300 Subject: [PATCH] Fixed fillet on point with arc center. --- .../SketchPlugin_ConstraintFillet.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp index 40c4a83b3..530895f30 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp @@ -554,6 +554,13 @@ void SketchPlugin_ConstraintFillet::attributeChanged(const std::string& theID) } aNewSetOfCoincides.insert(*anIt); } else if(aFeatureKind == SketchPlugin_Arc::ID() ) { + AttributePtr anAttrCenter = (*anIt)->attribute(SketchPlugin_Arc::CENTER_ID()); + std::shared_ptr aPointCenter2D = + std::dynamic_pointer_cast(anAttrCenter); + if(aPointCenter2D.get() && aFilletPnt2d->isEqual(aPointCenter2D->pnt())) { + aPointsToSkeep.insert(anAttrCenter); + continue; + } AttributePtr anAttrStart = (*anIt)->attribute(SketchPlugin_Arc::START_ID()); std::shared_ptr aPointStart2D = std::dynamic_pointer_cast(anAttrStart); @@ -1032,6 +1039,8 @@ std::set getCoincides(const FeaturePtr& theConstraintCoincidence) { std::set aCoincides; + std::shared_ptr aFilletPnt = SketchPlugin_Tools::getCoincidencePoint(theConstraintCoincidence); + SketchPlugin_Tools::findCoincidences(theConstraintCoincidence, SketchPlugin_ConstraintCoincidence::ENTITY_A(), aCoincides); @@ -1042,8 +1051,15 @@ std::set getCoincides(const FeaturePtr& theConstraintCoincidence) // Remove points from set of coincides. std::set aNewSetOfCoincides; for(std::set::iterator anIt = aCoincides.begin(); anIt != aCoincides.end(); ++anIt) { - if((*anIt)->getKind() == SketchPlugin_Line::ID() || - (*anIt)->getKind() == SketchPlugin_Arc::ID() ) { + if((*anIt)->getKind() == SketchPlugin_Line::ID()) { + aNewSetOfCoincides.insert(*anIt); + } else if((*anIt)->getKind() == SketchPlugin_Arc::ID()) { + AttributePtr anAttrCenter = (*anIt)->attribute(SketchPlugin_Arc::CENTER_ID()); + std::shared_ptr aPointCenter2D = + std::dynamic_pointer_cast(anAttrCenter); + if(aPointCenter2D.get() && aFilletPnt->isEqual(aPointCenter2D->pnt())) { + continue; + } aNewSetOfCoincides.insert(*anIt); } } -- 2.39.2