Volume mesh for a simple cylinder fails

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:
Face 1

for more information open IGES/STEP Topology Explorer
Problem in Surface mesh generation

Attachment: cylinder.step

+1 I get the same issue

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.

Best
Christopher

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.

Thanks

Attachment: 2_2_1.stp

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.
Best
Christopher

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;

   mp->Transfer_Parameters();
   mparam.perfstepsstart = MESHCONST_ANALYSE;
   mparam.perfstepsend = MESHCONST_OPTSURFACE;

   int res = netgenGeometry->GenerateMesh( netgenMesh, mparam );

   if(res == 0 )
	   return( NG_OK );

}[/code]

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 (
https://ngsolve.org/media/kunena/attachments/1385/2_2_1.stp )
So it throws out of range error.

Thanks

Attachment: 2_2_1_2020-07-25.stp