From: abk Date: Wed, 9 Jan 2013 09:40:56 +0000 (+0400) Subject: Calculation of gravity center was made by vertices data for degenerated X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c3cf76dfbda3d08a9e2533044e3297034363dbb3;p=occt-copy.git Calculation of gravity center was made by vertices data for degenerated edge without representations. --- diff --git a/src/BRepGProp/BRepGProp.cxx b/src/BRepGProp/BRepGProp.cxx index 29f32083de..f6700f9e02 100755 --- a/src/BRepGProp/BRepGProp.cxx +++ b/src/BRepGProp/BRepGProp.cxx @@ -24,7 +24,9 @@ #include #include #include +#include #include +#include #include #include @@ -33,6 +35,7 @@ #include #include #include +#include #ifdef DEB static Standard_Integer AffichEps = 0; #endif @@ -65,6 +68,20 @@ void BRepGProp::LinearProperties(const TopoDS_Shape& S, GProp_GProps& SProps){ BRepGProp_Cinert CG(BAC,P); SProps.Add(CG); } + else + { + GProp_PGProps aPD; + for (TopExp_Explorer aVE(anES, TopAbs_VERTEX); aVE.More(); aVE.Next()) + { + TopoDS_Vertex aVS = TopoDS::Vertex(aVE.Current()); + Handle_BRep_TVertex & aVG = (Handle_BRep_TVertex &)aVS.TShape(); + gp_Pnt aP = aVG->Pnt(); + aP.Transform(anES.Location()); + aP.Transform(S.Location()); + aPD.AddPoint(aP); + } + SProps.Add(aPD); + } } }