From 871970274e2238e31343d3deb718f8eb68797ec9 Mon Sep 17 00:00:00 2001 From: jgv Date: Tue, 13 Nov 2012 08:45:13 +0000 Subject: [PATCH] 0021777: [CEA 611] RemoveExtraEdges on rounded cylinder --- src/GEOMAlgo/BlockFix_SphereSpaceModifier.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/GEOMAlgo/BlockFix_SphereSpaceModifier.cxx b/src/GEOMAlgo/BlockFix_SphereSpaceModifier.cxx index 9e2db755a..2abc08316 100644 --- a/src/GEOMAlgo/BlockFix_SphereSpaceModifier.cxx +++ b/src/GEOMAlgo/BlockFix_SphereSpaceModifier.cxx @@ -40,6 +40,8 @@ #include #include #include +#include +#include //======================================================================= @@ -88,6 +90,16 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace, if(Vmax > PI2 - Precision::PConfusion() || Vmin < -PI2+::Precision::PConfusion()) { Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S); gp_Sphere sp = aSphere->Sphere(); + //modified by jgv, 12.11.2012 for issue 21777// + Standard_Real Radius = sp.Radius(); + Standard_Real HalfArea = 2.*M_PI*Radius*Radius; + GProp_GProps Properties; + BRepGProp::SurfaceProperties(aFace, Properties); + Standard_Real anArea = Properties.Mass(); + Standard_Real AreaTol = Radius*Radius*1.e-6; + if (anArea > HalfArea - AreaTol) //no chance to avoid singularity + return Standard_False; + /////////////////////////////////////////////// gp_Ax3 ax3 = sp.Position(); if(Abs(Vmax-Vmin) < PI2) { gp_Ax3 axnew3(ax3.Axis().Location(), ax3.Direction()^ax3.XDirection(),ax3.XDirection()); -- 2.39.2