From: Artem Zhidkov Date: Mon, 6 Jul 2020 08:29:54 +0000 (+0300) Subject: Task #3231: Sketcher Offset of a curve. X-Git-Tag: V9_6_0a1~60^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=014f39bd5e67155e4c95a8bc4e5a525b828c10d1;p=modules%2Fshaper.git Task #3231: Sketcher Offset of a curve. WireBuilder: fix typo; minor improvement. --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp index a90d1e953..1cf4005bf 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_WireBuilder.cpp @@ -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; }