A simple solid cylinder attached fails for volume mesh.
Last output lines
Surface meshing done
0 illegal triangles
WARNING! NOT ALL FACES HAVE BEEN MESHED
SURFACE MESHING ERROR OCCURRED IN 1 FACES:
for more information open IGES/STEP Topology Explorer
Problem in Surface mesh generation
The step file seems to not consist of one solid, but multiple free shells (that are not “glued” together). You can fix this with Geometry-> IGES/STEP Topology Explorer/Doctor and then Click the “Heal Geometry” button. Netgen then glues the geometry together and is able to mesh it.
Thanks Christopher, that worked,
I am meshing with C++ API.
The model attached fails in surface mesh, It mesh good in GUI, I am missing Analyze Geometry in C++, how can we do that in C++?
I could even reproduce the crash in surface mesh creation if I don’t analyze geometry in GUI.
OCCGeometry has a Analyse function that should be called for this.
Actually if you call the GenerateMesh from the base class NetgenGeometry all function should be called in correct order and so. Probably thats what you want to do.
I tried to call the GenerateMesh from nglib.cpp like this
[code] DLL_HEADER Ng_Result Ng_GenerateMesh( Ng_OCC_Geometry * geom,
Ng_Mesh * mesh,
Ng_Meshing_Parameters* mp )
OCCGeometry * occgeom = (OCCGeometry*)geom;
std::shared_ptr< NetgenGeometry> netgenGeometry = shared_ptr( occgeom, &NOOP_Deleter );
shared_ptr<Mesh> netgenMesh( (Mesh*)mesh, &NOOP_Deleter );
netgenMesh->SetGeometry( netgenGeometry );
netgenMesh->geomtype = Mesh::GEOM_OCC;
mparam.perfstepsstart = MESHCONST_ANALYSE;
mparam.perfstepsend = MESHCONST_OPTSURFACE;
int res = netgenGeometry->GenerateMesh( netgenMesh, mparam );
if(res == 0 )
return( NG_OK );
But it crashes at OCCMeshSurface
Meshing2OCCSurfaces meshing(geom, TopoDS::Face(geom.fmap(k)), bb, projecttype, mparam);
the value of k is greater than number of faces in the geometry (
So it throws out of range error.