Class Pointcloud
- Namespace
- MathAssertions.Geometry3D
- Assembly
- MathAssertions.dll
Aggregate predicates over a ReadOnlySpan<T> of Vector3:
boundedness, centroid, and "approximately on a known surface" checks. Each helper is
an extension method for natural call-site syntax (cloud.IsBoundedBy(box),
cloud.HasCentroidAt(expected, tolerance)).
public static class Pointcloud
- Inheritance
-
Pointcloud
- Inherited Members
Methods
HasCentroidAt(ReadOnlySpan<Vector3>, Vector3, double)
Returns true when the arithmetic centroid of
cloud is within tolerance of
expected component-wise. The empty cloud has no centroid and
returns false.
public static bool HasCentroidAt(this ReadOnlySpan<Vector3> cloud, Vector3 expected, double tolerance)
Parameters
cloudReadOnlySpan<Vector3>Point cloud.
expectedVector3Expected centroid.
tolerancedoubleMaximum allowed absolute difference per component. Must be non-negative and not NaN.
Returns
Exceptions
- ArgumentOutOfRangeException
toleranceis NaN or negative.
IsApproximatelyOnPlane(ReadOnlySpan<Vector3>, Plane, double)
Returns true when every point in cloud lies
within maxResidual perpendicular distance of
plane. The empty cloud is vacuously on the plane.
public static bool IsApproximatelyOnPlane(this ReadOnlySpan<Vector3> cloud, Plane plane, double maxResidual)
Parameters
cloudReadOnlySpan<Vector3>Point cloud.
planePlaneReference plane (assumes unit-length normal, the standard CreateFromVertices(Vector3, Vector3, Vector3) convention).
maxResidualdoubleMaximum allowed perpendicular distance from the plane. Must be non-negative and not NaN.
Returns
Exceptions
- ArgumentOutOfRangeException
maxResidualis NaN or negative.
IsApproximatelyOnSphere(ReadOnlySpan<Vector3>, Vector3, float, double)
Returns true when every point in cloud lies
within maxResidual radial distance of the sphere defined by
center and radius: the absolute difference
between point-to-center distance and the radius is bounded by the residual. The
empty cloud is vacuously on the sphere.
public static bool IsApproximatelyOnSphere(this ReadOnlySpan<Vector3> cloud, Vector3 center, float radius, double maxResidual)
Parameters
cloudReadOnlySpan<Vector3>Point cloud.
centerVector3Sphere center.
radiusfloatSphere radius.
maxResidualdoubleMaximum allowed radial deviation. Must be non-negative and not NaN.
Returns
Exceptions
- ArgumentOutOfRangeException
maxResidualis NaN or negative.
IsBoundedBy(ReadOnlySpan<Vector3>, AxisAlignedBox)
Returns true when every point in cloud lies
inside (or on the boundary of) box. The empty cloud is
vacuously bounded.
public static bool IsBoundedBy(this ReadOnlySpan<Vector3> cloud, AxisAlignedBox box)
Parameters
cloudReadOnlySpan<Vector3>boxAxisAlignedBox
Returns
IsBoundedBy(ReadOnlySpan<Vector3>, Sphere)
Returns true when every point in cloud lies
inside (or on the boundary of) sphere. The empty cloud is
vacuously bounded.
public static bool IsBoundedBy(this ReadOnlySpan<Vector3> cloud, Sphere sphere)
Parameters
cloudReadOnlySpan<Vector3>sphereSphere