Marching cubes generates surface triangles. How to adapt it to generate tetrahedra throughout the volume of a 3D model?

69 Views Asked by At

Background

There is a source code that generates surface triangles. The isosurface is generated for the iso-value of 0. The source code uses a table for 2^8=256 possible inside/outside, i.e. negative/positive, combinations of 8 scalar values at 8 cube corners. The table returns an array. Every 3 consecutive array items would correspond to a triangle. The array items could be from 0 to 11, pointing to the 12 edges a cube has. Probably this table comes from a published paper in the field of mathematics or computer science:

https://github.com/deadsy/sdfx/blob/2d4e9502ec6fe898e8774020882cb8150f16a6a6/render/march3.go#L360

Objective

I'm trying to adapt the above marching cubes source code, and its tables, to generate tetrahedra throughout the volume of a 3D model. The code would extract tetrahedra elements with all the non-positive, i.e. <=0, values. Non-positive means the 3D space on and inside the isosurface of the 0 value.

Question

For some reason, I cannot find any publication for extracting a tetrahedral mesh on and inside the isosurface from a three-dimensional discrete scalar field. Maybe I'm not looking at the right places. Am I missing something? Or do I have to come up with the tables myself? It looks like a daunting task to me.

2

There are 2 best solutions below

1
On BEST ANSWER

A possible approach is suggested like this:

Conceptually it seems simple enough. For each of those 256 cases work, break up the defined volume into tetrahedra. But yes- you don't want to do it by hand. fwiw- doing the 2d form of the same thing can lead to insights.

How to avoid doing it by hand? I'm not sure. Any publication on this might be helpful.

Is there any software tool that might help with the manual task? Maybe.

Update

The development is being done here that looks promising: https://github.com/Megidd/tetrahedron-table

1
On

The most likely tetrahedron is one where all sides are $\sqrt(3)$ except a pair of opposites, which become $2$. This tetrahedron tiles 3-space.

The dual space, if you are seeking vertices etc, is x3x3o3o3z, which is the tiling of tetrahedra and truncated tetrahedra. This can be implemented as (a,b,c) and (a½, b½, c½), where a+b+c is even, alternately as (a+3,b+1,c-2,d-2) where a,b,c,d are multiples of 4 and the four coordinates add to zero.