Generated by DocFX

Class Plane

A plane is simply an origin point and normal.

Inheritance
System.Object
Plane
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Syntax
public class Plane : IGeometry<Plane>, IEquatable<Plane>, ITransformable<Plane>

Constructors

| Improve this Doc View Source

Plane()

Declaration
public Plane()
| Improve this Doc View Source

Plane(Plane)

Constructs a plane from another plane.

Declaration
public Plane(Plane plane)
Parameters
Type Name Description
Plane plane

Input plane.

| Improve this Doc View Source

Plane(Point3, Point3, Point3)

Constructs a plane from three non-collinear points.

Declaration
public Plane(Point3 pt1, Point3 pt2, Point3 pt3)
Parameters
Type Name Description
Point3 pt1

Firs point representing the origin.

Point3 pt2

Second point representing the x direction.

Point3 pt3

Third point representing the y direction.

| Improve this Doc View Source

Plane(Point3, Vector3)

Constructs a plane from a origin and a direction.

Declaration
public Plane(Point3 origin, Vector3 direction)
Parameters
Type Name Description
Point3 origin

The point describing the origin of the plane.

Vector3 direction

The vector representing the normal of the plane.

| Improve this Doc View Source

Plane(Point3, Vector3, Vector3)

Constructs a plane from an point and two directions.

Declaration
public Plane(Point3 origin, Vector3 xDirection, Vector3 yDirection)
Parameters
Type Name Description
Point3 origin

Point representing the origin.

Vector3 xDirection

X direction.

Vector3 yDirection

Y direction.

Properties

| Improve this Doc View Source

IsValid

Returns true if origin and axis vectors are valid and orthogonal.

Declaration
public bool IsValid { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Origin

Gets the origin of the plane.

Declaration
public Point3 Origin { get; set; }
Property Value
Type Description
Point3
| Improve this Doc View Source

PlaneXY

Gets a XY plane.

Declaration
public static Plane PlaneXY { get; }
Property Value
Type Description
Plane
| Improve this Doc View Source

PlaneYZ

Gets a YZ plane.

Declaration
public static Plane PlaneYZ { get; }
Property Value
Type Description
Plane
| Improve this Doc View Source

PlaneZX

Gets a XY plane.

Declaration
public static Plane PlaneZX { get; }
Property Value
Type Description
Plane
| Improve this Doc View Source

Unset

Gets a plane whose components are Unset.

Declaration
public static Plane Unset { get; }
Property Value
Type Description
Plane
| Improve this Doc View Source

XAxis

Gets the XAxis of the plane.

Declaration
public Vector3 XAxis { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

YAxis

Gets the YAxis of the plane.

Declaration
public Vector3 YAxis { get; set; }
Property Value
Type Description
Vector3
| Improve this Doc View Source

ZAxis

Gets the normal of the plane.

Declaration
public Vector3 ZAxis { get; }
Property Value
Type Description
Vector3

Methods

| Improve this Doc View Source

Align(Vector3)

Performs the rotation to align the XAxis of a plane to a given guide vector.

Declaration
public Plane Align(Vector3 direction)
Parameters
Type Name Description
Vector3 direction

The guide vector.

Returns
Type Description
Plane

The rotated plane (in radians) with XAxis align to the guide vector.

| Improve this Doc View Source

ClosestParameters(Point3)

Calculates the parameters of a point on the plane closest to the test point.

Declaration
public (double u, double v) ClosestParameters(Point3 pt)
Parameters
Type Name Description
Point3 pt

Test point, the point to get close to.

Returns
Type Description
System.ValueTuple<System.Double, System.Double>

The u parameter is along X-direction and v parameter is along the Y-direction.

| Improve this Doc View Source

ClosestPoint(Vector3, out Double)

Finds the closest point on a plane. https://www.parametriczoo.com/index.php/2020/02/29/signed-distance-of-a-point-from-a-plane/

Declaration
public Point3 ClosestPoint(Vector3 pt, out double distance)
Parameters
Type Name Description
Vector3 pt

The point to test.

System.Double distance

The signed distance of point from the plane. If the point is above the plane (positive side) the result is positive, if the point is below the result is negative.

Returns
Type Description
Point3

The point on the plane that is closest to the sample point.

| Improve this Doc View Source

Equals(Plane)

Returns a boolean indicating whether the given Plane is equal to this Plane instance.
The plane are equals if they have same origin and axises.

Declaration
public bool Equals(Plane other)
Parameters
Type Name Description
Plane other

The Plane to compare this instance to.

Returns
Type Description
System.Boolean

True if the other Plane is equal to this instance; False otherwise.

| Improve this Doc View Source

FitPlane(IList<Point3>, out Double)

Fits a plane through a set of points. http://www.ilikebigbits.com/2015_03_04_plane_from_points.html

Declaration
public static Plane FitPlane(IList<Point3> pts, out double deviation)
Parameters
Type Name Description
System.Collections.Generic.IList<Point3> pts

Points to fit.

System.Double deviation

Maximum deviation between the points and the plane.

Returns
Type Description
Plane

The defined plane generated.

| Improve this Doc View Source

Flip()

Flip plane by swapping X and Y axes.

Declaration
public Plane Flip()
Returns
Type Description
Plane

The flipped plane.

| Improve this Doc View Source

GetHashCode()

Returns the hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

The hash code of the plane.

Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

PointAt(Double, Double)

Evaluates a point on the plane.

Declaration
public Point3 PointAt(double u, double v)
Parameters
Type Name Description
System.Double u

Evaluation parameter.

System.Double v

Evaluation parameter.

Returns
Type Description
Point3

The evaluated point.

| Improve this Doc View Source

Rotate(Double)

Rotates the plane around is own Z-axis.

Declaration
public Plane Rotate(double radiansAngle)
Parameters
Type Name Description
System.Double radiansAngle

Angle to rotate the plane, expressed in radians.

Returns
Type Description
Plane

The plan rotated.

| Improve this Doc View Source

SetOrigin(Point3)

Changes the origin of a plane.

Declaration
public Plane SetOrigin(Point3 origin)
Parameters
Type Name Description
Point3 origin

The new origin point of a plane.

Returns
Type Description
Plane

The plane with the new origin.

| Improve this Doc View Source

ToString()

Translate a plane into a readable format.

Declaration
public override string ToString()
Returns
Type Description
System.String

The text format of a plane.

Overrides
System.Object.ToString()
| Improve this Doc View Source

Transform(TransformMatrix)

Transforms the plane by a transformation matrix.

Declaration
public Plane Transform(TransformMatrix t)
Parameters
Type Name Description
TransformMatrix t

The transformation matrix to apply to the plane.

Returns
Type Description
Plane

The transformed plane.

Implements

IGeometry<T>
System.IEquatable<T>
ITransformable<T>