From 60efe138c3a368e48ded9cf5d89b9623cf33f90c Mon Sep 17 00:00:00 2001 From: asv Date: Mon, 1 Aug 2005 12:51:04 +0000 Subject: [PATCH] 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. --- src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) 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(); -- 2.39.2