Antkeeper  0.0.1
Functions | Variables
geom::mc Namespace Reference

Marching cubes (MC) algorithm functions and constants. More...

Functions

void polygonize (float *vertices, std::uint8_t *vertex_count, std::int8_t *triangles, std::uint8_t *triangle_count, const float *corners, const float *distances)
 Uses the marching cubes algorithm to polygonize a single cell. More...
 

Variables

constexpr float unit_cube [8][3]
 Vertices of a unit cube. More...
 

Detailed Description

Marching cubes (MC) algorithm functions and constants.

Function Documentation

◆ polygonize()

void geom::mc::polygonize ( float *  vertices,
std::uint8_t *  vertex_count,
std::int8_t *  triangles,
std::uint8_t *  triangle_count,
const float *  corners,
const float *  distances 
)

Uses the marching cubes algorithm to polygonize a single cell.

Parameters
[out]verticesArray which can hold at least 12 vertices (36 floats).
[out]vertex_countNumber of generated vertices.
[out]trianglesArray which can hold 5 at least triangles (15 ints).
[out]triangle_countNumber of generated triangles. The maximum number triangles generated for a single cell is 5.

Definition at line 338 of file marching-cubes.cpp.

Variable Documentation

◆ unit_cube

constexpr float geom::mc::unit_cube[8][3]
constexpr
Initial value:
=
{
{0, 0, 0},
{1, 0, 0},
{1, 1, 0},
{0, 1, 0},
{0, 0, 1},
{1, 0, 1},
{1, 1, 1},
{0, 1, 1}
}

Vertices of a unit cube.

Definition at line 43 of file marching-cubes.hpp.