meshing.bounds.fit_bounds

meshing.bounds.fit_bounds(sdf, padding=0.0)

(origin, size) of a box around the part, found at its own scale.

Parameters

Name Type Description Default
sdf Callable The field, mapping (n, 3) points to (n,) values. required
padding float Extra margin per side, in model units, on top of the one and a half fine-scan cells every fit carries. 0.0

Returns

Name Type Description
tuple[float, float, float] The lower corner and the extent, ready for
tuple[float, float, float] meth:~cadjoint.meshing.GridSpec.from_bounds.

Raises

Name Type Description
ValueError When no cube up to half-width SCAN_HALF_WIDTHS[-1] holds a closed part: the object is empty, or unbounded (an infinite plane, a missing intersection) and needs explicit bounds.