]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Added a check on proximity between last point and current point in 3D sketch construc...
authorrnc <rnc@opencascade.com>
Mon, 10 Sep 2012 12:51:34 +0000 (12:51 +0000)
committerrnc <rnc@opencascade.com>
Mon, 10 Sep 2012 12:51:34 +0000 (12:51 +0000)
It fixes a bug in preview of the 3D sketcher.

src/GEOMImpl/GEOMImpl_3DSketcherDriver.cxx

index 0dbdc320b6424f3ebb2004d3ee0c5d2ac91f3642..d50aec7917e77e64442d5bd45e972970bdb86718 100755 (executable)
@@ -242,15 +242,17 @@ Standard_Integer GEOMImpl_3DSketcherDriver::Execute(TFunction_Logbook& log) cons
           }
           else
             Standard_ConstructionError::Raise("3D Sketcher error: Bad format of command.");
-
-          BRepBuilderAPI_MakeVertex MV (vp);
-          TopoDS_Vertex VV = TopoDS::Vertex(MV.Shape());
-          BRepBuilderAPI_MakeEdge ME (V, VV);
-          MW.Add(ME);
-          nbEdges++;
-
-          p = vp;
-          V = VV;
+          
+          if ((vp - p).SquareModulus() > Precision::Confusion()) {
+            BRepBuilderAPI_MakeVertex MV (vp);
+            TopoDS_Vertex VV = TopoDS::Vertex(MV.Shape());
+            BRepBuilderAPI_MakeEdge ME (V, VV);
+            MW.Add(ME);
+            nbEdges++;
+
+            p = vp;
+            V = VV;
+          }
         }
         break;
       case 'W':