STEP File meshing

  • R_Wohlgethan

    R_Wohlgethan - 2012-08-10

    Good evening,

    Are there any examples available for :

    calling netgen from dos:

    1) importing a step file
    2) meshing it automatically
    3) exporting the mesh into .msh or .vol format

  • Chumbawumba

    Chumbawumba - 2012-08-11

    I don't think you can do that directly.

    But it's pretty easy with nglib. I do it using a small exe which calls nglib functions. It's about 200 lines of C and does stl, iges and 2D spline inputs. See nglib.h for details of the functions you need to call.

  • R_Wohlgethan

    R_Wohlgethan - 2012-08-11

    Hello Chumba,

    Thx alot.

    Can you tell me which steps must be done in order to mesh something via cmd?   I think I need a .geo file right?  But I haven´t got how it should look like if I import a step.

    Can you help me with this?

  • Chumbawumba

    Chumbawumba - 2012-08-12

    I can't say about using cmd. But my C++ program for doing it is essentially the following. I have some error handling, alternative file formats and other bits and pieces which I ommited for clarity. .geo files are Netgen specific CSG geometry definitions and have nothing to do with meshing a .step file.

    Ng_Meshing_Parameters mp;
    Ng_OCC_Geometry *occ_geom;
    Ng_Mesh *output_mesh;
    occ_geom = Ng_OCC_Load_STEP(fileName);
    output_mesh = Ng_NewMesh();
    Ng_OCC_SetLocalMeshSize(occ_geom, output_mesh, &mp);
    Ng_OCC_GenerateEdgeMesh(occ_geom, output_mesh, &mp);
    Ng_OCC_GenerateSurfaceMesh(occ_geom, output_mesh, &mp);
    Ng_GenerateVolumeMesh(output_mesh, &mp);
    Ng_SaveMesh(output_mesh, "output.vol");


Log in to post a comment.