Plane
References[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 128)]
[Serializable]
public struct Plane : IEquatable<Plane>, IEpsilonComparable<Plane>, ICloneable, IFormattable
Represents the value of a center point and two axes in a plane in three dimensions.
Constructors
Constructs a plane from an equation Ax+By+Cz+D=0.
Initializes a plane from three non-collinear points.
Constructs a plane from a point and a normal vector.
See Also:
Constructs a plane from a point and two vectors in the plane.
Properties
Gets a value indicating whether or not this is a valid plane. A plane is considered to be valid when all fields contain reasonable information and the equation jibes with point and z-axis.
Gets the normal of this plane. This is essentially the ZAxis of the plane.
Gets or sets the X coordinate of the origin of this plane.
Gets or sets the Y coordinate of the origin of this plane.
Gets or sets the Z coordinate of the origin of this plane.
Gets a plane that contains Unset origin and axis vectors.
Methods
Returns a deep copy of this instance.
Returns: A plane with the same values as this item.
Gets the parameters of the point on the plane closest to a test point.
Returns: true if a parameter could be found, false if the point could not be projected successfully.
Gets the point on the plane closest to a test point.
Returns: The point on the plane that is closest to testPoint, or Point3d.Unset on failure.
Constructs a plane from a point, and two vectors in the plane.
public static Plane CreateFromFrame()
origin,
Point on the plane.
xDirection,
Non-zero vector in the plane that determines the XAxis direction.
yDirection
Non-zero vector not parallel to xDirection that is used to determine the YAxis direction. Note, yDirection does not have to be perpendicular to xDirection.
Returns: A valid plane if successful, or Plane.Unset on failure.
Constructs a plane from a point and normal vector.
Returns: A valid plane if successful, or Plane.Unset on failure.
Construct a plane from a point, a normal vector, and a vector that projects to the positive YAxis.
Returns: A valid plane if successful, or Plane.Unset on failure.
Construct a plane from three non-collinear points.
Returns: A valid plane if successful, or Plane.Unset on failure.
Returns the signed minimum and maximum distances from bounding box to this plane.
Returns: false if plane has zero length normal
Returns the signed distance from testPoint to its projection onto this plane. If the point is below the plane, a negative distance is returned.
Returns: Signed distance from this plane to testPoint.
Check that all values in other are within epsilon of the values in this
Implements: EpsilonEquals
Equals
#Determines if an object is a plane and has the same components as this plane.
Returns: true if obj is a plane and has the same components as this plane; false otherwise.
Overrides: ValueType.Equals
Determines if another plane has the same components as this plane.
Returns: true if plane has the same components as this plane; false otherwise.
Extends this plane through a bounding box.
public bool ExtendThroughBox()
box,
A box to use as minimal extension boundary.
out Interval
s,
If this function returns true, the s parameter returns the Interval on the plane along the X direction that will encompass the Box.
out Interval
t
If this function returns true, the t parameter returns the Interval on the plane along the Y direction that will encompass the Box.
Returns: true on success, false on failure.
Extend this plane through a Box.
public bool ExtendThroughBox()
box,
A box to use for extension.
out Interval
s,
If this function returns true, the s parameter returns the Interval on the plane along the X direction that will encompass the Box.
out Interval
t
If this function returns true, the t parameter returns the Interval on the plane along the Y direction that will encompass the Box.
Returns: true on success, false on failure.
Fit a plane through a collection of points.
public static PlaneFitResult FitPlaneToPoints()
points,
Points to fit to.
out Plane
plane,
Resulting plane.
out double
maximumDeviation
The distance from the furthest point to the plane.
Returns: A value indicating the result of the operation.
Fit a plane through a collection of points.
Returns: A value indicating the result of the operation.
Flip this plane by swapping out the X and Y axes and inverting the Z axis.
public void Flip()
GetHashCode
#Gets a non-unique hashing code for this entity.
Returns: A particular number for a specific instance of plane.
Overrides: ValueType.GetHashCode
Gets the plane equation for this plane in the format of Ax+By+Cz+D=0.
Returns: Array of four values.
Test if this plane is co-planar with a another plane.
Returns: True if this plane is co-planar with the test plane, false otherwise.
Test if this plane is co-planar with a another plane.
Returns: True if this plane is co-planar with the test plane, false otherwise.
Evaluate a point on the plane.
Returns: plane.origin + u*plane.xaxis + v*plane.yaxis + z*plane.zaxis.
Evaluate a point on the plane.
Returns: plane.origin + u*plane.xaxis + v*plane.yaxis.
Convert a point from World space coordinates into Plane space coordinates.
Remarks: D stands for distance, not disease.
Returns: true on success, false on failure.
Rotate the plane about a custom anchor point.
Returns: true on success, false on failure.
Rotate the plane about its origin point.
Returns: true on success, false on failure.
Rotate the plane about a custom anchor point.
Returns: true on success, false on failure.
Rotate the plane about its origin point.
Returns: true on success, false on failure.
ToString
#Constructs the string representation of this plane.
Returns: Text.
Overrides: ValueType.ToString
Formats the value of the current instance using the specified format.
public string ToString()
format,
The format to use. -or- A null reference (
Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProvider
The provider to use to format the value. -or- A null reference (
Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.Returns: The value of the current instance in the specified format.
Transform the plane with a Transformation matrix.
Returns: true on success, false on failure.
Translate (move) the plane along a vector.
Returns: true on success, false on failure.