From: jfa Date: Fri, 3 Jul 2020 12:14:25 +0000 (+0300) Subject: Task #3231: Sketcher Offset of a curve. Fix a bug with offset side in case of several... X-Git-Tag: V9_6_0a1~60^2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ffe6257a4e16b117ea37dbc79258aa212da7aaef;p=modules%2Fshaper.git Task #3231: Sketcher Offset of a curve. Fix a bug with offset side in case of several chains. --- diff --git a/src/SketchPlugin/SketchPlugin_Offset.cpp b/src/SketchPlugin/SketchPlugin_Offset.cpp index 2f01c4a8c..4fb79fdec 100644 --- a/src/SketchPlugin/SketchPlugin_Offset.cpp +++ b/src/SketchPlugin/SketchPlugin_Offset.cpp @@ -171,6 +171,7 @@ void SketchPlugin_Offset::execute() // Fix for a problem of offset side change with selection change. // Wire direction is defined by the first selected edge of this wire. + double aSign = 1.; if (!aWire->isClosed()) { ListOfShape aModified; // First selected edge of current chain @@ -178,12 +179,12 @@ void SketchPlugin_Offset::execute() aWireBuilder->modified(aFirstSel, aModified); GeomShapePtr aModFS = aModified.front(); if (aModFS->orientation() != aFirstSel->orientation()) - aValue = -aValue; + aSign = -1.; } // 5.d. Make offset for the wire std::shared_ptr anOffsetShape( - new GeomAlgoAPI_Offset(aPlane, aWireShape, aValue)); + new GeomAlgoAPI_Offset(aPlane, aWireShape, aValue*aSign)); std::shared_ptr aMakeList(new GeomAlgoAPI_MakeShapeList); aMakeList->appendAlgo(aWireBuilder);