Click or drag to resize
AB4D logo

Plane Class

Plane struct defines a plane in form a*x + b*y + c*z + d = 0 or p*n + d = 0 (p is point; n is normal vector).
Inheritance Hierarchy
SystemObject
  Ab3d.UtilitiesPlane

Namespace: Ab3d.Utilities
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public class Plane

The Plane type exposes the following members.

Constructors
 NameDescription
Public methodPlane(Point3D, Vector3D) Creates plane one position on a plane an plane's normal.
Public methodPlane(Vector3D, Double) Creates plane one position on a plane an plane's normal.
Public methodPlane(Point3D, Point3D, Point3D) Creates plane from 3 positions. The orientation of normal is determined by counter-clockwise direction of positions. If positions lie on the same line, this constructor trows an ArgumentException. Use TryCreatePlane(Point3D, Point3D, Point3D) static method to avoid exception in this case.
Public methodPlane(Double, Double, Double, Double) Creates a plane in form a*x + b*y + c*z + d = 0 (note: when using the a*x + b*y + c*z = d; you need to flip sign for d)
Top
Properties
 NameDescription
Public propertyA Gets or sets value of the a variable in the plane with equation: a*x + b*y + c*z + d = 0 or p*n + d = 0. This is also the X component in the plane's normal value.
Public propertyB Gets or sets value of the b variable in the plane with equation: a*x + b*y + c*z + d = 0 or p*n + d = 0. This is also the Y component in the plane's normal value.
Public propertyC Gets or sets value of the v variable in the plane with equation: a*x + b*y + c*z + d = 0 or p*n + d = 0. This is also the Z component in the plane's normal value.
Public propertyD Gets or sets value of the d variable in the plane with equation: a*x + b*y + c*z + d = 0 or p*n + d = 0. The value determines the distance of the plane from the origin (0, 0, 0) in the normal's direction.
Public propertyNormal Gets normal vector of this plane. It is equal to (A, B, C) values.
Top
Methods
 NameDescription
Public methodClone Returns a clone of this Plane object.
Public methodFlip Flips sign all the components (a, b, c and d) of this plane. This makes the plane face into the other direction.
Public methodGetClosestPointOnPlane Returns a Point3D that lies on this plane is the closest to the specified position.
Public methodGetDirectionalLightShadowMatrix Creates a matrix that flattens a 3D mesh into a shadow mesh that lies on this plane and has zero height.
Public methodGetDistance Returns signed distance of the specified position from this Plane. If distance is positive, then position is in front of the plane (determined by the direction of the plane's normal). If distance is negative, then position is behind the plane. If distance is zero, then position lies on the plane.
Public methodGetIntersectionType(Point3D) Returns a PlanePlaneIntersectionType that describes where the specified position lie in relation to this Plane.
Public methodGetIntersectionType(Rect3D) Returns a PlanePlaneIntersectionType that describes where the specified bounds (as Rect3D) lie in relation to this Plane.
Public methodGetIntersectionType(ListPoint3D, Transform3D) Returns a PlanePlaneIntersectionType that describes where the specified positions lie in relation to this Plane.
Public methodGetIntersectionType(Point3D, Double) Returns a PlanePlaneIntersectionType that describes where the Sphere (specified by sphereCenter and sphereRadius) lies in relation to this Plane.
Public methodGetIntersectionType(Point3DCollection, Transform3D) Returns a PlanePlaneIntersectionType that describes where the specified positions lie in relation to this Plane.
Public methodGetIntersectionType(Rect3D, Transform3D) Returns a PlanePlaneIntersectionType that describes where the specified bounds (as Rect3D) lie in relation to this Plane.
Public methodGetPointLightShadowMatrix Creates a matrix that flattens a 3D mesh into a shadow mesh that lies on this plane and has zero height.
Public methodGetPointOnPlane Returns one point on the plane.
Public methodNormalize Changes the plane equation, such that the normal vector becomes a unit vector without changing the plane.
Public methodProject3DPointsToPlane Projects a list of 3D position into this 2D plane.
Public methodProject3DPointToPlane Projects a 3D position into this 2D plane.
Public methodRayPlaneIntersection(Point3D, Vector3D) Returns a Point3D that represents intersection position of this plane and ray defined by rayPoint and rayDirection.
Public methodRayPlaneIntersection(Point3D, Vector3D, Point3D) RayPlaneIntersection calculates a position where the ray intersects a plane. Returns false if there is no intersection (in case ray direction is the same as plane's normal).
Public methodStatic memberRayPlaneIntersection(Point3D, Vector3D, Point3D, Vector3D, Point3D) RayPlaneIntersection calculates a position where the ray intersects a plane. Returns false if there is no intersection (in case ray direction is the same as plane's normal).
Public methodSliceGeometryModel3D(GeometryModel3D, Transform3D) Slices the 3D model defined by GeometryModel3D with this Plane. If the geometryModel3D is fully in front of the Plane (in the direction of plane's Normal vector), then the same geometryModel3D is returned. If geometryModel3D intersects the plane, then a new sliced GeometryModel3D is returned. If geometryModel3D is in the back of the plane, then null is returned.
Public methodSliceGeometryModel3D(GeometryModel3D, GeometryModel3D, GeometryModel3D) Slices the 3D model defined by GeometryModel3D with this Plane and creates two new GeometryModel3D objects: one with model that are in front of the plane (in the direction of plane's Normal vector) and one with model in the back of the plane. If model is fully in front (or in back) of the Plane, the the same instance of GeometryModel3D is used. If the model intersects the Plane, it is sliced and new models are created from it.
Public methodSliceGeometryModel3D(GeometryModel3D, Transform3D, GeometryModel3D, GeometryModel3D) Slices the 3D model defined by GeometryModel3D with this Plane and creates two new GeometryModel3D objects: one with model that are in front of the plane (in the direction of plane's Normal vector) and one with model in the back of the plane. If model is fully in front (or in back) of the Plane, the the same instance of GeometryModel3D is used. If the model intersects the Plane, it is sliced and new models are created from it.
Public methodSliceMeshGeometry3D(MeshGeometry3D, Transform3D) Slices the MeshGeometry3D with this Plane. If the meshGeometry3D is fully in front of the Plane (in the direction of plane's Normal vector), then the same meshGeometry3D is returned. If meshGeometry3D intersects the plane, then a new sliced MeshGeometry3D is returned. If meshGeometry3D is in the back of the plane, then null is returned.
Public methodSliceMeshGeometry3D(MeshGeometry3D, MeshGeometry3D, MeshGeometry3D) Slices the MeshGeometry3D with this Plane and creates two new MeshGeometry3D objects: one with MeshGeometry3D that are in front of the plane (in the direction of plane's Normal vector) and one with MeshGeometry3D in the back of the plane. If MeshGeometry3D is fully in front (or in back) of the Plane, the the same instance of MeshGeometry3D is used. If the MeshGeometry3D intersects the Plane, it is sliced and new MeshGeometry3D objects are created from it.
Public methodSliceMeshGeometry3D(MeshGeometry3D, Transform3D, MeshGeometry3D, MeshGeometry3D) Slices the MeshGeometry3D with this Plane and creates two new MeshGeometry3D objects: one with MeshGeometry3D that are in front of the plane (in the direction of plane's Normal vector) and one with MeshGeometry3D in the back of the plane. If MeshGeometry3D is fully in front (or in back) of the Plane, the the same instance of MeshGeometry3D is used. If the MeshGeometry3D intersects the Plane, it is sliced and new MeshGeometry3D objects are created from it.
Public methodSliceModel3D(Model3D, Transform3D) Slices the 3D models defined by model3D (GeometryModel3D or Model3DGroup) with this Plane and returns a new ModelVisual3D with models that are in front of the plane (in the direction of plane's Normal vector). The models that are fully in front of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Public methodSliceModel3D(Model3D, Model3D, Model3D) Slices the 3D models defined by model3D (GeometryModel3D or Model3DGroup) with this Plane and creates two new Model3D objects: one with models that are in front of the plane (in the direction of plane's Normal vector) and one with models in the back of the plane. The models that are fully in front (or in back) of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Public methodSliceModel3D(Model3D, Transform3D, Model3D, Model3D) Slices the 3D models defined by model3D (GeometryModel3D or Model3DGroup) with this Plane and creates two new Model3D objects: one with models that are in front of the plane (in the direction of plane's Normal vector) and one with models in the back of the plane. The models that are fully in front (or in back) of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Public methodSliceModel3DGroup(Model3DGroup, Transform3D) Slices the 3D models defined by Model3DGroup with this Plane and returns a new Model3DGroup with models that are in front of the plane (in the direction of plane's Normal vector). The models that are fully in front of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Public methodSliceModel3DGroup(Model3DGroup, Model3DGroup, Model3DGroup) Slices the 3D models defined by Model3DGroup with this Plane and creates two new Model3DGroup objects: one with models that are in front of the plane (in the direction of plane's Normal vector) and one with models in the back of the plane. The models that are fully in front (or in back) of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Public methodSliceModel3DGroup(Model3DGroup, Transform3D, Model3DGroup, Model3DGroup) Slices the 3D models defined by Model3DGroup with this Plane and creates two new Model3DGroup objects: one with models that are in front of the plane (in the direction of plane's Normal vector) and one with models in the back of the plane. The models that are fully in front (or in back) of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Public methodSliceModelVisual3D(ModelVisual3D, Transform3D) Slices the 3D models defined by ModelVisual3D with this Plane and returns a new ModelVisual3D with models that are in front of the plane (in the direction of plane's Normal vector). The models that are fully in front of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Public methodSliceModelVisual3D(ModelVisual3D, ModelVisual3D, ModelVisual3D) Slices the 3D models defined by ModelVisual3D with this Plane and creates two new ModelVisual3D objects: one with models that are in front of the plane (in the direction of plane's Normal vector) and one with models in the back of the plane. The models that are fully in front (or in back) of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Public methodSliceModelVisual3D(ModelVisual3D, Transform3D, ModelVisual3D, ModelVisual3D) Slices the 3D models defined by ModelVisual3D with this Plane and creates two new ModelVisual3D objects: one with models that are in front of the plane (in the direction of plane's Normal vector) and one with models in the back of the plane. The models that are fully in front (or in back) of the Plane are not changed (the same instances are used). The models that intersect the Plane are sliced and new models are created from them.
Public methodSlicePolygon Slices the polygon specified with polygonPositions with this Plane and adds the positions that in in front of the plane to the frontPositions list and positions in the back of the plane to the backPositions list.
Public methodSliceTriangle Slices the triangle specified with p1, p2 and p3 with this Plane and adds the positions that in in front of the plane to the frontPositions list and positions in the back of the plane to the backPositions list. When triangulate is true, this method creates 4 triangles; when triangulate is false, this method creates 1 triangle and 1 four-sided polygon.
Public methodThreePlanesIntersection(Plane, Plane) Returns a Point3D that represents a position where this plane intersects with plane2 and plane3.
Public methodStatic memberThreePlanesIntersection(Plane, Plane, Plane) Returns a Point3D that represents a position where the 3 specified planes intersect.
Public methodToStringReturns a string that represents the current object.
(Overrides ObjectToString)
Public methodTransform Transforms the plane with the specified Transform3D.
Public methodStatic memberTryCreatePlane Creates plane from 3 positions. If the positions are the same or lie on the same line, then return null.
Top
Fields
 NameDescription
Public fieldCoplanarEpsilon Double value that is used to determine when a point lie on the plane (if distance from the plane is less that this value).
Top
Remarks

Plane class defines a plane in form a*x + b*y + c*z + d = 0 or p*n + d = 0 (p is point; n is normal vector).

NOTE:
Plane is sometimes also defined with a different form: a*x + b*y + c*z = d. In this form the sign of d value is flipped.

See Also