In netgen6.2.23XX and netgen6.2.22XX I’m trying to mesh occ faces after defining the edges at the boundary without success for simple geometries. In a nutshell, I have the follow sequence of calls to the function of the netgen library.
For an square face, the generated mesh is visually incorrect, with some triangular elements created out of the boundary of the geometry as depicted in the shared image.
Is there any important step/care that must be taken in relation to the added segments for this procedure to work? Studying the FindEdges routine for the newer versions (6.22 and 6.23) I realize that there were some updates in relation to version 6.21, but I still can not figure out how to make this procedure to work again.
From this alone it is a bit difficult to say, maybe you could provide some small cpp script?
My best guess is that the face doesn’t build its boundary correctly (there were also some recent changes there). What you can do for this is call something like
occgeom->GetFace(0).GetBoundary().
This returns an array of segments. Check if these segments all have correct orientation.
The segments are now only stored once per edge in direction of the occ edge. If you have edges in reversed direction, you now also must give the segments in that direction.
To, in my understanding, take care of the correctness of the segments orientation. But I still getting incorrect result for the 2D mesh. The code is open source and can be found here (Salome NETGENPLUGIN) and the function that takes care of feeding netgen segments into the mesh is called AddSegmentsToMesh inside NETGENPlugin_Mesher.cxx.