AnyCAD Rapid SDK  2020
The Rapid CAD SDK
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Plane Class Reference

Classes

class  Side
 

Public Member Functions

synchronized void delete ()
 
void setNormal (Vector3 value)
 
Vector3 getNormal ()
 
void setD (float value)
 
float getD ()
 
 Plane ()
 
 Plane (Plane rhs)
 
 Plane (Vector3 rkNormal, float fConstant)
 
 Plane (float a, float b, float c, float d)
 
 Plane (Vector3 rkNormal, Vector3 rkPoint)
 
 Plane (Vector3 rkPoint0, Vector3 rkPoint1, Vector3 rkPoint2)
 
Plane.Side getSide (Vector3 rkPoint)
 
Plane.Side getSide (AxisAlignedBox rkBox)
 
Plane.Side getSide (Vector3 centre, Vector3 halfSize)
 
float getDistance (Vector3 rkPoint)
 
void redefine (Vector3 rkPoint0, Vector3 rkPoint1, Vector3 rkPoint2)
 
void redefine (Vector3 rkNormal, Vector3 rkPoint)
 
Vector3 projectVector (Vector3 v)
 
float normalise ()
 
void applyMatrix (Matrix4 matrix)
 
Vector3 coplanarPoint ()
 
void applyMatrix (Matrix4 matrix, Matrix3 normalMatrix)
 

Protected Member Functions

 Plane (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 

Static Protected Member Functions

static long getCPtr (Plane obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

Defines a plane in 3D space.
Remarks:
A plane is defined in 3D space by the equation
Ax + By + Cz + D = 0

This equates to a vector (the normal of the plane, whose x, y
and z components equate to the coefficients A, B and C
respectively), and a constant (D) which is the distance along
the normal you have to go to move the plane back to the origin.

Constructor & Destructor Documentation

Plane.Plane ( )

Default constructor - sets everything to 0.

Plane.Plane ( Vector3  rkNormal,
float  fConstant 
)

Construct a plane through a normal, and a distance to move the plane along the normal.

Plane.Plane ( float  a,
float  b,
float  c,
float  d 
)

Construct a plane using the 4 constants directly *

Member Function Documentation

float Plane.getDistance ( Vector3  rkPoint)

This is a pseudodistance. The sign of the return value is
positive if the point is on the positive side of the plane,
negative if the point is on the negative side, and zero if the
point is on the plane.

The absolute value of the return value is the true distance only
when the plane normal is a unit length vector.

Plane.Side Plane.getSide ( AxisAlignedBox  rkBox)

Returns the side where the alignedBox is. The flag BOTH_SIDE indicates an intersecting box.
One corner ON the plane is sufficient to consider the box and the plane intersecting.

Plane.Side Plane.getSide ( Vector3  centre,
Vector3  halfSize 
)

Returns which side of the plane that the given box lies on.
The box is defined as centre/half-size pairs for effectively.

Parameters
centreThe centre of the box.
halfSizeThe half-size of the box.
Returns

POSITIVE_SIDE if the box complete lies on the "positive side" of the plane,
NEGATIVE_SIDE if the box complete lies on the "negative side" of the plane,
and BOTH_SIDE if the box intersects the plane.
float Plane.normalise ( )

Normalises the plane.
Remarks:
This method normalises the plane's normal and the length scale of d
is as well.
Note:
This function will not crash for zero-sized vectors, but there
will be no changes made to their components.

Returns
The previous length of the plane's normal.
Vector3 Plane.projectVector ( Vector3  v)

Project a vector onto the plane.
Remarks: This gives you the element of the input vector that is perpendicular
to the normal of the plane. You can get the element which is parallel
to the normal of the plane by subtracting the result of this method
from the original vector, since parallel + perpendicular = original.

Parameters
vThe input vector
void Plane.redefine ( Vector3  rkPoint0,
Vector3  rkPoint1,
Vector3  rkPoint2 
)

Redefine this plane based on 3 points.

void Plane.redefine ( Vector3  rkNormal,
Vector3  rkPoint 
)

Redefine this plane based on a normal and a point.