mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-27 15:10:33 +05:00
0021777: [CEA 611] RemoveExtraEdges on rounded cylinder
This commit is contained in:
parent
bcea256296
commit
871970274e
@ -40,6 +40,8 @@
|
|||||||
#include <ShapeFix_Edge.hxx>
|
#include <ShapeFix_Edge.hxx>
|
||||||
#include <Geom_Curve.hxx>
|
#include <Geom_Curve.hxx>
|
||||||
#include <Geom2d_Curve.hxx>
|
#include <Geom2d_Curve.hxx>
|
||||||
|
#include <GProp_GProps.hxx>
|
||||||
|
#include <BRepGProp.hxx>
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -88,6 +90,16 @@ static Standard_Boolean ModifySurface(const TopoDS_Face& aFace,
|
|||||||
if(Vmax > PI2 - Precision::PConfusion() || Vmin < -PI2+::Precision::PConfusion()) {
|
if(Vmax > PI2 - Precision::PConfusion() || Vmin < -PI2+::Precision::PConfusion()) {
|
||||||
Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S);
|
Handle(Geom_SphericalSurface) aSphere = Handle(Geom_SphericalSurface)::DownCast(S);
|
||||||
gp_Sphere sp = aSphere->Sphere();
|
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();
|
gp_Ax3 ax3 = sp.Position();
|
||||||
if(Abs(Vmax-Vmin) < PI2) {
|
if(Abs(Vmax-Vmin) < PI2) {
|
||||||
gp_Ax3 axnew3(ax3.Axis().Location(), ax3.Direction()^ax3.XDirection(),ax3.XDirection());
|
gp_Ax3 axnew3(ax3.Axis().Location(), ax3.Direction()^ax3.XDirection(),ax3.XDirection());
|
||||||
|
Loading…
Reference in New Issue
Block a user