Rhino C++ API  8.14
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_Plane Class Reference

#include <opennurbs_plane.h>

Public Member Functions

 ON_Plane ()
 
 ON_Plane (const double equation[4])
 
 ON_Plane (const ON_3dPoint &origin, const ON_3dPoint &x_point, const ON_3dPoint &y_point)
 
 ON_Plane (const ON_3dPoint &origin, const ON_3dVector &normal)
 
 ON_Plane (const ON_3dPoint &origin, const ON_3dVector &x_dir, const ON_3dVector &y_dir)
 
 ON_Plane (const ON_PlaneEquation &plane_equation)
 
 ~ON_Plane ()
 
ON_3dPoint ClosestPointTo (ON_3dPoint point) const
 
bool ClosestPointTo (ON_3dPoint world_point, double *u, double *v) const
 
bool CreateFromEquation (const class ON_PlaneEquation &plane_equation)
 
bool CreateFromEquation (const double equation[4])
 
bool CreateFromFrame (const ON_3dPoint &origin, const ON_3dVector &x_dir, const ON_3dVector &y_dir)
 
bool CreateFromNormal (const ON_3dPoint &origin, const ON_3dVector &normal)
 
bool CreateFromNormalYup (const ON_3dPoint &origin, const ON_3dVector &normal, const ON_3dVector &y_up)
 
bool CreateFromPoints (const ON_3dPoint &origin, const ON_3dPoint &point_on_x, const ON_3dPoint &point_on)
 
double DistanceTo (const ON_3dPoint &point) const
 
void Dump (class ON_TextLog &) const
 
bool Flip ()
 
bool GetDistanceToBoundingBox (const ON_BoundingBox &, double *min, double *max) const
 
ON_Line IsoLine (int dir, double c) const
 
bool IsValid () const
 
bool Morph (const ON_SpaceMorph &morph)
 
const ON_3dVectorNormal () const
 
bool operator!= (const ON_Plane &) const
 
bool operator== (const ON_Plane &) const
 
const ON_3dPointOrigin () const
 
ON_3dPoint PointAt (double u, double v) const
 
ON_3dPoint PointAt (double u, double v, double w) const
 
bool Rotate (double angle, const ON_3dVector &axis)
 
bool Rotate (double angle, const ON_3dVector &axis, const ON_3dPoint &center)
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis)
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis, const ON_3dPoint &center)
 
void SetOrigin (const ON_3dPoint &origin)
 
bool SwapCoordinates (int i, int j)
 
bool Transform (const ON_Xform &xform)
 For intersections see ON_Intersect();. More...
 
bool Translate (const ON_3dVector &delta)
 
bool UpdateEquation ()
 
const ON_3dVectorXaxis () const
 
const ON_3dVectorYaxis () const
 

Static Public Member Functions

static ON_Plane FromPointList (const class ON_3dPointListRef &point_list)
 
static ON_Plane FromPointList (const ON_SimpleArray< ON_3dPoint > &point_list)
 
static ON_Plane FromPointList (const ON_SimpleArray< ON_3fPoint > &point_list)
 
static ON_Plane FromPointList (size_t point_index_count, const unsigned int *point_index_list, const class ON_3dPointListRef &point_list)
 
static ON_Plane FromPointList (size_t point_index_count, size_t point_index_stride, const unsigned int *point_index_list, const class ON_3dPointListRef &point_list)
 
static ON_Plane FromPointList (size_t point_list_count, const ON_3dPoint *point_list)
 
static ON_Plane FromPointList (size_t point_list_count, const ON_3fPoint *point_list)
 

Public Attributes

ON_3dPoint origin
 origin of plane More...
 
ON_PlaneEquation plane_equation
 equation of plane More...
 
ON_3dVector xaxis
 unit X axis of plane More...
 
ON_3dVector yaxis
 unit Y axis of plane More...
 
ON_3dVector zaxis
 unit Z axis of plane More...
 

Static Public Attributes

const static ON_Plane NanPlane
 All values are ON_DBL_QNAN. More...
 
const static ON_Plane UnsetPlane
 All values are ON_UNSET_VALUE. More...
 
const static ON_Plane World_xy
 world coordinate system ON_Plane(ON_3dPoint::Origin, ON_3dVector::XAxis, ON_3dVector::YAxis); More...
 
const static ON_Plane World_yz
 world coordinate system ON_Plane(ON_3dPoint::Origin, ON_3dVector::YAxis, ON_3dVector::ZAxis); More...
 
const static ON_Plane World_zx
 world coordinate system ON_Plane(ON_3dPoint::Origin, ON_3dVector::ZAxis, ON_3dVector::XAxis); More...
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org.

Constructor & Destructor Documentation

◆ ON_Plane() [1/6]

ON_Plane::ON_Plane ( )

Description: The default constructor creates a plane with orgin=(0,0,0), xaxis=(1,0,0), yaxis=(0,1,0) zaxis=(0,0,1), and equation=(0,0,1,0).

◆ ON_Plane() [2/6]

ON_Plane::ON_Plane ( const ON_3dPoint origin,
const ON_3dVector normal 
)

Description: Construct a plane from a point and normal vector. Parameters: origin - [in] point on the plane normal - [in] non-zero normal to the plane Remarks: origin = point, zaxis = unitized normal, xaxis xaxis set with xaxis.PerpendicularTo(zaxis). See Also: ON_Plane::CreateFromNormal

◆ ON_Plane() [3/6]

ON_Plane::ON_Plane ( const ON_3dPoint origin,
const ON_3dVector x_dir,
const ON_3dVector y_dir 
)

Description: Construct a plane from a point, and two vectors in the plane. Parameters: origin - [in] point on the plane x_dir - [in] non-zero vector in the plane that determines the xaxis direction. y_dir - [in] non-zero vector not parallel to x_dir that is used to determine the yaxis direction. y_dir does not have to be perpendicular to x_dir.

◆ ON_Plane() [4/6]

ON_Plane::ON_Plane ( const ON_3dPoint origin,
const ON_3dPoint x_point,
const ON_3dPoint y_point 
)

Description: Construct a plane from three non-collinear points. Parameters: origin - [in] point on the plane x_point - [in] second point in the plane. The xaxis will be parallel to x_point-origin. y_point - [in] third point on the plane that is not collinear with the first two points. yaxis*(y_point-origin) will be > 0.

◆ ON_Plane() [5/6]

ON_Plane::ON_Plane ( const double  equation[4])

Description: Construct a plane from an equation. Parameters: equation - [in] an array of 4 doubles with one of equation[0], equation[1], or equation[2] being non-zero.

◆ ON_Plane() [6/6]

ON_Plane::ON_Plane ( const ON_PlaneEquation plane_equation)

◆ ~ON_Plane()

ON_Plane::~ON_Plane ( )

Member Function Documentation

◆ ClosestPointTo() [1/2]

ON_3dPoint ON_Plane::ClosestPointTo ( ON_3dPoint  point) const

Description: Get point on plane that is closest to a given point. Parameters: point - [in] Returns: A 3d point on the plane that is closest to world_point.

◆ ClosestPointTo() [2/2]

bool ON_Plane::ClosestPointTo ( ON_3dPoint  world_point,
double *  u,
double *  v 
) const

Description: Get point on plane that is closest to a given point. Parameters: world_point - [in] 3d point u - [out] v - [out] The point ON_Plane::PointAt(*u,*v) is the point on the plane that is closest to world_point. Returns: true if successful.

◆ CreateFromEquation() [1/2]

bool ON_Plane::CreateFromEquation ( const class ON_PlaneEquation plane_equation)

◆ CreateFromEquation() [2/2]

bool ON_Plane::CreateFromEquation ( const double  equation[4])

Description: Construct a plane from an equation. Parameters: equation - [in] an array of 4 doubles with one of equation[0], equation[1], or equation[2] being non-zero. Remarks: points on the plane will satisfy x*equation[0] +y*equation[1] + z*equation[2] + equation[3] = 0 Returns: true if valid plane is created.

◆ CreateFromFrame()

bool ON_Plane::CreateFromFrame ( const ON_3dPoint origin,
const ON_3dVector x_dir,
const ON_3dVector y_dir 
)

Description: Construct a plane from a point, and two vectors in the plane. Parameters: origin - [in] point on the plane x_dir - [in] non-zero vector in the plane that determines the xaxis direction. y_dir - [in] non-zero vector not parallel to x_dir that is used to determine the yaxis direction. y_dir does not have to be perpendicular to x_dir. Returns: true if valid plane is created.

◆ CreateFromNormal()

bool ON_Plane::CreateFromNormal ( const ON_3dPoint origin,
const ON_3dVector normal 
)

Description: Create a plane from a point and normal vector. Parameters: origin - [in] point on the plane normal - [in] non-zero normal to the plane Remarks: origin = point, zaxis = unitized normal, xaxis xaxis set with xaxis.PerpendicularTo(zaxis). Returns: true if valid plane is created. See Also: ON_Plane::CreateFromNormalYup

◆ CreateFromNormalYup()

bool ON_Plane::CreateFromNormalYup ( const ON_3dPoint origin,
const ON_3dVector normal,
const ON_3dVector y_up 
)

Description: Construct a plane from a point and normal vector and a vector that projects to the positive y-axis. Parameters: origin - [in] point on the plane normal - [in] non-zero normal to the plane y-up - [in] vector linearly independent from normal that projects to the positive y-axis of the plane Remarks: origin = point, zaxis = unitized normal, xaxis = unitized ( y-up X normal ) yaxis = zaxis X xaxis See Also: ON_Plane::CreateFromNormal

◆ CreateFromPoints()

bool ON_Plane::CreateFromPoints ( const ON_3dPoint origin,
const ON_3dPoint point_on_x,
const ON_3dPoint point_on 
)

Description: Construct a plane from three non-collinear points. Parameters: origin - [in] point on the plane point_on_x - [in] second point in the plane. The xaxis will be parallel to x_point-origin. point_on - [in] third point on the plane that is not collinear with the first two points. yaxis*(y_point-origin) will be > 0. Returns: true if valid plane is created.

◆ DistanceTo()

double ON_Plane::DistanceTo ( const ON_3dPoint point) const

Description: Get signed distance from the plane to a point. Parameters: point - [in] Returns: Signed distance from a point to a plane. Remarks: If the point is on the plane, the distance is 0. If the point is above the plane, the distance is > 0. If the point is below the plane the distance is < 0. The zaxis determines the plane's orientation.

◆ Dump()

void ON_Plane::Dump ( class ON_TextLog ) const

◆ Flip()

bool ON_Plane::Flip ( )

Description: Flip plane orientation by swapping x and y axes, reversing the zaxis, and updating the equation. Returns: true if successful

◆ FromPointList() [1/7]

static ON_Plane ON_Plane::FromPointList ( const class ON_3dPointListRef point_list)
static

Returns: ON_Plane::UnsetPlane if input is not valid.

◆ FromPointList() [2/7]

static ON_Plane ON_Plane::FromPointList ( const ON_SimpleArray< ON_3dPoint > &  point_list)
static

Returns: ON_Plane::UnsetPlane if input is not valid.

◆ FromPointList() [3/7]

static ON_Plane ON_Plane::FromPointList ( const ON_SimpleArray< ON_3fPoint > &  point_list)
static

Returns: ON_Plane::UnsetPlane if input is not valid.

◆ FromPointList() [4/7]

static ON_Plane ON_Plane::FromPointList ( size_t  point_index_count,
const unsigned int *  point_index_list,
const class ON_3dPointListRef point_list 
)
static

Returns: ON_Plane::UnsetPlane if input is not valid.

◆ FromPointList() [5/7]

static ON_Plane ON_Plane::FromPointList ( size_t  point_index_count,
size_t  point_index_stride,
const unsigned int *  point_index_list,
const class ON_3dPointListRef point_list 
)
static

◆ FromPointList() [6/7]

static ON_Plane ON_Plane::FromPointList ( size_t  point_list_count,
const ON_3dPoint point_list 
)
static

Returns: ON_Plane::UnsetPlane if input is not valid.

◆ FromPointList() [7/7]

static ON_Plane ON_Plane::FromPointList ( size_t  point_list_count,
const ON_3fPoint point_list 
)
static

Returns: ON_Plane::UnsetPlane if input is not valid.

◆ GetDistanceToBoundingBox()

bool ON_Plane::GetDistanceToBoundingBox ( const ON_BoundingBox ,
double *  min,
double *  max 
) const
Parameters
minoutput min signed dist from plane to box
maxmax signed dist from plane to box

◆ IsoLine()

ON_Line ON_Plane::IsoLine ( int  dir,
double  c 
) const

Description: Get an isoparameteric line on the plane. Parameters: dir - [in] direction of iso-parametric line 0: first parameter varies and second parameter is constant e.g., line(t) = plane(t,c) 1: first parameter is constant and second parameter varies e.g., line(t) = plane(c,t) c - [in] value of constant parameter Returns: iso-parametric line

◆ IsValid()

bool ON_Plane::IsValid ( ) const

Description: Test plane to see if it is valid. Returns: true if all fields contain reasonable information and equation jibes with point and zaxis.

◆ Morph()

bool ON_Plane::Morph ( const ON_SpaceMorph morph)

Description: Morph plane. Parameters: morph - [in] morph to apply to plane Returns: true if successful Remarks: The resulting plane still has an orthonormal frame

◆ Normal()

const ON_3dVector& ON_Plane::Normal ( ) const

Returns: Plane unit normal.

◆ operator!=()

bool ON_Plane::operator!= ( const ON_Plane ) const

◆ operator==()

bool ON_Plane::operator== ( const ON_Plane ) const

◆ Origin()

const ON_3dPoint& ON_Plane::Origin ( ) const

Returns: Plane origin.

◆ PointAt() [1/2]

ON_3dPoint ON_Plane::PointAt ( double  u,
double  v 
) const

Description: Evaluate a point on the plane Parameters: u - [in] v - [in] evaluation parameters Returns: plane.origin + u*plane.xaxis + v*plane.yaxis

◆ PointAt() [2/2]

ON_3dPoint ON_Plane::PointAt ( double  u,
double  v,
double  w 
) const

Description: Evaluate a point on the plane Parameters: u - [in] v - [in] evaluation parameters w - [in] elevation parameter Returns: plane.origin + u*plane.xaxis + v*plane.yaxis + z*plane.zaxis

◆ Rotate() [1/4]

bool ON_Plane::Rotate ( double  angle,
const ON_3dVector axis 
)

Description: Rotate a plane about its origin. Parameters: angle - [in] rotation angle in radians axis - [in] axis of rotation Returns: true if successful

◆ Rotate() [2/4]

bool ON_Plane::Rotate ( double  angle,
const ON_3dVector axis,
const ON_3dPoint center 
)

Description: Rotate a plane about a point. Parameters: angle - [in] rotation angle in radians axis - [in] axis of rotation center - [in] center of rotation Returns: true if successful

◆ Rotate() [3/4]

bool ON_Plane::Rotate ( double  sin_angle,
double  cos_angle,
const ON_3dVector axis 
)

Description: Rotate a plane about its origin. Parameters: sin_angle - [in] sine of rotation angle cos_angle - [in] cosine of rotation angle axis - [in] axis of rotation Returns: true if successful

◆ Rotate() [4/4]

bool ON_Plane::Rotate ( double  sin_angle,
double  cos_angle,
const ON_3dVector axis,
const ON_3dPoint center 
)

Description: Rotate a plane about a point. Parameters: sin_angle - [in] sine of rotation angle cos_angle - [in] cosine of rotation angle axis - [in] axis of rotation center - [in] center of rotation Returns: true if successful

◆ SetOrigin()

void ON_Plane::SetOrigin ( const ON_3dPoint origin)

Description: Set the origin and update the plane equation Parameters: origin - [in] the new origin

◆ SwapCoordinates()

bool ON_Plane::SwapCoordinates ( int  i,
int  j 
)

Description: Transform a plane by swapping coordinates. Parameters: i - [in] j - [in] indices of coordinates to swap. 0 = x coordinate, 1 = y coordinate, 2 = z coordinate. Returns: true if successful.

◆ Transform()

bool ON_Plane::Transform ( const ON_Xform xform)

For intersections see ON_Intersect();.

Description: Transform plane. Parameters: xform - [in] transformation to apply to plane Returns: true if successful

◆ Translate()

bool ON_Plane::Translate ( const ON_3dVector delta)

Description: Translate a plane. Parameters: delta - [in] translation vector Returns: true if successful

◆ UpdateEquation()

bool ON_Plane::UpdateEquation ( )

Description: Update the plane equation based on the current values of the origin and zaxis. Returns: true if successful. false if zaxis is zero. Remarks: If you modify a plane's origin or zaxis, call UpdateEquation() to set equation[].

◆ Xaxis()

const ON_3dVector& ON_Plane::Xaxis ( ) const

Returns: Plane unit x-axis.

◆ Yaxis()

const ON_3dVector& ON_Plane::Yaxis ( ) const

Returns: Plane unit y-axis.

Member Data Documentation

◆ NanPlane

const static ON_Plane ON_Plane::NanPlane
static

All values are ON_DBL_QNAN.

◆ origin

ON_3dPoint ON_Plane::origin

origin of plane

◆ plane_equation

ON_PlaneEquation ON_Plane::plane_equation

equation of plane

◆ UnsetPlane

const static ON_Plane ON_Plane::UnsetPlane
static

All values are ON_UNSET_VALUE.

◆ World_xy

const static ON_Plane ON_Plane::World_xy
static

◆ World_yz

const static ON_Plane ON_Plane::World_yz
static

◆ World_zx

const static ON_Plane ON_Plane::World_zx
static

◆ xaxis

ON_3dVector ON_Plane::xaxis

unit X axis of plane

◆ yaxis

ON_3dVector ON_Plane::yaxis

unit Y axis of plane

◆ zaxis

ON_3dVector ON_Plane::zaxis

unit Z axis of plane