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.
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.
Gets the point on the plane closest to a test point.
Parameters:
| testPoint (Point3d) | Point to get close to. |
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.
Parameters:
| origin (Point3d) | Point on the plane. |
| xDirection (Vector3d) | Non-zero vector in the plane that determines the XAxis direction. |
| yDirection (Vector3d) | 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.
Construct a plane from a point, a normal vector, and a vector that projects to the positive YAxis.
Construct a plane from three non-collinear points.
Parameters:
| origin (Point3d) | Point on the plane. |
| xPoint (Point3d) | Second point in the plane. XAxis will be parallel to xPoint-origin. |
| yPoint (Point3d) | Third point on the plane that is not collinear with the first two points, where YAxis*(yPoint-origin) will be > 0. |
Returns: A valid plane if successful, or Plane.Unset on failure.
Returns the signed minimum and maximum distances from bounding box to this plane.
Parameters:
| bbox (BoundingBox) | bounding box to get distances from |
| min (out double) | minimum signed distance from plane to box |
| max (out double) | maximum signed distance from plane to box |
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.
Parameters:
| testPoint (Point3d) | Point to test. |
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.
Parameters:
| obj (object) | An object. |
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.
Parameters:
| plane (Plane) | A plane. |
Returns: true if plane has the same components as this plane; false otherwise.
Extends this plane through a bounding box.
Parameters:
| box (BoundingBox) | A box to use as minimal extension boundary. |
| s (out Interval) | If this function returns true, the s parameter returns the Interval on the plane along the X direction that will encompass the Box. |
| t (out Interval) | 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.
Parameters:
| box (Box) | A box to use for extension. |
| s (out Interval) | If this function returns true, the s parameter returns the Interval on the plane along the X direction that will encompass the Box. |
| t (out Interval) | 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.
public static PlaneFitResult FitPlaneToPoints(IEnumerable<Point3d> points, out Plane plane, out double maximumDeviation)
Fit a plane through a collection of points.
Parameters:
| points (IEnumerable<Point3d>) | Points to fit to. |
| plane (out Plane) | Resulting plane. |
| maximumDeviation (out double) | 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.
Parameters:
| points (IEnumerable<Point3d>) | Points to fit to. |
| plane (out Plane) | Resulting plane. |
Returns: A value indicating the result of the operation.
public void Flip()
Flip this plane by swapping out the X and Y axes and inverting the Z axis.
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.
Test if this plane is co-planar with a another plane.
Parameters:
| plane (Plane) | The plane to test. |
Returns: True if this plane is co-planar with the test plane, false otherwise.
Evaluate a point on the plane.
Evaluate a point on the plane.
Convert a point from World space coordinates into Plane space coordinates.
Rotate the plane about a custom anchor point.
Rotate the plane about its origin point.
Rotate the plane about a custom anchor point.
Rotate the plane about its origin point.
ToString
#Constructs the string representation of this plane.
Returns: Text.
Overrides: ValueType.ToString
Formats the value of the current instance using the specified format.
Parameters:
| format (string) | 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 (IFormatProvider) | 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.
Parameters:
| xform (Transform) | Transformation to apply to plane. |
Returns: true on success, false on failure.
Translate (move) the plane along a vector.
Parameters:
| delta (Vector3d) | Translation (motion) vector. |
Returns: true on success, false on failure.