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.create 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(pt, n)

Full Usage: NPlane(pt, n)

Parameters:
Returns: NPlane

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

pt : 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.

pt : Pnt
Returns: Pnt

this.DistanceToPt

Full Usage: this.DistanceToPt

Parameters:
Returns: float
Modifiers: inline

Returns absolute distance of point to plane.

pt : Pnt
Returns: float

this.DistanceToPtSigned

Full Usage: this.DistanceToPtSigned

Parameters:
Returns: float
Modifiers: inline

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

pt : 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.

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

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.PlaneAtClPt

Full Usage: this.PlaneAtClPt

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.

pt : Pnt
Returns: NPlane

Static members

Static member Description

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.angleTo a b

Full Usage: NPlane.angleTo a b

Parameters:
Returns: float
Modifiers: inline

Returns the angle to another Plane in Degree, ignoring the normal's orientation. So between 0 to 90 degrees.

a : NPlane
b : NPlane
Returns: float

NPlane.areCoincident a b

Full Usage: NPlane.areCoincident a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D planes are coincident. This means that the normals are parallel within 0.25 degrees and the distance of second origin to the first plane is less than 1e-6 units tolerance.

a : NPlane
b : NPlane
Returns: bool

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 pt pl

Full Usage: NPlane.closestPoint pt pl

Parameters:
Returns: Pnt
Modifiers: inline

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

pt : Pnt
pl : NPlane
Returns: Pnt

NPlane.create (pt, normal)

Full Usage: NPlane.create (pt, normal)

Parameters:
Returns: NPlane
Modifiers: inline

Create Plane from already normalized input vector.

pt : Pnt
normal : UnitVec
Returns: NPlane

NPlane.create (pt, normal)

Full Usage: NPlane.create (pt, normal)

Parameters:
Returns: NPlane

Create Plane, normal vector gets unitized in constructor.

pt : Pnt
normal : Vec
Returns: NPlane

NPlane.createFrom3Points a b c

Full Usage: NPlane.createFrom3Points 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 colinear.

a : Pnt
b : Pnt
c : 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.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.

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

NPlane.createUncheckedVec (origin, normal)

Full Usage: NPlane.createUncheckedVec (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.distToPt pt pl

Full Usage: NPlane.distToPt pt pl

Parameters:
Returns: float
Modifiers: inline

Returns absolute distance of point to plane.

pt : Pnt
pl : NPlane
Returns: float

NPlane.distToPtSigned pt pl

Full Usage: NPlane.distToPtSigned pt pl

Parameters:
Returns: float
Modifiers: inline

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

pt : Pnt
pl : NPlane
Returns: float

NPlane.distanceToPt pt pl

Full Usage: NPlane.distanceToPt pt pl

Parameters:
Returns: float
Modifiers: inline

Returns absolute distance of point to plane.

pt : Pnt
pl : NPlane
Returns: float

NPlane.distanceToPtSigned pt pl

Full Usage: NPlane.distanceToPtSigned pt pl

Parameters:
Returns: float
Modifiers: inline

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

pt : 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.

ln : Line3D
pl : NPlane
Returns: bool

NPlane.equals tol a b

Full Usage: NPlane.equals tol a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D planes are equal within tolerance. The same tolerance is used for the origin and the tips of the normal. Use a tolerance of 0.0 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 option

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

a : NPlane
b : NPlane
Returns: Line3D option

NPlane.intersectLine ln pl

Full Usage: NPlane.intersectLine ln pl

Parameters:
Returns: Pnt option

Returns intersection point of a finite line with the Plane. Or None 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 option

NPlane.intersectLineParameter ln pl

Full Usage: NPlane.intersectLineParameter ln pl

Parameters:
Returns: float option

Returns the parameter of intersection on a infinite line / ray with the Plane. Or None if they are parallel.

ln : Line3D
pl : NPlane
Returns: float option

NPlane.intersectRay ln pl

Full Usage: NPlane.intersectRay ln pl

Parameters:
Returns: Pnt option

Returns intersection point of a infinite line / ray with the Plane. Or None if they are parallel.

ln : Line3D
pl : NPlane
Returns: Pnt option

NPlane.move translation pl

Full Usage: NPlane.move translation pl

Parameters:
Returns: NPlane
Modifiers: inline

Move plane origin by vector. This is same as NPlane.translate.

translation : Vec
pl : NPlane
Returns: NPlane

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.offsetInDir dirPt dist pl

Full Usage: NPlane.offsetInDir dirPt 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.

dirPt : 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.planeAtClPt pt pl

Full Usage: NPlane.planeAtClPt pt 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.

pt : Pnt
pl : NPlane
Returns: NPlane

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.translate translation pl

Full Usage: NPlane.translate translation pl

Parameters:
Returns: NPlane
Modifiers: inline

Move plane origin by vector. This is the same as NPlane.move.

translation : Vec
pl : NPlane
Returns: NPlane

NPlane.xyPlane

Full Usage: NPlane.xyPlane

Returns: NPlane
Modifiers: inline

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

Returns: NPlane

Type something to start searching.