From 9e7854e71faea1a1c8a07069046307eb1e914c0d Mon Sep 17 00:00:00 2001 From: abk Date: Wed, 9 Jan 2013 13:40:56 +0400 Subject: [PATCH] Calculation of gravity center was made by vertices data for degenerated edge without representations. --- src/BRepGProp/BRepGProp.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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); + } } }