[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

Plane

#Since v5.0
public Plane(double a, double b, double c, double d)
Constructs a plane from an equation Ax+By+Cz+D=0.
a (double)
b (double)
c (double)
d (double)

Plane

#Since v5.0
public Plane(Plane other)
Copy constructor.
other (Plane)The source plane value.

Plane

#ExampleSince v5.0
public Plane(Point3d origin, Point3d xPoint, Point3d yPoint)
Initializes a plane from three non-collinear points.
origin (Point3d)Origin point of the plane.
xPoint (Point3d)Second point in the plane. The x-axis will be parallel to x_point-origin.
yPoint (Point3d)Third point on the plane that is not collinear with the first two points. taxis*(y_point-origin) will be > 0.

Plane

#ExampleSince v5.0
public Plane(Point3d origin, Vector3d normal)
Constructs a plane from a point and a normal vector.
origin (Point3d)Origin point of the plane.
normal (Vector3d)Non-zero normal to the plane.

Plane

#Since v5.0
public Plane(Point3d origin, Vector3d xDirection, Vector3d yDirection)
Constructs a plane from a point and two vectors in the plane.
origin (Point3d)Origin point of the plane.
xDirection (Vector3d)Non-zero vector in the plane that determines the x-axis direction.
yDirection (Vector3d)Non-zero vector not parallel to x_dir that is used to determine the y-axis direction. y_dir does not need to be perpendicular to x_dir.

Properties

IsValid

#Since v5.0
public bool IsValid { get; }
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.

Normal

#Since v5.0
public Vector3d Normal { get; }
Gets the normal of this plane. This is essentially the ZAxis of the plane.

Origin

#Since v5.0
public Point3d Origin { get; set; }
Gets or sets the origin point of this plane.

OriginX

#Since v5.0
public double OriginX { get; set; }
Gets or sets the X coordinate of the origin of this plane.

OriginY

#Since v5.0
public double OriginY { get; set; }
Gets or sets the Y coordinate of the origin of this plane.

OriginZ

#Since v5.0
public double OriginZ { get; set; }
Gets or sets the Z coordinate of the origin of this plane.

Unset

#Since v5.0
public static Plane Unset { get; }
Gets a plane that contains Unset origin and axis vectors.

WorldXY

#Since v5.0
public static Plane WorldXY { get; }
plane coincident with the World XY plane.

WorldYZ

#Since v5.0
public static Plane WorldYZ { get; }
plane coincident with the World YZ plane.

WorldZX

#Since v5.0
public static Plane WorldZX { get; }
plane coincident with the World ZX plane.

XAxis

#Since v5.0
public Vector3d XAxis { get; set; }
Gets or sets the X axis vector of this plane.

YAxis

#Since v5.0
public Vector3d YAxis { get; set; }
Gets or sets the Y axis vector of this plane.

ZAxis

#Since v5.0
public Vector3d ZAxis { get; set; }
Gets or sets the Z axis vector of this plane.

Methods

Clone

#Since v6.0
public Plane Clone()
Returns a deep copy of this instance.
A plane with the same values as this item.

ClosestParameter

#ExampleSince v5.0
[ConstOperation] public bool ClosestParameter(Point3d testPoint, out double s, out double t)
Gets the parameters of the point on the plane closest to a test point.
testPoint (Point3d)Point to get close to.
s (out double)Parameter along plane X-direction.
t (out double)Parameter along plane Y-direction.
true if a parameter could be found, false if the point could not be projected successfully.

ClosestPoint

#Since v5.0
[ConstOperation] public Point3d ClosestPoint(Point3d testPoint)
Gets the point on the plane closest to a test point.
testPoint (Point3d)Point to get close to.
The point on the plane that is closest to testPoint, or Point3d.Unset on failure.

CreateFromFrame

#Since v8.0
public static Plane CreateFromFrame(Point3d origin, Vector3d xDirection, Vector3d yDirection)
Constructs a plane from a point, and two vectors in the plane.
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.
A valid plane if successful, or Plane.Unset on failure.

CreateFromNormal

#Since v8.0
public static Plane CreateFromNormal(Point3d origin, Vector3d normal)
Constructs a plane from a point and normal vector.
origin (Point3d)Point on the plane.
normal (Vector3d)Non-zero normal to the plane.
A valid plane if successful, or Plane.Unset on failure.

CreateFromNormalYup

#Since v8.0
public static Plane CreateFromNormalYup(Point3d origin, Vector3d normal, Vector3d yDirection)
Construct a plane from a point, a normal vector, and a vector that projects to the positive YAxis.
origin (Point3d)Point on the plane.
normal (Vector3d)Non-zero normal to the plane.
yDirection (Vector3d)Non-zero vector, linearly independent from normal, that projects to the positive YAxis of the plane.
A valid plane if successful, or Plane.Unset on failure.

CreateFromPoints

#Since v8.0
public static Plane CreateFromPoints(Point3d origin, Point3d xPoint, Point3d yPoint)
Construct a plane from three non-collinear points.
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.
A valid plane if successful, or Plane.Unset on failure.

DistanceTo

#Since v6.0
[ConstOperation] public bool DistanceTo(BoundingBox bbox, out double min, out double max)
Returns the signed minimum and maximum distances from bounding box to this plane.
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
false if plane has zero length normal

DistanceTo

#ExampleSince v5.0
[ConstOperation] public double DistanceTo(Point3d testPoint)
Returns the signed distance from testPoint to its projection onto this plane. If the point is below the plane, a negative distance is returned.
testPoint (Point3d)Point to test.
Signed distance from this plane to testPoint.

EpsilonEquals

#Since v5.4
[ConstOperation] public bool EpsilonEquals(Plane other, double epsilon)
Check that all values in other are within epsilon of the values in this
other (Plane)
epsilon (double)
EpsilonEquals

Equals

#
public override bool Equals(object obj)
Determines if an object is a plane and has the same components as this plane.
obj (object)An object.
true if obj is a plane and has the same components as this plane; false otherwise.
ValueType.Equals

Equals

#Since v5.0
public bool Equals(Plane plane)
Determines if another plane has the same components as this plane.
plane (Plane)A plane.
true if plane has the same components as this plane; false otherwise.

ExtendThroughBox

#Since v5.0
public bool ExtendThroughBox(BoundingBox box, out Interval s, out Interval t)
Extends this plane through a bounding box.
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.
true on success, false on failure.

ExtendThroughBox

#Since v5.0
public bool ExtendThroughBox(Box box, out Interval s, out Interval t)
Extend this plane through a Box.
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.
true on success, false on failure.

FitPlaneToPoints

#Since v5.0
public static PlaneFitResult FitPlaneToPoints(IEnumerable<Point3d> points, out Plane plane, out double maximumDeviation)
Fit a plane through a collection of points.
points (IEnumerable<Point3d>)Points to fit to.
plane (out Plane)Resulting plane.
maximumDeviation (out double)The distance from the furthest point to the plane.
A value indicating the result of the operation.

FitPlaneToPoints

#Since v5.0
public static PlaneFitResult FitPlaneToPoints(IEnumerable<Point3d> points, out Plane plane)
Fit a plane through a collection of points.
points (IEnumerable<Point3d>)Points to fit to.
plane (out Plane)Resulting plane.
A value indicating the result of the operation.

Flip

#Since v5.0
public void Flip()
Flip this plane by swapping out the X and Y axes and inverting the Z axis.

GetHashCode

#
public override int GetHashCode()
Gets a non-unique hashing code for this entity.
A particular number for a specific instance of plane.

GetPlaneEquation

#Since v5.0
[ConstOperation] public double[] GetPlaneEquation()
Gets the plane equation for this plane in the format of Ax+By+Cz+D=0.
Array of four values.

IsCoplanar

#Since v8.0
public bool IsCoplanar(Plane plane, double tolerance)
Test if this plane is co-planar with a another plane.
plane (Plane)The plane to test.
tolerance (double)Testing tolerance.
True if this plane is co-planar with the test plane, false otherwise.

IsCoplanar

#Since v8.0
public bool IsCoplanar(Plane plane)
Test if this plane is co-planar with a another plane.
plane (Plane)The plane to test.
True if this plane is co-planar with the test plane, false otherwise.

PointAt

#Since v5.0
[ConstOperation] public Point3d PointAt(double u, double v, double w)
Evaluate a point on the plane.
u (double)evaluation parameter.
v (double)evaluation parameter.
w (double)evaluation parameter.
plane.origin + u*plane.xaxis + v*plane.yaxis + z*plane.zaxis.

PointAt

#Since v5.0
[ConstOperation] public Point3d PointAt(double u, double v)
Evaluate a point on the plane.
u (double)evaluation parameter.
v (double)evaluation parameter.
plane.origin + u*plane.xaxis + v*plane.yaxis.

RemapToPlaneSpace

#Since v5.0
[ConstOperation] public bool RemapToPlaneSpace(Point3d ptSample, out Point3d ptPlane)
Convert a point from World space coordinates into Plane space coordinates.
Remarks: D stands for distance, not disease.
ptSample (Point3d)World point to remap.
ptPlane (out Point3d)Point in plane (s,t,d) coordinates.
true on success, false on failure.

Rotate

#Since v5.0
public bool Rotate(double angle, Vector3d axis, Point3d centerOfRotation)
Rotate the plane about a custom anchor point.
angle (double)Angle in radians.
axis (Vector3d)Axis of rotation.
centerOfRotation (Point3d)Center of rotation.
true on success, false on failure.

Rotate

#Since v5.0
public bool Rotate(double angle, Vector3d axis)
Rotate the plane about its origin point.
angle (double)Angle in radians.
axis (Vector3d)Axis of rotation.
true on success, false on failure.

Rotate

#Since v5.0
public bool Rotate(double sinAngle, double cosAngle, Vector3d axis, Point3d centerOfRotation)
Rotate the plane about a custom anchor point.
sinAngle (double)Sin(angle)
cosAngle (double)Cos(angle)
axis (Vector3d)Axis of rotation.
centerOfRotation (Point3d)Center of rotation.
true on success, false on failure.

Rotate

#Since v5.0
public bool Rotate(double sinAngle, double cosAngle, Vector3d axis)
Rotate the plane about its origin point.
sinAngle (double)Sin(angle).
cosAngle (double)Cos(angle).
axis (Vector3d)Axis of rotation.
true on success, false on failure.
Explicit

ICloneable.Clone

#Since v6.0

ToString

#
public override string ToString()
Constructs the string representation of this plane.
Text.

ToString

#Since v7.0
public string ToString(string format, IFormatProvider formatProvider)
Formats the value of the current instance using the specified format.
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.
The value of the current instance in the specified format.

Transform

#Since v5.0
public bool Transform(Transform xform)
Transform the plane with a Transformation matrix.
xform (Transform)Transformation to apply to plane.
true on success, false on failure.

Translate

#Since v5.0
public bool Translate(Vector3d delta)
Translate (move) the plane along a vector.
delta (Vector3d)Translation (motion) vector.
true on success, false on failure.

UpdateEquation

#Since v6.0
public bool UpdateEquation()
Update Equations
bool

ValueAt

#Since v5.7
[ConstOperation] public double ValueAt(Point3d p)
Get the value of the plane equation at the point.
p (Point3d)evaluation point.
returns pe[0]*p.X + pe[1]*p.Y + pe[2]*p.Z + pe[3] where pe[0], pe[1], pe[2] and pe[3] are the coefficients of the plane equation.

Operators

OperationResultDescription
Plane==PlaneboolDetermines if two planes are equal.
Plane!=PlaneboolDetermines if two planes are different.