Module dmc::dmc[][src]

Contains the Dual Marching Cubes implementation, along with a function (mesh_from_octree) to interface with it.

Explanation

The goal here is to adapt the Marching Cubes algorithm to hashed octrees using Morton keys. The original Marching Cubes algorithm used an uniform grid to generate the final mesh. However, with this approach, we use the dual grid generated from the octree given. The dual grid is composed of vertices (One at the center of each leaf node) and edges, which connect vertices of adjacent leaves.

References

Refer to the comments at the start of src/lib.rs.

Structs

Mesh

A simple mesh type that holds a vector of vertices and another one of indices. This type is meant to be converted to your own mesh type via the std::convert::From trait.

Vertex

A 3D vertex that holds a position and a normal.

Traits

McNode

Provides the functions that a node must define to create a mesh out of a group of them.

Functions

mesh_from_octree

Creates a mesh from an octree full of values sampled from a Signed Distance Function (SDF). The triangles of the resulting mesh will be in counter-clockwise order.