An open API service indexing awesome lists of open source software.

https://github.com/megidd/tetrahedron-table

A prerequisite for generating tetrahedra throughout the volume of a 3D model
https://github.com/megidd/tetrahedron-table

finite-element-analysis finite-elements

Last synced: 3 months ago
JSON representation

A prerequisite for generating tetrahedra throughout the volume of a 3D model

Awesome Lists containing this project

README

          

# Publication

A journal paper is being prepared based on this repository and that PR: https://github.com/deadsy/sdfx/pull/68

Its DOI will be available when ready.

# Input & output

Input is triangle table. Output is tetrahedron table. The output is filled out manually by going over all the cases from `0` to `255`.

# 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. Let's do it...

# Reference

https://github.com/deadsy/sdfx/pull/68#issuecomment-1447714965

# Node numbering

The node numbering follows the convention of CalculiX solver [documentation](http://www.dhondt.de/ccx_2.20.pdf). Like this:

![Screenshot_20230516_150126](https://github.com/Megidd/tetrahedron-table/assets/17475482/77ad0e34-3908-4c17-a8f6-ad0b7e31453b)

# Example

## Case 0

Case 0 is trivial. No cube corner has zero/negative value. No tetrahedron is generated.

## Case 1

Case 1 result is below. A cube corner has zero/negative value.

![Screenshot_20230516_150554](https://github.com/Megidd/tetrahedron-table/assets/17475482/e7541386-1d5f-48d5-ab0a-aabc7d133143)

## Case 2

![Screenshot_20230516_150614](https://github.com/Megidd/tetrahedron-table/assets/17475482/11ca2f44-6330-471c-867e-e049027cc012)

## Case 3

![Screenshot_20230516_150636](https://github.com/Megidd/tetrahedron-table/assets/17475482/d4fe71a4-91d5-458d-b224-086af1a55d64)

## Case 4

![Screenshot_20230516_150713](https://github.com/Megidd/tetrahedron-table/assets/17475482/58b949c4-a094-49fb-b2ca-6e40a9173aac)

## Case 5

![Screenshot_20230516_150731](https://github.com/Megidd/tetrahedron-table/assets/17475482/70fabcf7-eafc-4783-a149-d414746951cb)

## Case 6

![Screenshot_20230516_150759](https://github.com/Megidd/tetrahedron-table/assets/17475482/e21f6dc9-4a13-4c0a-9322-04729c1ef352)