Manifold 1.0
Robust computational geometry
 
Loading...
Searching...
No Matches
Core

The central classes of the library. More...

Classes

class  CrossSection
 
class  Manifold
 
class  Quality
 

Enumerations

enum class  OpType { Add , Subtract , Intersect }
 

Functions

Mesh LevelSet (std::function< float(glm::vec3)> sdf, Box bounds, float edgeLength, float level=0, bool canParallel=true)
 

Detailed Description

The central classes of the library.

Enumeration Type Documentation

◆ OpType

enum class OpType
strong

Boolean operation type: Add (Union), Subtract (Difference), and Intersect.

Function Documentation

◆ LevelSet()

Mesh LevelSet ( std::function< float(glm::vec3)>  sdf,
Box  bounds,
float  edgeLength,
float  level,
bool  canParallel 
)

Constructs a level-set Mesh from the input Signed-Distance Function (SDF). This uses a form of Marching Tetrahedra (akin to Marching Cubes, but better for manifoldness). Instead of using a cubic grid, it uses a body-centered cubic grid (two shifted cubic grids). This means if your function's interior exceeds the given bounds, you will see a kind of egg-crate shape closing off the manifold, which is due to the underlying grid.

Parameters
sdfThe signed-distance functor, containing this function signature: float operator()(glm::vec3 point), which returns the signed distance of a given point in R^3. Positive values are inside, negative outside.
boundsAn axis-aligned box that defines the extent of the grid.
edgeLengthApproximate maximum edge length of the triangles in the final result. This affects grid spacing, and hence has a strong effect on performance.
levelYou can inset your Mesh by using a positive value, or outset it with a negative value.
canParallelParallel policies violate will crash language runtimes with runtime locks that expect to not be called back by unregistered threads. This allows bindings use LevelSet despite being compiled with MANIFOLD_PAR active.
Returns
Mesh This class does not depend on Manifold, so it just returns a Mesh, but it is guaranteed to be manifold and so can always be used as input to the Manifold constructor for further operations.