SPH
Public Member Functions | List of all members
MarchingCubes Class Reference

Marching cubes algorithm for generation of mesh from iso-surface of given scalar field. More...

#include <MarchingCubes.h>

Public Member Functions

 MarchingCubes (IScheduler &scheduler, const Float surfaceLevel, const SharedPtr< IScalarField > &field, Function< bool(Float progress)> progressCallback=nullptr)
 Constructs the object using given scalar field. More...
 
void addComponent (const Box &box, const Float gridResolution)
 Adds a triangle mesh representing the boundary of particles. More...
 
INLINE Array< Triangle > & getTriangles () &
 Returns the generated triangles. More...
 
INLINE Array< TrianglegetTriangles () &&
 Returns the generated triangles. More...
 

Detailed Description

Marching cubes algorithm for generation of mesh from iso-surface of given scalar field.

Definition at line 39 of file MarchingCubes.h.

Constructor & Destructor Documentation

◆ MarchingCubes()

MarchingCubes::MarchingCubes ( IScheduler scheduler,
const Float  surfaceLevel,
const SharedPtr< IScalarField > &  field,
Function< bool(Float progress)>  progressCallback = nullptr 
)

Constructs the object using given scalar field.

Parameters
schedulerScheduler used for parallelization
surfaceLevelDefines of the boundary of SPH particle as implicit function \( {\rm Boundary} = \Phi(\vec r) - {\rm surfaceLevel}\), where \(\Phi\) is the scalar field.
fieldScalar field used to generate the surface.

Definition at line 329 of file MarchingCubes.cpp.

Member Function Documentation

◆ addComponent()

void MarchingCubes::addComponent ( const Box box,
const Float  gridResolution 
)

Adds a triangle mesh representing the boundary of particles.

Particles are specified by the given bounding box. The generated mesh is added into the internal triangle buffer.

Parameters
boxSelected bounding box
gridResolutionAbsolute size of the grid

Definition at line 338 of file MarchingCubes.cpp.

◆ getTriangles() [1/2]

INLINE Array<Triangle>& MarchingCubes::getTriangles ( ) &
inline

Returns the generated triangles.

Definition at line 84 of file MarchingCubes.h.

◆ getTriangles() [2/2]

INLINE Array<Triangle> MarchingCubes::getTriangles ( ) &&
inline

Returns the generated triangles.

Definition at line 89 of file MarchingCubes.h.

Member Data Documentation

◆ phi

Array<Float> MarchingCubes::phi

Values of the scalar field defining the surface.

Definition at line 55 of file MarchingCubes.h.


The documentation for this class was generated from the following files: