Method TryGetPlane
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
TryGetPlane(out GeoPlane3)
Tries to get the plane every vertex lies on, using the default tolerance.
public bool TryGetPlane(out GeoPlane3 plane)
Parameters
planeGeoPlane3
Returns
TryGetPlane(out GeoPlane3, Tolerance)
Tries to get the plane every vertex lies on, within a tolerance.
public bool TryGetPlane(out GeoPlane3 plane, Tolerance tolerance)
Parameters
planeGeoPlane3The carrier plane when the method returns true.
toleranceToleranceThe tolerance; the planar threshold decides how flat is flat enough.
Returns
- bool
false when the vertices are collinear or do not share a plane.
Remarks
Collinear vertices are refused rather than given an arbitrary plane through them: a straight chain lies on infinitely many planes and there is no ground for preferring one.
The plane is first read from the area the chain encloses when closed from its end back to its start, whose normal turns the way the chain runs. A flat chain enclosing no area, a Z or a symmetric zigzag, has its plane all the same: it is then laid through the first vertex, the vertex farthest from it and the vertex farthest from the line between those two, and its normal turns whichever way those three do. The Z through (0, 0, 2), (10, 0, 2), (0, 10, 2), (10, 10, 2) lies in z = 2.