]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task #3231: Sketcher Offset of a curve.
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Mon, 6 Jul 2020 08:29:54 +0000 (11:29 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Mon, 6 Jul 2020 08:29:54 +0000 (11:29 +0300)
WireBuilder: fix typo; minor improvement.

src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp

index a90d1e95320afd3bb302da0592dde07c4f5e9133..1cf4005bf720e081b6d4468f301fd7599deddddb 100644 (file)
@@ -67,7 +67,7 @@ GeomAlgoAPI_WireBuilder::GeomAlgoAPI_WireBuilder(const ListOfShape& theShapes,
 
   bool isSplitWire = false;
   gp_Pnt aSplitPoint;
-  if (theForceOpenWire) {
+  if (theForceOpenWire && aListOfEdges.Size() > 1) {
     // find a vertex to split the wire
     TopoDS_Vertex V1[2];
     TopExp::Vertices(TopoDS::Edge(aListOfEdges.First()), V1[0], V1[1]);
@@ -79,7 +79,7 @@ GeomAlgoAPI_WireBuilder::GeomAlgoAPI_WireBuilder(const ListOfShape& theShapes,
     double Tol2[2] = { BRep_Tool::Tolerance(V2[0]), BRep_Tool::Tolerance(V2[1]) };
     for (int i = 0; i < 2 && !isSplitWire; ++i)
       for (int j = 0; j < 2 && !isSplitWire; ++j)
-        if (P1[i].Distance(P2[i]) < Max(Tol1[i], Tol2[j])) {
+        if (P1[i].Distance(P2[j]) < Max(Tol1[i], Tol2[j])) {
           aSplitPoint = P1[i];
           isSplitWire = true;
         }