pub fn level_set<F>(
field: F,
bounds: Aabb,
edge_length: Scalar,
level: Scalar,
) -> Result<TriMesh, LevelSetError>Expand description
Extract the level set of a scalar field as a closed manifold mesh.
field is sampled on a regular grid spanning bounds. The surface is
where field equals level; the convention is that lower values are
inside, so triangle winding puts the outward normal toward higher
values.
The bounds are padded by one cell on every side and the field is forced to read as outside on that shell. Without it a surface reaching the edge of the bounds would be cut, leaving an open border – and the closedness guarantee would be false exactly when the caller’s bounds were tight.
§Errors
Refuses a non-positive edge length, empty or non-finite bounds, a non-finite level, a field that returns a non-finite sample, a grid over the sample budget, and a field that never crosses the level.