public class MarchingSquare extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MarchingSquare.Winding |
Constructor and Description |
---|
MarchingSquare(float level,
Consumer<float[]> vertexEmiter)
The constructor takes a functional interface of type Consumer<float[]>.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateFaces(float[][] vals,
MarchingSquare.Winding winding)
It calculates the boundary and triangulates the area inside or larger than the given level.
|
void |
calculateLines(float[][] vals)
It calculates the boundary and emits the vertices forming line segments through the the
Consumer<float[]> vertexEmiter field.
|
public MarchingSquare(float level, Consumer<float[]> vertexEmiter)
level
- the level we want to use to define the boundaries.vertexEmiter
- possibly a lambda expresion for processing the verticespublic void calculateFaces(float[][] vals, MarchingSquare.Winding winding)
vals
- an 2D array of floats defining the 4 corners of the square to consider.winding
- either MarchingSquare.Winding.Clockwise or MarchingSquare.Winding.CounterClockwisepublic void calculateLines(float[][] vals)
vals
- an 2D array of floats defining the 4 corners of the square to consider.Processing Library voxellib by Pablo Miranda Carranza. (c) 2017