From: abk Date: Fri, 28 Dec 2012 15:53:42 +0000 (+0400) Subject: Method BRepGProp::LinearProperties was changed to avoid degenerated edges. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=a8dfb02c9a1c2c213241a45552022792fbb500ac;p=occt-copy.git Method BRepGProp::LinearProperties was changed to avoid degenerated edges. --- diff --git a/src/BRepGProp/BRepGProp.cxx b/src/BRepGProp/BRepGProp.cxx index b77c6fb4a8..29f32083de 100755 --- a/src/BRepGProp/BRepGProp.cxx +++ b/src/BRepGProp/BRepGProp.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #ifdef DEB static Standard_Integer AffichEps = 0; #endif @@ -55,9 +56,15 @@ void BRepGProp::LinearProperties(const TopoDS_Shape& S, GProp_GProps& SProps){ // Standard_Integer n,i; TopExp_Explorer ex; for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) { - BAC.Initialize(TopoDS::Edge(ex.Current())); - BRepGProp_Cinert CG(BAC,P); - SProps.Add(CG); + TopoDS_Edge anES = TopoDS::Edge(ex.Current()); + Handle_BRep_TEdge & anEG = (Handle_BRep_TEdge &)anES.TShape(); + BRep_TEdge dsd; + if (!anEG->Degenerated()) + { + BAC.Initialize(anES); + BRepGProp_Cinert CG(BAC,P); + SProps.Add(CG); + } } }