API

[Function] marching-cubes

Extracts a surface from density field represented with density-function and returns triangles which is a list of triangles. density-function is a function that takes three arguments representing the position of a point and returns density as a scalar at the point. min-position and max-position are vec3 values and specify the minimun point and the maximun point of a grid to be processed. delta is a scalar that specifies the size of a cell in a grid to be processed. isolevel is a scalar that specifies the threshold of mesh construction.

[Function] marching-cubes-smooth

Same as marching-cubes except that marching-cubes-smooth returns a list of smooth triangles which have normal vectors at each vertex. normal-function is a function that takes three arguments representing the position of a point and returns a normal vector at the point. Other arguments are same as marching-cubes's.

Extracts a surface from density field represented with ‘density-function‘ and returns ‘triangles‘ which is a list of triangles. ‘density-function‘ is a function that takes three arguments representing the position of a point and returns density as a scalar at the point. ‘min-position‘ and ‘max-position‘ are ‘vec3‘ values and specify the minimun point and the maximun point of a grid to be processed. ‘delta‘ is a scalar that specifies the size of a cell in a grid to be processed. ‘isolevel‘ is a scalar that specifies the threshold of mesh construction.

Same as ‘marching-cubes‘ except that ‘marching-cubes-smooth‘ returns a list of smooth triangles which have normal vectors at each vertex. ‘normal-function‘ is a function that takes three arguments representing the position of a point and returns a normal vector at the point. Other arguments are same as ‘marching-cubes‘’s.