AnyCAD Rapid API 2024
Help you to create a better world!
载入中...
搜索中...
未找到
Plane类 参考

Public 成员函数

void setNormal (Vector3d value)
 
Vector3d getNormal ()
 
void setD (double value)
 
double getD ()
 
 Plane ()
 
 Plane (Plane rhs)
 
 Plane (Vector3d rkNormal, double fConstant)
 
 Plane (double a, double b, double c, double _d)
 
 Plane (Vector3d rkNormal, Vector3d rkPoint)
 
 Plane (Vector3d rkPoint0, Vector3d rkPoint1, Vector3d rkPoint2)
 
EnumPlaneSide getSide (Vector3d rkPoint)
 
EnumPlaneSide getSide (AABox rkBox)
 
EnumPlaneSide getSide (Vector3d centre, Vector3d halfSize)
 
EnumPlaneSide getSide (Vector3d centre, double radius)
 
double getDistance (Vector3d rkPoint)
 
void redefine (Vector3d rkPoint0, Vector3d rkPoint1, Vector3d rkPoint2)
 
void redefine (Vector3d rkNormal, Vector3d rkPoint)
 
Vector3d projectVector (Vector3d v)
 
double normalise ()
 
void applyMatrix (Matrix4d matrix)
 
Vector3d coplanarPoint ()
 
void applyMatrix (Matrix4d matrix, Matrix3d normalMatrix)
 

详细描述

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.


构造及析构函数说明

◆ Plane() [1/3]

Plane.Plane ( )

Default constructor - sets everything to 0.

◆ Plane() [2/3]

Plane.Plane ( Vector3d rkNormal,
double fConstant )

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

◆ Plane() [3/3]

Plane.Plane ( double a,
double b,
double c,
double _d )

Construct a plane using the 4 constants directly *

成员函数说明

◆ getDistance()

double Plane.getDistance ( Vector3d 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.

◆ getSide() [1/3]

EnumPlaneSide Plane.getSide ( AABox 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.

◆ getSide() [2/3]

EnumPlaneSide Plane.getSide ( Vector3d centre,
Vector3d halfSize )

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

参数
centreThe centre of the box.
halfSizeThe half-size of the box.
返回

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.

◆ getSide() [3/3]

EnumPlaneSide Plane.getSide ( Vector3d rkPoint)

The "positive side" of the plane is the half space to which the
plane normal points. The "negative side" is the other half
space. The flag "no side" indicates the plane itself.

◆ normalise()

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

返回
The previous length of the plane's normal.

◆ projectVector()

Vector3d Plane.projectVector ( Vector3d 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.

参数
vThe input vector

◆ redefine() [1/2]

void Plane.redefine ( Vector3d rkNormal,
Vector3d rkPoint )

Redefine this plane based on a normal and a point.

◆ redefine() [2/2]

void Plane.redefine ( Vector3d rkPoint0,
Vector3d rkPoint1,
Vector3d rkPoint2 )

Redefine this plane based on 3 points.