
Wed, 12/01/2021 - 17:57
Hi there!
I am using the OCCT Java wrappers to analyze a .step file and right now I am trying to get the center of a cylindrical surface and getting the same result than by running FaceX.Surface.Center on FreeCAD.
Right now I am trying to do so by calling:
GProps_GProps props = new GProps_GProps();
BRepGProp.SurfaceProperties(topoFace, props);
props.CentreOfMass();
Nevertheless I am getting some differences like:
Point using OCCT: (-21.0, -2.0915, -5.75)
Point using FreeCAD: (-21.0, -0.528414047107, -10.19723749435)
I also tried using U and V points:
GeomLProp_SLProps props = new GeomLProp_SLProps(1, 0.01d);
props.SetSurface(BRep_Tool.Surface(topoFace));
props.SetParameters(uMean, vMean);
props.Value();
where uMean and vMean are the mean of uMin, uMax; vMin and vMax respectively.
Point using OCCT UV: (-21.000000816987242, -2.9999999999998663, -5.75)
Point using FreeCAD: (-21.0, -0.528414047107, -10.19723749435)
As you can see, the values do not correspond at all.
Is there any way of getting more approximate values?
Regards.