From 43810ebeaebc88c15ffa12318364adbc0c860c2f Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 23 Nov 2015 15:02:52 +0300 Subject: [PATCH] Fix the problem with one extra DOF while making arc-arc or arc-line fillet --- .../SketchPlugin_ConstraintFillet.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp index c311ec712..0b4514752 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp @@ -343,6 +343,22 @@ void SketchPlugin_ConstraintFillet::execute() aRefAttr->setAttr(aNewFeature[i]->attribute(aFeatAttributes[anAttrInd])); myProducedFeatures.push_back(aConstraint); } + // 4.1. Additional tangency constraints when the fillet is based on arcs. + // It is used to verify the created arc will be placed on a source. + for (int i = 0; i < aNbFeatures; ++i) { + if (aNewFeature[i]->getKind() != SketchPlugin_Arc::ID()) + continue; + aConstraint = sketch()->addFeature(SketchPlugin_ConstraintTangent::ID()); + aRefAttr = std::dynamic_pointer_cast( + aConstraint->attribute(SketchPlugin_Constraint::ENTITY_A())); + aRefAttr->setObject(aFeature[i]->lastResult()); + aRefAttr = std::dynamic_pointer_cast( + aConstraint->attribute(SketchPlugin_Constraint::ENTITY_B())); + aRefAttr->setObject(aNewFeature[i]->lastResult()); + aConstraint->execute(); + myProducedFeatures.push_back(aConstraint); + ModelAPI_EventCreator::get()->sendUpdated(aConstraint, anUpdateEvent); + } // 5. Tangent points should be placed on the base features for (int i = 0; i < aNbFeatures; i++) { anAttrInd = 2*i + (isStart[i] ? 0 : 1); -- 2.39.2