Triangulation of SDFs to efficiently transfer SDFs into BufferGeometry.
All primitives are generated with the functions ported from GLSL to PHP or JavaScript as SDF. A slightly modified triangulation algorithm (original according to E. Hartmann, see https://www2.mathematik.tu-darmstadt.de/~ehartmann/cdgen0104.pdf page 81 ) is then applied to these SDFs.
In the post Triangulation of SDFs you can see some initial examples of SDF geometries and meshes.
The BETA version of the tool at SDFGeometry now generates SDF geometries based on certain primitives and operations.
{
"Settings": { "tsl": 0.03 },
"Box": { "type": "box", "whd": { "x": 1.2, "y": 0.75, "z": 1.2 } },
"Displ": { "type": "displace", "op": "Box", "func": "sinXYZ", "d": 0.1, "f": 3 }
}
The geometries can be downloaded as three.js BufferGeometry definitions or GLTF meshes.
The currently available SDF primitives and operations with their parameters:
A still incomplete help with examples,
see https://hofk.de/SDFGeometry/Generation_of_SDFGeometry_EN.pdf
Some examples as a picture. More with JSON input in the help.
I would be grateful for any useful hints and suggestions for further development.