I'm trying to plug some OCCT functions to my own geometric mesher (controlling choral error) in order to generate a mesh for each surface in the bearing.iges file provided with the OCCT distribution.
What basically my mesher need is :
- to get the parameters (u,v) for a given point on the surface ( I use : GeomLib_Tool::Parameters)
- to get the reciprocal (I use : Geom_Surface::Point)
- to get the local derivatives on a given point on the surface (I use D0,D1,D2 from Geom_Surface).
The main problems I have are with GeomLib_Tool::Parameters that fails sometimes :
1) The first issue I had is with MAXTOLERANCEGEOM in the source file that is hard coded and is very restrictive (too many calls return Standard_False). I have increased its value and it give still good result.
- why the value has been hard coded and set to 1.e-4 ? would it be possible to pass it as a parameter or make the users able to change it dynamically ?
2) But even by increasing the value, I still get errors like the one depicted in the attached images. For the bearing case, the surface orange (fig1 for a global view, fig. 2 for a zoom) is not transformed properly (i.e. in an isomorphic manner) as shown in fig. 3. where 2 transformed points get coincident. Do you know what is the issue, if I'm doing something wrong or if there is a workaround or a better way to get the transformed boundary of a surface.
To give you extra details about how I discretize the surface boundaries :
I use GCPnts_UniformDeflection whith a given chordal error. it gives me a number of new points N1 over the contour.
I then compute the length of each edge using GCPnts_AbscissaPoint::Length. Given a input size h, this gives the number of new points N2.
I finally actually do the discretization using max(N1,N2) with GCPnts_UniformAbscissa.
Many thanks for your help