ACF $AcfVersion:0$
Public Member Functions | List of all members
i3d::CPlane3d Class Reference

Definition of a plane in 3D space. More...

#include <CPlane3d.h>

Public Member Functions

 CPlane3d ()
 Default constructor.
 
 CPlane3d (const CVector3d &point, const CVector3d &normal)
 Construct plane from point and normal vector.
 
 CPlane3d (const CVector3d &p1, const CVector3d &p2, const CVector3d &p3)
 Construct plane from three points.
 
const CVector3dGetPoint () const
 Get point on the plane.
 
void SetPoint (const CVector3d &point)
 Set point on the plane.
 
const CVector3dGetNormal () const
 Get normal vector of the plane.
 
void SetNormal (const CVector3d &normal)
 Set normal vector of the plane.
 
double GetSignedDistance (const CVector3d &point) const
 Calculate signed distance from point to plane.
 
double GetDistance (const CVector3d &point) const
 Calculate absolute distance from point to plane.
 
CVector3d GetProjection (const CVector3d &point) const
 Project point onto the plane.
 
bool Contains (const CVector3d &point, double tolerance=I_BIG_EPSILON) const
 Check if point lies on the plane (within tolerance).
 
bool Serialize (iser::IArchive &archive)
 Serialize this plane to specified archive.
 
bool operator== (const CPlane3d &plane) const
 
bool operator!= (const CPlane3d &plane) const
 

Detailed Description

Definition of a plane in 3D space.

Plane is stored as a point on the plane and a normal vector. The plane equation is: dot(normal, (p - point)) = 0

Definition at line 18 of file CPlane3d.h.

Constructor & Destructor Documentation

◆ CPlane3d() [1/3]

i3d::CPlane3d::CPlane3d ( )
inline

Default constructor.

Creates a plane at origin with normal pointing along Z axis.

Definition at line 101 of file CPlane3d.h.

◆ CPlane3d() [2/3]

i3d::CPlane3d::CPlane3d ( const CVector3d point,
const CVector3d normal 
)
inline

Construct plane from point and normal vector.

Parameters
pointA point on the plane.
normalNormal vector (will be normalized internally).

Definition at line 108 of file CPlane3d.h.

◆ CPlane3d() [3/3]

i3d::CPlane3d::CPlane3d ( const CVector3d p1,
const CVector3d p2,
const CVector3d p3 
)

Construct plane from three points.

Points should not be collinear.

Parameters
p1First point on plane.
p2Second point on plane.
p3Third point on plane.

Member Function Documentation

◆ Contains()

bool i3d::CPlane3d::Contains ( const CVector3d point,
double  tolerance = I_BIG_EPSILON 
) const
inline

Check if point lies on the plane (within tolerance).

Definition at line 158 of file CPlane3d.h.

References GetDistance().

◆ GetDistance()

double i3d::CPlane3d::GetDistance ( const CVector3d point) const
inline

Calculate absolute distance from point to plane.

Definition at line 145 of file CPlane3d.h.

References GetSignedDistance().

Referenced by Contains(), and i3d::Geometry::GetDistance().

◆ GetNormal()

const CVector3d & i3d::CPlane3d::GetNormal ( ) const
inline

Get normal vector of the plane.

Definition at line 127 of file CPlane3d.h.

◆ GetPoint()

const CVector3d & i3d::CPlane3d::GetPoint ( ) const
inline

Get point on the plane.

Definition at line 115 of file CPlane3d.h.

◆ GetProjection()

CVector3d i3d::CPlane3d::GetProjection ( const CVector3d point) const
inline

Project point onto the plane.

Definition at line 151 of file CPlane3d.h.

References GetSignedDistance().

◆ GetSignedDistance()

double i3d::CPlane3d::GetSignedDistance ( const CVector3d point) const
inline

Calculate signed distance from point to plane.

Positive if point is on the side of normal, negative otherwise.

Definition at line 139 of file CPlane3d.h.

References imath::TVector< Size, Element >::GetDotProduct().

Referenced by GetDistance(), GetProjection(), and i3d::Geometry::IsOnPositiveSide().

◆ operator!=()

bool i3d::CPlane3d::operator!= ( const CPlane3d plane) const
inline

Definition at line 170 of file CPlane3d.h.

◆ operator==()

bool i3d::CPlane3d::operator== ( const CPlane3d plane) const
inline

Definition at line 164 of file CPlane3d.h.

◆ Serialize()

bool i3d::CPlane3d::Serialize ( iser::IArchive archive)

Serialize this plane to specified archive.

◆ SetNormal()

void i3d::CPlane3d::SetNormal ( const CVector3d normal)
inline

Set normal vector of the plane.

The normal will be normalized internally.

Definition at line 133 of file CPlane3d.h.

References i3d::CVector3d::GetNormalized().

◆ SetPoint()

void i3d::CPlane3d::SetPoint ( const CVector3d point)
inline

Set point on the plane.

Definition at line 121 of file CPlane3d.h.


The documentation for this class was generated from the following file: