Packageorg.papervision3d.core.math
Classpublic class Plane3D

The Plane3D class represents a plane in 3D space.



Public Properties
 PropertyDefined by
  d : Number
D.
Plane3D
  normal : Number3D
The plane normal (A, B, C).
Plane3D
Public Methods
 MethodDefined by
  
Plane3D(normal:Number3D = null, ptOnPlane:Number3D = null)
Constructor.
Plane3D
  
Get the closest point on the plane.
Plane3D
  
distance(pt:*):Number
distance of point to plane.
Plane3D
  
fromCoefficients(a:Number, b:Number, c:Number, d:Number):Plane3D
[static] Creates a plane from coefficients.
Plane3D
  
fromNormalAndPoint(normal:*, point:*):Plane3D
[static] Creates a plane from a normal and a point.
Plane3D
  
fromThreePoints(p0:*, p1:*, p2:*):Plane3D
[static] Creates a plane from three points.
Plane3D
  
normalize():void
normalize.
Plane3D
  
Gets the side a vertex is on.
Plane3D
  
projectPoints(points:Array, origin:Number3D = null):void
Projects points onto this plane.
Plane3D
  
setCoefficients(a:Number, b:Number, c:Number, d:Number):void
Sets this plane from ABCD coefficients.
Plane3D
  
Sets this plane from a normal and a point.
Plane3D
  
Sets this plane from three points.
Plane3D
  
toString():String
Plane3D
Property detail
dproperty
public var d:Number

D.

normalproperty 
public var normal:Number3D

The plane normal (A, B, C).

Constructor detail
Plane3D()constructor
public function Plane3D(normal:Number3D = null, ptOnPlane:Number3D = null)

Constructor.

Parameters
normal:Number3D (default = null) — The plane normal.
 
ptOnPlane:Number3D (default = null) — A point on the plane.
Method detail
closestPointOnPlane()method
public function closestPointOnPlane(point:Number3D, ptOnPlane:Number3D):Number3D

Get the closest point on the plane.

Parameters
point:Number3D — The point to 'project'.
 
ptOnPlane:Number3D — ptOnPlane A known point on the plane.

Returns
Number3D
distance()method 
public function distance(pt:*):Number

distance of point to plane.

Parameters
pt:*

Returns
Number
fromCoefficients()method 
public static function fromCoefficients(a:Number, b:Number, c:Number, d:Number):Plane3D

Creates a plane from coefficients.

Parameters
a:Number
 
b:Number
 
c:Number
 
d:Number

Returns
Plane3D — The created plane.
fromNormalAndPoint()method 
public static function fromNormalAndPoint(normal:*, point:*):Plane3D

Creates a plane from a normal and a point.

Parameters
normal:*
 
point:*

Returns
Plane3D — The created plane.
fromThreePoints()method 
public static function fromThreePoints(p0:*, p1:*, p2:*):Plane3D

Creates a plane from three points.

Parameters
p0:* — First point.
 
p1:* — Second point.
 
p2:* — Third point.

Returns
Plane3D — The created plane.
normalize()method 
public function normalize():void

normalize.

pointOnSide()method 
public function pointOnSide(num:Number3D):int

Gets the side a vertex is on.

Parameters
num:Number3D

Returns
int
projectPoints()method 
public function projectPoints(points:Array, origin:Number3D = null):void

Projects points onto this plane.

Passed points should be in the XY-plane. If the points have Z=0 then the points are projected exactly on the plane. When however Z is greater then zero, the points are moved 'out of the plane' by a distance Z. Negative values for Z move the points 'into the plane'.

Parameters
points:Array — Array of points (any object with x, y, z props).
 
origin:Number3D (default = null) — Where to move the points.
setCoefficients()method 
public function setCoefficients(a:Number, b:Number, c:Number, d:Number):void

Sets this plane from ABCD coefficients.

Parameters
a:Number
 
b:Number
 
c:Number
 
d:Number
setNormalAndPoint()method 
public function setNormalAndPoint(normal:Number3D, pt:Number3D):void

Sets this plane from a normal and a point.

Parameters
normal:Number3D
 
pt:Number3D
setThreePoints()method 
public function setThreePoints(p0:Number3D, p1:Number3D, p2:Number3D):void

Sets this plane from three points.

Parameters
p0:Number3D
 
p1:Number3D
 
p2:Number3D
toString()method 
public function toString():String

Returns
String