Method TryExpand
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
TryExpand(double, out GeoObb3)
Grows the box by a margin on every side, or shrinks it by a negative one.
public bool TryExpand(double margin, out GeoObb3 result)
Parameters
margindoubleHow far to move every face outwards; negative moves them inwards.
resultGeoObb3The grown box, or this one where the margin shrank it past nothing.
Returns
- bool
true when a box came back; otherwise, false.
Remarks
The box keeps its axes — every face moves along its own normal, so the corners stay square and the result is exact rather than a re-fit. There is no tolerance in it, and so no overload taking one.
It draws the line exactly where its square twin Expand(double) draws it: a margin that takes a side to nothing gives a box with that side flat, which IsDegenerate() will say, and only a margin that would take a side past nothing is refused. Ask for the box you want and check, rather than reading false as "it got thin".