#include <opennurbs_plane.h>
Public Member Functions | |
ON_Plane () | |
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). More... | |
ON_Plane (const ON_3dPoint &origin, const ON_3dVector &normal) | |
Construct a plane from a point and normal vector. More... | |
ON_Plane (const ON_3dPoint &origin, const ON_3dVector &x_dir, const ON_3dVector &y_dir) | |
Construct a plane from a point, and two vectors in the plane. More... | |
ON_Plane (const ON_3dPoint &origin, const ON_3dPoint &x_point, const ON_3dPoint &y_point) | |
Construct a plane from three non-collinear points. More... | |
ON_Plane (const double equation[4]) | |
Construct a plane from an equation. More... | |
ON_Plane (const ON_PlaneEquation &plane_equation) | |
~ON_Plane () | |
bool | ClosestPointTo (ON_3dPoint world_point, double *u, double *v) const |
Get point on plane that is closest to a given point. More... | |
ON_3dPoint | ClosestPointTo (ON_3dPoint point) const |
Get point on plane that is closest to a given point. More... | |
bool | CreateFromEquation (const double equation[4]) |
Construct a plane from an equation. More... | |
bool | CreateFromEquation (const class ON_PlaneEquation &plane_equation) |
bool | CreateFromFrame (const ON_3dPoint &origin, const ON_3dVector &x_dir, const ON_3dVector &y_dir) |
Construct a plane from a point, and two vectors in the plane. More... | |
bool | CreateFromNormal (const ON_3dPoint &origin, const ON_3dVector &normal) |
Create a plane from a point and normal vector. More... | |
bool | CreateFromPoints (const ON_3dPoint &origin, const ON_3dPoint &point_on_x, const ON_3dPoint &point_on) |
Construct a plane from three non-collinear points. More... | |
double | DistanceTo (const ON_3dPoint &point) const |
Get signed distance from the plane to a point. More... | |
bool | Flip () |
Flip plane orientation by swapping x and y axes, reversing the zaxis, and updating the equation. More... | |
bool | GetDistanceToBoundingBox (const ON_BoundingBox &, double *min, double *max) const |
ON_Line | IsoLine (int dir, double c) const |
Get an isoparameteric line on the plane. More... | |
bool | IsValid () const |
Test plane to see if it is valid. More... | |
const ON_3dVector & | Normal () const |
bool | operator!= (const ON_Plane &) const |
bool | operator== (const ON_Plane &) const |
const ON_3dPoint & | Origin () const |
ON_3dPoint | PointAt (double u, double v) const |
Evaluate a point on the plane More... | |
ON_3dPoint | PointAt (double u, double v, double w) const |
Evaluate a point on the plane More... | |
bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis) |
Rotate a plane about its origin. More... | |
bool | Rotate (double angle, const ON_3dVector &axis) |
Rotate a plane about its origin. More... | |
bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis, const ON_3dPoint ¢er) |
Rotate a plane about a point. More... | |
bool | Rotate (double angle, const ON_3dVector &axis, const ON_3dPoint ¢er) |
Rotate a plane about a point. More... | |
void | SetOrigin (const ON_3dPoint &origin) |
Set the origin and update the plane equation More... | |
bool | SwapCoordinates (int i, int j) |
Transform a plane by swapping coordinates. More... | |
bool | Transform (const ON_Xform &xform) |
For intersections see ON_Intersect();. More... | |
bool | Translate (const ON_3dVector &delta) |
Translate a plane. More... | |
bool | UpdateEquation () |
Update the plane equation based on the current values of the origin and zaxis. More... | |
const ON_3dVector & | Xaxis () const |
const ON_3dVector & | Yaxis () const |
Static Public Member Functions | |
static ON_Plane | FromPointList (size_t point_list_count, const ON_3dPoint *point_list) |
static ON_Plane | FromPointList (const ON_SimpleArray< ON_3dPoint > &point_list) |
static ON_Plane | FromPointList (size_t point_list_count, const ON_3fPoint *point_list) |
static ON_Plane | FromPointList (const ON_SimpleArray< ON_3fPoint > &point_list) |
static ON_Plane | FromPointList (const class ON_3dPointListRef &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) |
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 | |
static const ON_Plane | UnsetPlane |
All values are ON_UNSET_VALUE. More... | |
static const ON_Plane | World_xy |
world plane coordinate system ON_Plane(ON_3dPoint::Origin, ON_3dVector::XAxis, ON_3dVector::YAxis); More... | |
ON_Plane::ON_Plane | ( | ) |
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::ON_Plane | ( | const ON_3dPoint & | origin, |
const ON_3dVector & | normal | ||
) |
Construct a plane from a point and normal vector.
origin | [in] point on the plane |
normal | [in] non-zero normal to the plane |
origin = point, zaxis = unitized normal, xaxis xaxis set with xaxis.PerpindicularTo(zaxis).
ON_Plane::ON_Plane | ( | const ON_3dPoint & | origin, |
const ON_3dVector & | x_dir, | ||
const ON_3dVector & | y_dir | ||
) |
Construct a plane from a point, and two vectors in the plane.
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::ON_Plane | ( | const ON_3dPoint & | origin, |
const ON_3dPoint & | x_point, | ||
const ON_3dPoint & | y_point | ||
) |
Construct a plane from three non-collinear points.
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::ON_Plane | ( | const double | equation[4] | ) |
Construct a plane from an equation.
equation | [in] an array of 4 doubles with one of equation[0], equation[1], or equation[2] being non-zero. |
ON_Plane::ON_Plane | ( | const ON_PlaneEquation & | plane_equation | ) |
ON_Plane::~ON_Plane | ( | ) |
bool ON_Plane::ClosestPointTo | ( | ON_3dPoint | world_point, |
double * | u, | ||
double * | v | ||
) | const |
Get point on plane that is closest to a given point.
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. |
ON_3dPoint ON_Plane::ClosestPointTo | ( | ON_3dPoint | point | ) | const |
Get point on plane that is closest to a given point.
point | [in] |
bool ON_Plane::CreateFromEquation | ( | const double | equation[4] | ) |
Construct a plane from an equation.
equation | [in] an array of 4 doubles with one of equation[0], equation[1], or equation[2] being non-zero. |
points on the plane will satisfy x*equation[0] +y*equation[1] + z*equation[2] + equation[3] = 0
bool ON_Plane::CreateFromEquation | ( | const class ON_PlaneEquation & | plane_equation | ) |
bool ON_Plane::CreateFromFrame | ( | const ON_3dPoint & | origin, |
const ON_3dVector & | x_dir, | ||
const ON_3dVector & | y_dir | ||
) |
Construct a plane from a point, and two vectors in the plane.
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. |
bool ON_Plane::CreateFromNormal | ( | const ON_3dPoint & | origin, |
const ON_3dVector & | normal | ||
) |
Create a plane from a point and normal vector.
origin | [in] point on the plane |
normal | [in] non-zero normal to the plane |
origin = point, zaxis = unitized normal, xaxis xaxis set with xaxis.PerpindicularTo(zaxis).
bool ON_Plane::CreateFromPoints | ( | const ON_3dPoint & | origin, |
const ON_3dPoint & | point_on_x, | ||
const ON_3dPoint & | point_on | ||
) |
Construct a plane from three non-collinear points.
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. |
double ON_Plane::DistanceTo | ( | const ON_3dPoint & | point | ) | const |
Get signed distance from the plane to a point.
point | [in] |
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.
bool ON_Plane::Flip | ( | ) |
Flip plane orientation by swapping x and y axes, reversing the zaxis, and updating the equation.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
bool ON_Plane::GetDistanceToBoundingBox | ( | const ON_BoundingBox & | , |
double * | min, | ||
double * | max | ||
) | const |
ON_Line ON_Plane::IsoLine | ( | int | dir, |
double | c | ||
) | const |
Get an isoparameteric line on the plane.
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 |
bool ON_Plane::IsValid | ( | ) | const |
Test plane to see if it is valid.
const ON_3dVector& ON_Plane::Normal | ( | ) | const |
bool ON_Plane::operator!= | ( | const ON_Plane & | ) | const |
bool ON_Plane::operator== | ( | const ON_Plane & | ) | const |
const ON_3dPoint& ON_Plane::Origin | ( | ) | const |
ON_3dPoint ON_Plane::PointAt | ( | double | u, |
double | v | ||
) | const |
Evaluate a point on the plane
u | [in] |
v | [in] evaulation parameters |
ON_3dPoint ON_Plane::PointAt | ( | double | u, |
double | v, | ||
double | w | ||
) | const |
Evaluate a point on the plane
u | [in] |
v | [in] evaluation parameters |
w | [in] elevation parameter |
bool ON_Plane::Rotate | ( | double | sin_angle, |
double | cos_angle, | ||
const ON_3dVector & | axis | ||
) |
Rotate a plane about its origin.
sin_angle | [in] sine of rotation angle |
cos_angle | [in] cosine of rotation angle |
axis | [in] axis of rotation |
bool ON_Plane::Rotate | ( | double | angle, |
const ON_3dVector & | axis | ||
) |
Rotate a plane about its origin.
angle | [in] rotation angle in radians |
axis | [in] axis of rotation |
bool ON_Plane::Rotate | ( | double | sin_angle, |
double | cos_angle, | ||
const ON_3dVector & | axis, | ||
const ON_3dPoint & | center | ||
) |
Rotate a plane about a point.
sin_angle | [in] sine of rotation angle |
cos_angle | [in] cosine of rotation angle |
axis | [in] axis of rotation |
center | [in] center of rotation |
bool ON_Plane::Rotate | ( | double | angle, |
const ON_3dVector & | axis, | ||
const ON_3dPoint & | center | ||
) |
Rotate a plane about a point.
angle | [in] rotation angle in radians |
axis | [in] axis of rotation |
center | [in] center of rotation |
void ON_Plane::SetOrigin | ( | const ON_3dPoint & | origin | ) |
Set the origin and update the plane equation
origin | [in] the new origin |
bool ON_Plane::SwapCoordinates | ( | int | i, |
int | j | ||
) |
Transform a plane by swapping coordinates.
i | [in] |
j | [in] indices of coordinates to swap. 0 = x coordinate, 1 = y coordinate, 2 = z coordinate. |
bool ON_Plane::Transform | ( | const ON_Xform & | xform | ) |
For intersections see ON_Intersect();.
Transform plane.
xform | [in] transformation to apply to plane |
bool ON_Plane::Translate | ( | const ON_3dVector & | delta | ) |
Translate a plane.
delta | [in] translation vector |
bool ON_Plane::UpdateEquation | ( | ) |
Update the plane equation based on the current values of the origin and zaxis.
If you modify a plane's origin or zaxis, call UpdateEquation() to set equation[].
const ON_3dVector& ON_Plane::Xaxis | ( | ) | const |
const ON_3dVector& ON_Plane::Yaxis | ( | ) | const |
ON_3dPoint ON_Plane::origin |
origin of plane
ON_PlaneEquation ON_Plane::plane_equation |
equation of plane
|
static |
All values are ON_UNSET_VALUE.
|
static |
world plane coordinate system ON_Plane(ON_3dPoint::Origin, ON_3dVector::XAxis, ON_3dVector::YAxis);
ON_3dVector ON_Plane::xaxis |
unit X axis of plane
ON_3dVector ON_Plane::yaxis |
unit Y axis of plane
ON_3dVector ON_Plane::zaxis |
unit Z axis of plane