[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
Constructs a plane from an equation Ax+By+Cz+D=0.
public Plane()

Plane

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

Plane

#ExampleSince v5.0
Initializes a plane from three non-collinear points.
public Plane(
origin,
Origin point of the plane.
xPoint,
Second point in the plane. The x-axis will be parallel to x_point-origin.
yPoint
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
Constructs a plane from a point and a normal vector.
public Plane(
origin,
Origin point of the plane.
normal
Non-zero normal to the plane.
)

Plane

#Since v5.0
Constructs a plane from a point and two vectors in the plane.
public Plane(
origin,
Origin point of the plane.
xDirection,
Non-zero vector in the plane that determines the x-axis direction.
yDirection
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
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.
public bool IsValid { get; }

Normal

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

Origin

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

OriginX

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

OriginY

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

OriginZ

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

Unset

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

WorldXY

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

WorldYZ

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

WorldZX

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

XAxis

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

YAxis

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

ZAxis

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

Methods

Clone

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

ClosestParameter

#ExampleSince v5.0
Gets the parameters of the point on the plane closest to a test point.
[ConstOperation] public bool ClosestParameter(
testPoint,
Point to get close to.
out double
s,
Parameter along plane X-direction.
out double
t
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
Gets the point on the plane closest to a test point.
[ConstOperation] public Point3d ClosestPoint(
testPoint
Point to get close to.
)
The point on the plane that is closest to testPoint, or Point3d.Unset on failure.

CreateFromFrame

#Since v8.0
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.
)
A valid plane if successful, or Plane.Unset on failure.

CreateFromNormal

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

CreateFromNormalYup

#Since v8.0
Construct a plane from a point, a normal vector, and a vector that projects to the positive YAxis.
public static Plane CreateFromNormalYup(
origin,
Point on the plane.
normal,
Non-zero normal to the plane.
yDirection
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
Construct a plane from three non-collinear points.
public static Plane CreateFromPoints(
origin,
Point on the plane.
xPoint,
Second point in the plane. XAxis will be parallel to xPoint-origin.
yPoint
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
Returns the signed minimum and maximum distances from bounding box to this plane.
[ConstOperation] public bool DistanceTo(
bbox,
bounding box to get distances from
out double
min,
minimum signed distance from plane to box
out double
max
maximum signed distance from plane to box
)
false if plane has zero length normal

DistanceTo

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

EpsilonEquals

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

Equals

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

Equals

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

ExtendThroughBox

#Since v5.0
Extends this plane through a bounding box.
public bool ExtendThroughBox(
box,
A box to use as minimal extension boundary.
s,
If this function returns true, the s parameter returns the Interval on the plane along the X direction that will encompass the Box.
t
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
Extend this plane through a Box.
public bool ExtendThroughBox(
box,
A box to use for extension.
s,
If this function returns true, the s parameter returns the Interval on the plane along the X direction that will encompass the Box.
t
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
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.
)
A value indicating the result of the operation.

FitPlaneToPoints

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

Flip

#Since v5.0
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.
public override int GetHashCode()
A particular number for a specific instance of plane.

GetPlaneEquation

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

IsCoplanar

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

IsCoplanar

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

PointAt

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

PointAt

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

RemapToPlaneSpace

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

Rotate

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

Rotate

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

Rotate

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

Rotate

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

ICloneable.Clone

#Since v6.0

ToString

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

ToString

#Since v7.0
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.
)
The value of the current instance in the specified format.

Transform

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

Translate

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

UpdateEquation

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

ValueAt

#Since v5.7
Get the value of the plane equation at the point.
[ConstOperation] public double ValueAt(
p
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.