From: azv Date: Mon, 23 Nov 2015 12:02:52 +0000 (+0300) Subject: Fix the problem with one extra DOF while making arc-arc or arc-line fillet X-Git-Tag: V_2.1.0~239 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=43810ebeaebc88c15ffa12318364adbc0c860c2f;p=modules%2Fshaper.git Fix the problem with one extra DOF while making arc-arc or arc-line fillet --- 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);