From: asv Date: Mon, 1 Aug 2005 12:51:04 +0000 (+0000) Subject: if a shape to be rotated is a vertex, and it is located ON the Revolution Axis, then... X-Git-Tag: T_3_0_2a1~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=60efe138c3a368e48ded9cf5d89b9623cf33f90c;p=modules%2Fgeom.git if a shape to be rotated is a vertex, and it is located ON the Revolution Axis, then the algorithm builds a circle with null radius. Incorrect, visualization of such shape fails. This case is checked and revolution is not done in this case. --- diff --git a/src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx b/src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx index 60222bcdf..f5ca6cf2a 100644 --- a/src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx @@ -15,6 +15,8 @@ using namespace std; #include #include +#include +#include #include #include #include @@ -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();