Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / GeomAPI / GeomAPI_Wire.cpp
index 65729cbf7bed5f9d49b16703852d3c74f73a366e..05062a145cc25abc95b00133c5c7e91a7f52c145 100644 (file)
@@ -106,6 +106,9 @@ bool GeomAPI_Wire::isRectangle(std::list<GeomPointPtr>& thePoints) const
     gp_Pnt aStart = aC3D->Value(aT1);
     gp_Pnt aEnd = aC3D->Value(aT2);
 
+    if (aStart.Distance(aEnd) <= Precision::Confusion())
+      return false;
+
     // check the edge is orthogonal to the previous
     gp_XYZ aCurDir = (aEnd.XYZ() - aStart.XYZ()).Normalized();
     if (aPrevDir.Dot(aCurDir) < Precision::Confusion())