Wed, 10/16/2024 - 11:59
Forums:
Hi
I have an application where I receive data in an independent format and recreate the shape(s) via OpenCascade. However when using brepgprop.VolumeProperties it gives problematic answers. E.g. the attached file is intended to be a 10,000 x 10,000 x 10 square prism (and visually appears as such), but the volume properties gives a CoG of (5298.9, 5197.0, 5) and volume 793500000.
Any pointers would be appreciated.
Michael
Attachments:
Wed, 10/16/2024 - 20:07
The issue probably because it is a BSpline. With some strage knots like 3.33333E+03. Could you please use not a BSpline geometry? In other scenario is better to use BRepBndLib::AddOptimal to have precise value for BBox. OR for volume you can use VolumePropertiesGK
Best regads, Dmitrii.
Thu, 10/17/2024 - 14:45
Sadly we are passed the NURBS from another application.
The actual CoG is (5000,5000,50), volumeproperties reports (5298.9, 5197.0, 5) and volumepropertiesGK (0,0,5). Using a bounding box won't help with the volume of a curved solid.
I'm not sure where to go from here.
Thu, 10/17/2024 - 15:25
As an option, you can use IncMesh to generate mesh and extract the volume based on that mesh.
Additionally, you can play with eps.
Best regards, Dmitrii.
Thu, 10/17/2024 - 15:56
Thanks again Dmitrii!
I don't know why, but using VolumePropertiesGK with IFlag=True solves this issue completely! Perfect results.
Thu, 10/17/2024 - 16:06
IFlag
requests algorithm to compute matrix of inertia.Thu, 10/17/2024 - 16:16
Thanks for the info. Why this helps is a mystery....
Thu, 10/17/2024 - 16:03
There is also
BRepGProp::VolumeProperties()
that takesEps
parameter to specify desired maximum computation error of integration algorithm. Specify error below to 1.0 mm:In DRAW (eps=0.001mm):
Thu, 10/17/2024 - 16:16
Eps doesn't seem to have a good effect for me.