Use existing meshing libraries or build one from scratch?

nicoloc

Looking around for some CAD
Hi everybody, based on existing posts in the forum (see post1 or post2) it seems that finding a good open-source library for meshing CAD models is not easy. The posts that I found on the forum are also from some time ago.

I want to gather some information on whether there exist new alternatives or if anybody is currently working on open-source solutions. It seems that @Quaoar solved the problem by writing his own meshing library from scratch, but unfortunately he cannot share the code. In this case, even a pointer to the approach taken or to existing papers would be enough for me.

For existing libraries, for me it would be important to get the CAD face id for each triangle in the final mesh.
 

Quaoar

Administrator
Staff member
The meshing technique that we use is based on quadtrees. It's probably the simplest grid generation technique that is covered in Chapter 5 of the "Mesh generation" book by Pascal Frey and Paul Louis George. A comprehensive overview of quadtree-based meshing approaches can also be found in the "Finite Element Mesh Generation" monograph by Daniel Lo. With this approach, the rectangular domain of every CAD face is recursively subdivided until the target resolution is reached. All inner quads are trivially turned into triangles following a specific pattern, e.g., a diagonal split. The quads that happen to contain a boundary region require more delicate processing as all intersections between quad edges and the boundary links have to be computed.

1713988826298.png
You ask a question in your topic: should one build a new mesher from scratch or go for one of the existing tools. My take on this is business-oriented. Since we are developing an engineering SDK (this is how our team makes a living), it was less of a "do/don't" and more of "how/when" sort of question. I mean, we were (and still are) ready to keep it under constant debugging, and I can say it's not so much fun.

Btw, before you dive deeply into this, I highly recommend reading John Chawner's critical essay. It covers another important approach to meshing which is constrained Delaunay.
 
Last edited:

nicoloc

Looking around for some CAD
Thanks a lot for your reply! I was aware of the book "Delaunay Mesh Generation" from John Chawner's critical essay but didn't know about the other ones you posted. I'll look into them. It seems though that I probably severely underestimated the effort to implement such a project.
I'm a bit surprised though. Given the infinite number of available meshing libraries online, it looks weird that few public implementations exist specialized for CAD files (I'm thinking about GMSH and Netgen). Probably the engineering world is not so open as the graphics/computational geometry community.
 

Quaoar

Administrator
Staff member
It seems though that I probably severely underestimated the effort to implement such a project.
I'm a bit surprised though. Given the infinite number of available meshing libraries online, it looks weird that few public implementations exist specialized for CAD files (I'm thinking about GMSH and Netgen).
Well, from my perspective, NetGen and GMSH are pretty much the only viable open-sourced meshers available out there. But I also saw quite some attempts to build a Delaunay mesher ground-up with partial "academic" success. These were student's works or PhD theses whose authors made strict assumptions about the geometric domain; e.g., meshes for turbomachinery are quite specific. You're right, there's not much we can reuse in the CAD community, as all these prototypes normally get abandoned once their creators defend their theses and move on to something else. Developing a mesher is only half the problem, as after you'll inevitably have to industrialize it and keep it maintained for a long time. That's quite a journey. Are you up to develop your own mesher?
 
Top