Mon, 12/05/2022 - 15:56
Hi all,
I currently use BRepGProp::VolumeProperties() to calculate the mass of a solid body. Code snippet is below
GProp_GProps props1;
BRepGProp::VolumeProperties(solidBody, props1, 1e-3, Standard_True);
double mass = props1.Mass();
While this worked correctly for most of the cases, several cases didn't return the desired mass value from this. I then exported the solid body and inspected the mass using other software (SolidWorks, Salome). And they returned values which are around 2-3% different from OCC.
Then I switched to BRepGProp::VolumePropertiesGK() to calculate the mass. The method is the same as above except the following
BRepGProp::VolumePropertiesGK(solidBody, props1, 1e-3, Standard_True);
This turned out to be returning the desired mass properties for all the cases. I then checked OCC Document to find the difference between these two approaches. However, most of the desctiption in VolumePropertiesGK() is redacted. You can find it by here:
https://dev.opencascade.org/doc/refman/html/class_b_rep_g_prop.html
My question is a 2 parter,
1. Is there a significance difference between these two approaches?
2. What does it mean by redacted descriptions in OCC Document?
Thank you very much
Tue, 12/06/2022 - 00:43
The answers are:
1. Difference is significant, different algorithms are used.
2. It is just representation as compiled by doxygen. Please see the original description in the source code of the file BRepGProp.hxx.
Tue, 12/06/2022 - 04:23
Thank you very much for your comment! May I know what are the different algorithms used in these two approaches for a solid to get two different mass values?
Tue, 12/06/2022 - 10:34
It is open source. If there is not enough info in documentation you can always see the source code and make your own conclusions.
Thu, 12/08/2022 - 06:36
Thank you for your help!