Thank for your answer,
I have tried the GProp_PGProps::Barycentre(Pnts,Density,Mass,Centre) method to approximate the solution using the vertex of the edge of the wire but I have the problem that the number of points from one side of the shape add a weight to this side of the shape moving the baricenter near the side.
Do you know a function that calculates the geometrical baricentre of a plane shape ?
Wed, 04/18/2012 - 14:47
Check out the BRepGProp class. The static functions fill in a GProp_GProps object with the mass properties.
Wed, 04/18/2012 - 18:59
Hello,
Thank for your answer,
I have tried the GProp_PGProps::Barycentre(Pnts,Density,Mass,Centre) method to approximate the solution using the vertex of the edge of the wire but I have the problem that the number of points from one side of the shape add a weight to this side of the shape moving the baricenter near the side.
Do you know a function that calculates the geometrical baricentre of a plane shape ?
Thank you
Wed, 04/18/2012 - 19:03
Have you just tried the GProp_GProps::CenterOfMass() function?
Wed, 04/18/2012 - 19:12
No , I haven't,
But I cannot undestand very well how can I use this function.
Can you provide me 3 sample line of code to use it with a wire or face ?
Wed, 04/18/2012 - 19:21
This example uses SurfaceProperties to compute the values for a face. In theory, you could use LinearProperties for a wire, but I have not tried it.
GProp_GProps massProps;
BRepGProp::SurfaceProperties(myShape, massProps);
gp_Pnt gPt = massProps.CentreOfMass();
Wed, 04/18/2012 - 19:43
Thank you Rob,
It works well on the face. I will try with the wire.
Thank you very much for the support,
Regards