]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
if a shape to be rotated is a vertex, and it is located ON the Revolution Axis, then...
authorasv <asv@opencascade.com>
Mon, 1 Aug 2005 12:51:04 +0000 (12:51 +0000)
committerasv <asv@opencascade.com>
Mon, 1 Aug 2005 12:51:04 +0000 (12:51 +0000)
src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx

index 60222bcdf097e609fcfcb76f6bd7bcced7de45cd..f5ca6cf2a8cf73eaed6b211bffa533500ed34249 100644 (file)
@@ -15,6 +15,8 @@ using namespace std;
 #include <TopExp.hxx>
 
 #include <gp_Pnt.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Dir.hxx>
 #include <Precision.hxx>
 #include <StdFail_NotDone.hxx>
 #include <Standard_TypeMismatch.hxx>
@@ -75,6 +77,14 @@ Standard_Integer GEOMImpl_RevolutionDriver::Execute(TFunction_Logbook& log) cons
         ("End vertices of edge, defining the Revolution Axis, are too close");
     }
 
+    if (aShapeBase.ShapeType() == TopAbs_VERTEX) {
+      gp_Lin aL(BRep_Tool::Pnt(V1), gp_Dir(aV));
+      Standard_Real d = aL.Distance(BRep_Tool::Pnt(TopoDS::Vertex(aShapeBase)));
+      if (d < Precision::Confusion()) {
+       Standard_ConstructionError::Raise("Vertex to be rotated is too close to Revolution Axis");
+      }
+    }
+
     gp_Ax1 anAxis (BRep_Tool::Pnt(V1), aV);
     BRepPrimAPI_MakeRevol MR (aShapeBase, anAxis, aCI.GetAngle(), Standard_False);
     if (!MR.IsDone()) MR.Build();