How to detect if a tetrahedron has a flat-like shape

96 Views Asked by At

Creating tetrahedra

I have this OpenSCAD code that creates tetrahedra by getting its points:

points = [
    [ -2.0122000217437757, -3.421492767333985, 0.7705124013125892 ],
    [ -2.0122000217437757, -1.663867092132569, 0.7705124013125892 ],
    [ -3.7698256969451918, -1.663867092132569, 0.7705124013125892 ],
    [ -3.7698256969451918, -3.421492767333985, 2.5281380765140056 ],
];

polyhedron(points = points, faces = [ [ 0, 1, 2 ], [ 0, 2, 3 ], [ 0, 3, 1 ], [ 1, 2, 3 ] ]);

A normal tetrahedron is like this:

Normal tetrahedron

Flat-like tetrahedron

Sometimes the created tetrahedron has a flat-like shape. Like this case:

points = [
    [ -3.7698256969451918, -2.149131520738902, 0.7705124013125892 ],
    [ -4.1405207892279385, -3.421492767333985, 2.5281380765140056 ],
    [ -3.7698256969451918, -3.421492767333985, 1.8517894984488612 ],
    [ -5.133763843782198, -1.663867092132569, 2.5281380765140056 ],
];

Flat tetrahedron

Question

What is the mathematics to check if flatness of a tetrahedron is larger than a certain threshold? CalculiX solver documentation mentions using of maximum ratio of Jacobian determinants. However I don't know how to actually compute it. Is there any simple mathematical approach?

Documentation

Update: trying the solution

I just tried the solution provided by @Cesareo . It even works reliably for a very tiny tetrahedron like below whose volume is 0.0006922827322921379 i.e. very small, but it doesn't have a flat shape:

points = [
    [3.15082539916039, 1.082423025369646, 0.10059582768553593],
    [3.370528608560567, 1.082423025369646, 0.12474012629469303],
    [3.370528608560567, 1.302126234769823, 0.2107923202216621],
    [3.370528608560567, 1.082423025369646, 0.2107923202216621],
];

The above points create this tetrahedron that is not flat but its volume is 0.0006922827322921379 i.e. extremely small :

Screenshot of tiny tetrahedron that is not flat

1

There are 1 best solutions below

3
On BEST ANSWER

There are many ways to verify the flatness for a tetrahedron. Ones more computational costly than others. One of simple application is associated to the tetrahedron volume. A flat tetrahedron has low volume. The formula is quite simple. Given the tetrahedron $[A,B,C.D]$ we have

$$ V = |\frac 16\left(\vec{AB}\times \vec{AC}\right)\cdot\vec{AD}| $$

for the two examples presented in the question, the volumes are respectively

$0.904957$ (non flat) and $0.025041$ (flat).

Attached a MATHEMATICA script including a normalizing factor to cope with scales. The volume is divided by the possible maximum possible volume, so the measure factor is

$$ \rho_V = 80\frac{|\left(\vec{AB}\times \vec{AC}\right)\cdot\vec{AD}|}{(|\vec{AB}|+|\vec{CD}|)(|\vec{AC}|+|\vec{BD}|)(|\vec{AD}|+|\vec{BC}|)} $$

now if $\rho_V \lt 1$ the tetrahedron is considered flat.

    points = RandomReal[{-1, 1}, {4, 3}];
    Graphics3D[Tetrahedron[points], AspectRatio -> 1]
    ab = points[[2]] - points[[1]];
    ac = points[[3]] - points[[1]];
    ad = points[[4]] - points[[1]];
    nab = Norm[ab];
    ncd = Norm[ac - ad];
    nbd = Norm[ab - ad];
    nbc = Norm[ab - ac];
    nac = Norm[ac];
    nad = Norm[ad];
    Abs[80 Cross[ab, ac].ad]/((nab + ncd) (nac + nbd) (nad + nbc))