Logo Euclid

NPlane Type

A struct containing a point and a unit normal, representing an unparametrized plane defined by a point and a normal vector. As opposed to the PPlane, this plane is not parametrized in X, Y, and Z directions. Internally it is stored as 6 floats (the Origin point coordinates and the normal vector components), just like the PPlane type. The Origin and Normal properties reconstruct the Pnt and UnitVec on demand. Note: Never use the struct default constructor NPlane() as it will create an invalid zero plane. Use NPlane.createFromNormal or NPlane.createUnchecked instead.

Record fields

Record Field Description

NormalX

Full Usage: NormalX

Field type: float

The X component of the normal unit vector of this NPlane.

Field type: float

NormalY

Full Usage: NormalY

Field type: float

The Y component of the normal unit vector of this NPlane.

Field type: float

NormalZ

Full Usage: NormalZ

Field type: float

The Z component of the normal unit vector of this NPlane.

Field type: float

OriginX

Full Usage: OriginX

Field type: float

The X coordinate of the Origin 3D point of this NPlane.

Field type: float

OriginY

Full Usage: OriginY

Field type: float

The Y coordinate of the Origin 3D point of this NPlane.

Field type: float

OriginZ

Full Usage: OriginZ

Field type: float

The Z coordinate of the Origin 3D point of this NPlane.

Field type: float

Constructors

Constructor Description

NPlane(pnt, n)

Full Usage: NPlane(pnt, n)

Parameters:
Returns: NPlane

Create NPlane from a 3D origin point and normal unit vector.

pnt : Pnt
n : UnitVec
Returns: NPlane

Instance members

Instance member Description

this.Angle90ToLine

Full Usage: this.Angle90ToLine

Parameters:
Returns: float
Modifiers: inline

Returns the angle to a Line3D in degrees, ignoring the normal's orientation. So 0.0 if the line is parallel to the plane, and 90 degrees if the line is perpendicular to the plane.

ln : Line3D
Returns: float

this.Angle90ToPlane

Full Usage: this.Angle90ToPlane

Parameters:
Returns: float
Modifiers: inline

Returns the angle to another plane in degrees, ignoring the normal's orientation. So 0.0 if the planes are parallel, and 90 degrees if the planes are perpendicular to each other.

pl : NPlane
Returns: float

this.Angle90ToVec

Full Usage: this.Angle90ToVec

Parameters:
Returns: float
Modifiers: inline

Returns the angle to 3D unit-vector in degrees, ignoring the plane's orientation. So 0.0 if the vector is parallel to the plane, and 90 degrees if the vector is perpendicular to the plane.

v : UnitVec
Returns: float

this.Angle90ToVec

Full Usage: this.Angle90ToVec

Parameters:
Returns: float
Modifiers: inline

Returns the angle to 3D vector in degrees, ignoring the plane's orientation. So 0.0 if the vector is parallel to the plane, and 90 degrees if the vector is perpendicular to the plane.

v : Vec
Returns: float

this.AsFSharpCode

Full Usage: this.AsFSharpCode

Returns: string

Format NPlane into an F# code string that can be used to recreate the plane.

Returns: string

this.AsString

Full Usage: this.AsString

Returns: string

Format NPlane into string with nicely formatted floating point numbers. But without type name as in pl.ToString()

Returns: string

this.ClosestPoint

Full Usage: this.ClosestPoint

Parameters:
Returns: Pnt
Modifiers: inline

Returns the closest point on the plane from a test point.

pnt : Pnt
Returns: Pnt

this.DistanceToPnt

Full Usage: this.DistanceToPnt

Parameters:
Returns: float
Modifiers: inline

Returns absolute distance of point to plane.

pnt : Pnt
Returns: float

this.DistanceToPntSigned

Full Usage: this.DistanceToPntSigned

Parameters:
Returns: float
Modifiers: inline

Returns signed distance of point to plane, also indicating on which side it is.

pnt : Pnt
Returns: float

this.DistanceToXYZ

Full Usage: this.DistanceToXYZ

Parameters:
    x : float
    y : float
    z : float

Returns: float
Modifiers: inline

Returns absolute distance of point to plane.

x : float
y : float
z : float
Returns: float

this.DistanceToXYZSigned

Full Usage: this.DistanceToXYZSigned

Parameters:
    x : float
    y : float
    z : float

Returns: float
Modifiers: inline

Returns signed distance of point to plane, also indicating on which side it is.

x : float
y : float
z : float
Returns: float

this.Flipped

Full Usage: this.Flipped

Returns: NPlane
Modifiers: inline

Returns a new plane with the same Origin but flipped Normal.

Returns: NPlane

this.IsCoincidentTo

Full Usage: this.IsCoincidentTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two planes are coincident within the distance tolerance (1e-6 by default). This means that their normals are parallel within the angle tolerance and the distance of the second origin to the first plane is less than the distance tolerance. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum cosine value. See Euclid.Cosine module. The static counterpart is NPlane.areCoincident.

other : NPlane
?distanceTolerance : float
?minCosine : MeasureProduct<cosine, MeasureOne>
Returns: bool

this.Move

Full Usage: this.Move

Parameters:
    v : Vec - The vector to move by.

Returns: NPlane A new moved plane.
Modifiers: inline

Moves the origin of the plane by a vector. The normal stays the same.

v : Vec

The vector to move by.

Returns: NPlane

A new moved plane.

this.MoveX

Full Usage: this.MoveX

Parameters:
    distance : float - The distance to move by.

Returns: NPlane A new moved plane.
Modifiers: inline

Moves the origin of the plane along the world X-axis. The normal stays the same.

distance : float

The distance to move by.

Returns: NPlane

A new moved plane.

this.MoveY

Full Usage: this.MoveY

Parameters:
    distance : float - The distance to move by.

Returns: NPlane A new moved plane.
Modifiers: inline

Moves the origin of the plane along the world Y-axis. The normal stays the same.

distance : float

The distance to move by.

Returns: NPlane

A new moved plane.

this.MoveZ

Full Usage: this.MoveZ

Parameters:
    distance : float - The distance to move by.

Returns: NPlane A new moved plane.
Modifiers: inline

Moves the origin of the plane along the world Z-axis. The normal stays the same.

distance : float

The distance to move by.

Returns: NPlane

A new moved plane.

this.Normal

Full Usage: this.Normal

Returns: UnitVec
Modifiers: inline

Creates the unitized normal vector of this NPlane.

Returns: UnitVec

this.Origin

Full Usage: this.Origin

Returns: Pnt
Modifiers: inline

Creates the Origin 3D point of this NPlane.

Returns: Pnt

this.PlaneAtClosestPnt

Full Usage: this.PlaneAtClosestPnt

Parameters:
Returns: NPlane
Modifiers: inline

First finds the closest point on the plane from a test point. Then returns a new plane with Origin at this point and the same Normal.

pnt : Pnt
Returns: NPlane

this.Rotate

Full Usage: this.Rotate

Parameters:
Returns: NPlane A new rotated plane.

Rotates the plane by a Quaternion around the world origin. The origin and the normal are both rotated.

q : Quaternion

The rotation to apply.

Returns: NPlane

A new rotated plane.

this.RotateAround

Full Usage: this.RotateAround

Parameters:
    cen : Pnt - The center point of the rotation.
    q : Quaternion - The rotation to apply.

Returns: NPlane A new rotated plane.

Rotates the plane by a Quaternion around a given center point. The origin and the normal are both rotated.

cen : Pnt

The center point of the rotation.

q : Quaternion

The rotation to apply.

Returns: NPlane

A new rotated plane.

this.Scale

Full Usage: this.Scale

Parameters:
    factor : float - The scale factor.

Returns: NPlane A new scaled plane.
Modifiers: inline

Scales the origin of the plane by a factor from the world origin. The normal stays the same.

factor : float

The scale factor.

Returns: NPlane

A new scaled plane.

this.ScaleOn

Full Usage: this.ScaleOn

Parameters:
    cen : Pnt - The center point of the scaling.
    factor : float - The scale factor.

Returns: NPlane A new scaled plane.
Modifiers: inline

Scales the origin of the plane by a factor from a center point. The normal stays the same.

cen : Pnt

The center point of the scaling.

factor : float

The scale factor.

Returns: NPlane

A new scaled plane.

this.TransformRigid

Full Usage: this.TransformRigid

Parameters:
Returns: NPlane A new transformed plane.

Transforms the plane by a RigidMatrix. The origin is rotated and moved, the normal is only rotated.

m : RigidMatrix

The rigid transformation to apply.

Returns: NPlane

A new transformed plane.

Static members

Static member Description

NPlane.WorldXY

Full Usage: NPlane.WorldXY

Returns: NPlane
Modifiers: inline

Gets the Plane at world origin with normal in world Z direction.

Returns: NPlane

NPlane.angle90ToLine ln pl

Full Usage: NPlane.angle90ToLine ln pl

Parameters:
Returns: float
Modifiers: inline

Returns the angle to a Line3D in degrees, ignoring the normal's orientation. So 0.0 if the line is parallel to the plane, and 90 degrees if the line is perpendicular to the plane.

ln : Line3D
pl : NPlane
Returns: float

NPlane.angle90ToPlane pl other

Full Usage: NPlane.angle90ToPlane pl other

Parameters:
Returns: float
Modifiers: inline

Returns the angle to another plane in degrees, ignoring the normal's orientation. So 0.0 if the planes are parallel, and 90 degrees if the planes are perpendicular to each other.

pl : NPlane
other : NPlane
Returns: float

NPlane.angle90ToUnitVec v pl

Full Usage: NPlane.angle90ToUnitVec v pl

Parameters:
Returns: float
Modifiers: inline

Returns the angle to 3D unit-vector in degrees, ignoring the plane's orientation. So 0.0 if the vector is parallel to the plane, and 90 degrees if the vector is perpendicular to the plane.

v : UnitVec
pl : NPlane
Returns: float

NPlane.angle90ToVec v pl

Full Usage: NPlane.angle90ToVec v pl

Parameters:
Returns: float
Modifiers: inline

Returns the angle to 3D vector in degrees, ignoring the plane's orientation. So 0.0 if the vector is parallel to the plane, and 90 degrees if the vector is perpendicular to the plane.

v : Vec
pl : NPlane
Returns: float

NPlane.areCoincident distanceTolerance minCosine a b

Full Usage: NPlane.areCoincident distanceTolerance minCosine a b

Parameters:
    distanceTolerance : float - The maximum distance of the origin of plane b to plane a.
    minCosine : float<MeasureProduct<cosine, MeasureOne>> - The minimum cosine of the angle between the normals, ignoring their orientation. See the Euclid.Cosine module.
    a : NPlane - The first plane.
    b : NPlane - The second plane.

Returns: bool TRUE if the planes are coincident.
Modifiers: inline

Checks if two 3D planes are coincident within the given tolerances. This means that their normals are parallel within the angle tolerance and the distance of the second origin to the first plane is less than the distance tolerance. The instance counterpart is NPlane.IsCoincidentTo.

distanceTolerance : float

The maximum distance of the origin of plane b to plane a.

minCosine : float<MeasureProduct<cosine, MeasureOne>>

The minimum cosine of the angle between the normals, ignoring their orientation. See the Euclid.Cosine module.

a : NPlane

The first plane.

b : NPlane

The second plane.

Returns: bool

TRUE if the planes are coincident.

NPlane.asFSharpCode pl

Full Usage: NPlane.asFSharpCode pl

Parameters:
Returns: string
Modifiers: inline

Format NPlane into an F# code string that can be used to recreate the plane.

pl : NPlane
Returns: string

NPlane.asString pl

Full Usage: NPlane.asString pl

Parameters:
Returns: string
Modifiers: inline

Format NPlane into string with nicely formatted floating point numbers. But without type name as in pl.ToString()

pl : NPlane
Returns: string

NPlane.closestPoint pnt pl

Full Usage: NPlane.closestPoint pnt pl

Parameters:
Returns: Pnt
Modifiers: inline

Returns the closest point on the plane from a test point.

pnt : Pnt
pl : NPlane
Returns: Pnt

NPlane.createFrom3Pnts a b c

Full Usage: NPlane.createFrom3Pnts a b c

Parameters:
Returns: NPlane
Modifiers: inline

Create Plane from 3 points. Point 'a' becomes the origin. Normal is calculated as cross product (c-b) × (a-b) following the right-hand rule. Fails if the three points are collinear.

a : Pnt
b : Pnt
c : Pnt
Returns: NPlane

NPlane.createFromNormal normal pnt

Full Usage: NPlane.createFromNormal normal pnt

Parameters:
Returns: NPlane

Create Plane from a normal vector and an origin point. The normal vector gets unitized.

normal : Vec
pnt : Pnt
Returns: NPlane

NPlane.createFromPPlane p

Full Usage: NPlane.createFromPPlane p

Parameters:
Returns: NPlane
Modifiers: inline

Creates an NPlane from a parametrized PPlane. Uses the PPlane's origin and Z-axis (which becomes the normal).

p : PPlane
Returns: NPlane

NPlane.createFromUnitNormal normal pnt

Full Usage: NPlane.createFromUnitNormal normal pnt

Parameters:
Returns: NPlane
Modifiers: inline

Create Plane from an already normalized normal vector and an origin point.

normal : UnitVec
pnt : Pnt
Returns: NPlane

NPlane.createFromUnitNormalUnchecked (origin, normal)

Full Usage: NPlane.createFromUnitNormalUnchecked (origin, normal)

Parameters:
Returns: NPlane
Modifiers: inline

Unsafe internal constructor, doesn't check if the normal is unitized. Requires correct input of a unitized normal vector.

origin : Pnt
normal : UnitVec
Returns: NPlane

NPlane.createUnchecked (originX, originY, originZ, normalX, normalY, normalZ)

Full Usage: NPlane.createUnchecked (originX, originY, originZ, normalX, normalY, normalZ)

Parameters:
    originX : float
    originY : float
    originZ : float
    normalX : float
    normalY : float
    normalZ : float

Returns: NPlane
Modifiers: inline

Unsafe internal constructor, doesn't check if the normal is unitized. Requires correct input of unitized normal vector components. When compiled in DEBUG mode or with the CHECKED_EUCLID symbol defined the input is verified.

originX : float
originY : float
originZ : float
normalX : float
normalY : float
normalZ : float
Returns: NPlane

NPlane.distanceToPnt pnt pl

Full Usage: NPlane.distanceToPnt pnt pl

Parameters:
Returns: float
Modifiers: inline

Returns absolute distance of point to plane.

pnt : Pnt
pl : NPlane
Returns: float

NPlane.distanceToPntSigned pnt pl

Full Usage: NPlane.distanceToPntSigned pnt pl

Parameters:
Returns: float
Modifiers: inline

Returns signed distance of point to plane, also indicating on which side it is.

pnt : Pnt
pl : NPlane
Returns: float

NPlane.distanceToXYZ x y z pl

Full Usage: NPlane.distanceToXYZ x y z pl

Parameters:
    x : float
    y : float
    z : float
    pl : NPlane

Returns: float
Modifiers: inline

Returns absolute distance of point to plane.

x : float
y : float
z : float
pl : NPlane
Returns: float

NPlane.distanceToXYZSigned x y z pl

Full Usage: NPlane.distanceToXYZSigned x y z pl

Parameters:
    x : float
    y : float
    z : float
    pl : NPlane

Returns: float
Modifiers: inline

Returns signed distance of point to plane, also indicating on which side it is.

x : float
y : float
z : float
pl : NPlane
Returns: float

NPlane.doLinePlaneIntersect ln pl

Full Usage: NPlane.doLinePlaneIntersect ln pl

Parameters:
Returns: bool
Modifiers: inline

Checks if a finite Line3D intersects with Plane in one point. Returns FALSE for parallel and coincident lines. Adds a tolerance of 1e-6 to the line's domain, so that intersection just below 0.0 or just above 1.0 is considered intersecting.

ln : Line3D
pl : NPlane
Returns: bool

NPlane.equalsExact a b

Full Usage: NPlane.equalsExact a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D planes are exactly equal. Compares each field with the = operator, so a NaN value is never equal.

a : NPlane
b : NPlane
Returns: bool

NPlane.equalsWithin tol a b

Full Usage: NPlane.equalsWithin tol a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D planes are equal within tolerance. The tolerance applies to each coordinate of the origin and of the normal separately, not to the Euclidean distance between them. Use NPlane.equalsExact to check for an exact match.

tol : float
a : NPlane
b : NPlane
Returns: bool

NPlane.flipped pl

Full Usage: NPlane.flipped pl

Parameters:
Returns: NPlane
Modifiers: inline

Returns a new plane with the same Origin but flipped Normal.

pl : NPlane
Returns: NPlane

NPlane.intersect a b

Full Usage: NPlane.intersect a b

Parameters:
Returns: Line3D

Returns the line of intersection between two planes. Fails if they are parallel or coincident. Use NPlane.tryIntersect to get ValueNone instead.

a : NPlane
b : NPlane
Returns: Line3D

NPlane.intersectLine ln pl

Full Usage: NPlane.intersectLine ln pl

Parameters:
Returns: Pnt

Returns intersection point of a finite line with the Plane. Intersection just below 0.0 or just above 1.0 within tolerance of 1e-6 are clamped to 0.0 or 1.0 Fails if they are parallel, if the line has zero length, or if the domain of intersection is outside 0.0 to 1.0. Use NPlane.tryIntersectLine to get ValueNone instead.

ln : Line3D
pl : NPlane
Returns: Pnt

NPlane.intersectRay ln pl

Full Usage: NPlane.intersectRay ln pl

Parameters:
Returns: float

Returns the intersection parameter of an infinite line / ray with the plane. Fails if they are parallel, or if the line has zero length. Use NPlane.tryIntersectRay to get ValueNone instead.

ln : Line3D
pl : NPlane
Returns: float

NPlane.move translation pl

Full Usage: NPlane.move translation pl

Parameters:
Returns: NPlane
Modifiers: inline

Move plane origin by vector.

translation : Vec
pl : NPlane
Returns: NPlane

NPlane.moveX distance pl

Full Usage: NPlane.moveX distance pl

Parameters:
    distance : float - The distance to move by.
    pl : NPlane - The plane to move.

Returns: NPlane A new moved plane.
Modifiers: inline

Moves the origin of the plane along the world X-axis. The normal stays the same.

distance : float

The distance to move by.

pl : NPlane

The plane to move.

Returns: NPlane

A new moved plane.

NPlane.moveY distance pl

Full Usage: NPlane.moveY distance pl

Parameters:
    distance : float - The distance to move by.
    pl : NPlane - The plane to move.

Returns: NPlane A new moved plane.
Modifiers: inline

Moves the origin of the plane along the world Y-axis. The normal stays the same.

distance : float

The distance to move by.

pl : NPlane

The plane to move.

Returns: NPlane

A new moved plane.

NPlane.moveZ distance pl

Full Usage: NPlane.moveZ distance pl

Parameters:
    distance : float - The distance to move by.
    pl : NPlane - The plane to move.

Returns: NPlane A new moved plane.
Modifiers: inline

Moves the origin of the plane along the world Z-axis. The normal stays the same.

distance : float

The distance to move by.

pl : NPlane

The plane to move.

Returns: NPlane

A new moved plane.

NPlane.normal p

Full Usage: NPlane.normal p

Parameters:
Returns: UnitVec
Modifiers: inline

Gets the Planes normal. A unitized vector.

p : NPlane
Returns: UnitVec

NPlane.offset dist pl

Full Usage: NPlane.offset dist pl

Parameters:
Returns: NPlane
Modifiers: inline

Returns a new plane offset along the normal vector.

dist : float
pl : NPlane
Returns: NPlane

NPlane.offsetInDirection dirPnt dist pl

Full Usage: NPlane.offsetInDirection dirPnt dist pl

Parameters:
Returns: NPlane
Modifiers: inline

Offsets the plane by the given distance in the direction determined by a point. If the point is on the positive side of the plane (same direction as normal), offsets in the normal direction. If the point is on the negative side, offsets in the opposite direction.

dirPnt : Pnt
dist : float
pl : NPlane
Returns: NPlane

NPlane.origin a

Full Usage: NPlane.origin a

Parameters:
Returns: Pnt
Modifiers: inline

Gets the Planes origin.

a : NPlane
Returns: Pnt

NPlane.planeAtClosestPnt pnt pl

Full Usage: NPlane.planeAtClosestPnt pnt pl

Parameters:
Returns: NPlane
Modifiers: inline

First finds the closest point on the plane from a test point. Then returns a new plane with Origin at this point and the same Normal.

pnt : Pnt
pl : NPlane
Returns: NPlane

NPlane.rotate q pl

Full Usage: NPlane.rotate q pl

Parameters:
Returns: NPlane A new rotated plane.
Modifiers: inline

Rotates the plane by a Quaternion around the world origin. The origin and the normal are both rotated.

q : Quaternion

The rotation to apply.

pl : NPlane

The plane to rotate.

Returns: NPlane

A new rotated plane.

NPlane.rotateAround cen q pl

Full Usage: NPlane.rotateAround cen q pl

Parameters:
    cen : Pnt - The center point of the rotation.
    q : Quaternion - The rotation to apply.
    pl : NPlane - The plane to rotate.

Returns: NPlane A new rotated plane.
Modifiers: inline

Rotates the plane by a Quaternion around a given center point. The origin and the normal are both rotated.

cen : Pnt

The center point of the rotation.

q : Quaternion

The rotation to apply.

pl : NPlane

The plane to rotate.

Returns: NPlane

A new rotated plane.

NPlane.scale factor pl

Full Usage: NPlane.scale factor pl

Parameters:
Returns: NPlane
Modifiers: inline

Scales the plane's origin by a given factor from the world origin. The normal remains unchanged.

factor : float
pl : NPlane
Returns: NPlane

NPlane.scaleOn cen factor pl

Full Usage: NPlane.scaleOn cen factor pl

Parameters:
    cen : Pnt - The center point of the scaling.
    factor : float - The scale factor.
    pl : NPlane - The plane to scale.

Returns: NPlane A new scaled plane.
Modifiers: inline

Scales the origin of the plane by a factor from a center point. The normal stays the same.

cen : Pnt

The center point of the scaling.

factor : float

The scale factor.

pl : NPlane

The plane to scale.

Returns: NPlane

A new scaled plane.

NPlane.transformRigid m pl

Full Usage: NPlane.transformRigid m pl

Parameters:
    m : RigidMatrix - The rigid transformation to apply.
    pl : NPlane - The plane to transform.

Returns: NPlane A new transformed plane.
Modifiers: inline

Transforms the plane by a RigidMatrix. The origin is rotated and moved, the normal is only rotated.

m : RigidMatrix

The rigid transformation to apply.

pl : NPlane

The plane to transform.

Returns: NPlane

A new transformed plane.

NPlane.tryIntersect a b

Full Usage: NPlane.tryIntersect a b

Parameters:
Returns: Line3D voption

Returns the line of intersection between two planes. Or ValueNone if they are parallel or coincident.

a : NPlane
b : NPlane
Returns: Line3D voption

NPlane.tryIntersectLine ln pl

Full Usage: NPlane.tryIntersectLine ln pl

Parameters:
Returns: Pnt voption

Returns intersection point of a finite line with the Plane. Or ValueNone if they are parallel or the domain of intersection is outside 0.0 to 1.0 Intersection just below 0.0 or just above 1.0 within tolerance of 1e-6 are clamped to 0.0 or 1.0

ln : Line3D
pl : NPlane
Returns: Pnt voption

NPlane.tryIntersectRay ln pl

Full Usage: NPlane.tryIntersectRay ln pl

Parameters:
Returns: float voption

Returns the intersection parameter of an infinite line / ray with the plane. Or ValueNone if they are parallel.

ln : Line3D
pl : NPlane
Returns: float voption

Type something to start searching.