Rhino C++ API
8.14
|
#include <opennurbs_point.h>
Public Member Functions | |
ON_PlaneEquation () | |
ON_PlaneEquation (double xx, double yy, double zz, double dd) | |
ON_3dPoint | ClosestPointTo (ON_3dPoint point) const |
bool | Create (ON_3dPoint P, ON_3dVector N) |
ON_3dVector | Direction () const |
double | DirectionLength () const |
void | Dump (class ON_TextLog &) const |
bool | IsNearerThan (const class ON_BezierCurve &bezcrv, double s0, double s1, int sample_count, double endpoint_tolerance, double interior_tolerance, double *smin, double *smax) const |
int | IsParallelTo (const ON_PlaneEquation &other, double angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE) const |
bool | IsSet () const |
bool | IsUnitized () const |
bool | IsValid () const |
double | MaximumAbsoluteValueAt (bool bRational, int point_count, int point_stride, const double *points, double stop_value) const |
double | MaximumCoefficient () const |
double | MaximumValueAt (bool bRational, int point_count, int point_stride, const double *points, double stop_value) const |
double | MaximumValueAt (const class ON_CurveLeafBox &crvleafbox) const |
double | MaximumValueAt (const class ON_SurfaceLeafBox &srfleafbox) const |
double | MaximumValueAt (const ON_BoundingBox &bbox) const |
double | MinimumValueAt (bool bRational, int point_count, int point_stride, const double *points, double stop_value) const |
double | MinimumValueAt (const class ON_CurveLeafBox &crvleafbox) const |
double | MinimumValueAt (const class ON_SurfaceLeafBox &srfleafbox) const |
double | MinimumValueAt (const ON_BoundingBox &bbox) const |
ON_PlaneEquation | NegatedPlaneEquation () const |
bool | operator!= (const ON_PlaneEquation &) const |
bool | operator== (const ON_PlaneEquation &) const |
double & | operator[] (int) |
double | operator[] (int) const |
double & | operator[] (unsigned int) |
double | operator[] (unsigned int) const |
bool | Transform (const ON_Xform &xform) |
ON_PlaneEquation | UnitizedPlaneEquation () const |
ON_3dVector | UnitNormal () const |
double | ValueAt (double x, double y, double z) const |
double * | ValueAt (int Pcount, const ON_3dPoint *P, double *value, double value_range[2]) const |
double * | ValueAt (int Pcount, const ON_3fPoint *P, double *value, double value_range[2]) const |
double | ValueAt (ON_3dPoint P) const |
double | ValueAt (ON_3dVector P) const |
double | ValueAt (ON_4dPoint P) const |
ON_Interval | ValueRange (const class ON_3dPointListRef &point_list) const |
ON_Interval | ValueRange (const ON_SimpleArray< ON_3dPoint > &point_list) const |
ON_Interval | ValueRange (const ON_SimpleArray< ON_3fPoint > &point_list) const |
ON_Interval | ValueRange (size_t point_index_count, const unsigned int *point_index_list, const class ON_3dPointListRef &point_list) const |
ON_Interval | ValueRange (size_t point_index_count, size_t point_index_stride, const unsigned int *point_index_list, const class ON_3dPointListRef &point_list) const |
ON_Interval | ValueRange (size_t point_list_count, const ON_3dPoint *point_list) const |
ON_Interval | ValueRange (size_t point_list_count, const ON_3fPoint *point_list) const |
double | ZeroTolerance () const |
Static Public Member Functions | |
static const ON_PlaneEquation | CreateFromPointAndNormal (ON_3dPoint point, ON_3dVector normal) |
static const ON_PlaneEquation | CreateFromThreePoints (ON_3dPoint pointA, ON_3dPoint pointB, ON_3dPoint pointC) |
static void | Set (ON_PlaneEquation &plane_equation, double x, double y, double z, double d) |
Public Attributes | |
double | d |
4th coefficient of the plane equation. More... | |
double | x |
double | y |
double | z |
Static Public Attributes | |
static const ON_PlaneEquation | NanPlaneEquation |
(ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN) More... | |
static const ON_PlaneEquation | UnsetPlaneEquation |
(ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE) More... | |
static const ON_PlaneEquation | WorldXY |
(0,0,1,0) More... | |
static const ON_PlaneEquation | WorldYZ |
(1,0,0,0) More... | |
static const ON_PlaneEquation | WorldZX |
(0,1,0,0) More... | |
static const ON_PlaneEquation | ZeroPlaneEquation |
(0.0,0.0,0.0,0.0) More... | |
Description: Typically the vector portion is a unit vector and m_d = -(x*P.x + y*P.y + z*P.z) for a point P on the plane.
ON_PlaneEquation::ON_PlaneEquation | ( | ) |
ON_PlaneEquation::ON_PlaneEquation | ( | double | xx, |
double | yy, | ||
double | zz, | ||
double | dd | ||
) |
ON_3dPoint ON_PlaneEquation::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 the input point.
bool ON_PlaneEquation::Create | ( | ON_3dPoint | P, |
ON_3dVector | N | ||
) |
Description: Sets (x,y,z) to a unitized N and then sets d = -(x*P.x + y*P.y + z*P.z). Parameters: P - [in] point on the plane N - [in] vector perpendicular to the plane Returns: true if input is valid.
|
static |
Returns: If point is valid and normal is nonzero, a unitized plane equation is returned. Otherwise ON_PlaneEquation::NanPlaneEquation is returned.
|
static |
Returns: If the three points are valid and not collinear, a unitized plane equation is returned. Otherwise ON_PlaneEquation::NanPlaneEquation is returned.
ON_3dVector ON_PlaneEquation::Direction | ( | ) | const |
Returns: Direction (x,y,z)
double ON_PlaneEquation::DirectionLength | ( | ) | const |
void ON_PlaneEquation::Dump | ( | class ON_TextLog & | ) | const |
bool ON_PlaneEquation::IsNearerThan | ( | const class ON_BezierCurve & | bezcrv, |
double | s0, | ||
double | s1, | ||
int | sample_count, | ||
double | endpoint_tolerance, | ||
double | interior_tolerance, | ||
double * | smin, | ||
double * | smax | ||
) | const |
Description: Test points on a bezier curve to see if they are near the plane. Parameters: bezcrv - [in] s0 - [in] s1 - [in] the interval from s0 to s1 is tested (s0 < s1) sample_count - [in] number of interior points to test.
Numbers like 1, 3, 7, 15, ... work best. endpoint_tolerance - [in] If >= 0, then the end points are tested to see if the distance from the endpoints is <= endpoint_tolerance. interior_tolerance - [in] (>=0 and >=endpoint_tolerance) This tolerance is used to test the interior sample points. smin - [put] If not nullptr, *smin = bezier parameter of nearest test point. smax - [put] If not nullptr, *smax = bezier parameter of farthest test point. If false is returned, this is the parameter of the test point that failed. Returns: True if all the tested points passed the tolerance test. False if at least one tested point failed the tolerance test. (The test terminates when the first failure is encountered.)
int ON_PlaneEquation::IsParallelTo | ( | const ON_PlaneEquation & | other, |
double | angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE |
||
) | const |
Returns 1: this and other vectors are parallel -1: this and other vectors are anti-parallel 0: this and other vectors are not parallel or at least one of the vectors is zero
other | other plane equation |
angle_tolerance | optional angle tolerance (radians) |
bool ON_PlaneEquation::IsSet | ( | ) | const |
Description: returns true if x, y, z, d are valid, finite doubles and at least one of x, y or z is not zero.
bool ON_PlaneEquation::IsUnitized | ( | ) | const |
Description: returns true if x, y, z, d are valid, finite doubles and x^2 + y^2 + z^2 = 1.
bool ON_PlaneEquation::IsValid | ( | ) | const |
Description: returns true if x, y, z, d are valid, finite doubles. Remarks: this function will return true if x, y and z are all zero. See Also: ON_PlaneEquation::IsSet().
double ON_PlaneEquation::MaximumAbsoluteValueAt | ( | bool | bRational, |
int | point_count, | ||
int | point_stride, | ||
const double * | points, | ||
double | stop_value | ||
) | const |
Description: Get the maximum absolute value of the plane equation on a set of 3d points. Parameters: bRational - [in] False if the points are euclidean (x,y,z) True if the points are homogeneous rational (x,y,z,w) (x/w,y/w,z/w) is used to evaluate the value. point_count - [in] point_stride - [in] i-th point's x coordinate = points[i*point_stride] points - [in] coordinates of points stop_value - [in] If stop_value >= 0.0, then the evaluation stops if an absolute value > stop_value is found. If stop_value < 0.0 or stop_value is invalid, then stop_value is ignored. Returns: Maximum value of the plane equation on the point list. If the input is not valid, then ON_UNSET_VALUE is returned.
double ON_PlaneEquation::MaximumCoefficient | ( | ) | const |
double ON_PlaneEquation::MaximumValueAt | ( | bool | bRational, |
int | point_count, | ||
int | point_stride, | ||
const double * | points, | ||
double | stop_value | ||
) | const |
Description: Get the maximum value of the plane equation on a set of 3d points. Parameters: bRational - [in] False if the points are euclidean (x,y,z) True if the points are homogeneous rational (x,y,z,w) (x/w,y/w,z/w) is used to evaluate the value. point_count - [in] point_stride - [in] i-th point's x coordinate = points[i*point_stride] points - [in] coordinates of points stop_value - [in] If stop_value is valid and not ON_UNSET_VALUE, then the evaluation stops if a value > stop_value is found. If stop_value = ON_UNSET_VALUE, then stop_value is ignored. Returns: Maximum value of the plane equation on the point list. If the input is not valid, then ON_UNSET_VALUE is returned.
double ON_PlaneEquation::MaximumValueAt | ( | const class ON_CurveLeafBox & | crvleafbox | ) | const |
Description: Get the maximum value of the plane equation on a bounding box. Parameters: crvleafbox - [in] Returns: Maximum value of the plane equation on the curve leaf box.
double ON_PlaneEquation::MaximumValueAt | ( | const class ON_SurfaceLeafBox & | srfleafbox | ) | const |
Description: Get the maximum value of the plane equation on a bounding box. Parameters: bbox - [in] Returns: Maximum value of the plane equation on the bounding box.
double ON_PlaneEquation::MaximumValueAt | ( | const ON_BoundingBox & | bbox | ) | const |
Description: Get the maximum value of the plane equation on a bounding box. Parameters: bbox - [in] Returns: Maximum value of the plane equation on the bounding box.
double ON_PlaneEquation::MinimumValueAt | ( | bool | bRational, |
int | point_count, | ||
int | point_stride, | ||
const double * | points, | ||
double | stop_value | ||
) | const |
Description: Get the minimum value of the plane equation on a set of 3d points. Parameters: bRational - [in] False if the points are euclidean (x,y,z) True if the points are homogeneous rational (x,y,z,w) (x/w,y/w,z/w) is used to evaluate the value. point_count - [in] point_stride - [in] i-th point's x coordinate = points[i*point_stride] points - [in] coordinates of points stop_value - [in] If stop_value is valid and not ON_UNSET_VALUE, then the evaluation stops if a value < stop_value is found. If stop_value = ON_UNSET_VALUE, then stop_value is ignored. Returns: Maximum value of the plane equation on the point list. If the input is not valid, then ON_UNSET_VALUE is returned.
double ON_PlaneEquation::MinimumValueAt | ( | const class ON_CurveLeafBox & | crvleafbox | ) | const |
Description: Get the minimum value of the plane equation on a bounding box. Parameters: crvleafbox - [in] Returns: Minimum value of the plane equation on the curve leaf box.
double ON_PlaneEquation::MinimumValueAt | ( | const class ON_SurfaceLeafBox & | srfleafbox | ) | const |
Description: Get the minimum value of the plane equation on a bounding box. Parameters: bbox - [in] Returns: Minimum value of the plane equation on the bounding box.
double ON_PlaneEquation::MinimumValueAt | ( | const ON_BoundingBox & | bbox | ) | const |
Description: Get the minimum value of the plane equation on a bounding box. Parameters: bbox - [in] Returns: Minimum value of the plane equation on the bounding box.
ON_PlaneEquation ON_PlaneEquation::NegatedPlaneEquation | ( | ) | const |
Returns: The plane equation whose coefficient values are the negative of the coefficient values in this, provided the coefficient value is valid. Any invalid coefficient values are copied.
bool ON_PlaneEquation::operator!= | ( | const ON_PlaneEquation & | ) | const |
bool ON_PlaneEquation::operator== | ( | const ON_PlaneEquation & | ) | const |
double& ON_PlaneEquation::operator[] | ( | int | ) |
index operators mimic double[4] behavior Return null refs or ON_UNSET_VALUE for out-of-range indices
double ON_PlaneEquation::operator[] | ( | int | ) | const |
double& ON_PlaneEquation::operator[] | ( | unsigned int | ) |
double ON_PlaneEquation::operator[] | ( | unsigned int | ) | const |
|
static |
bool ON_PlaneEquation::Transform | ( | const ON_Xform & | xform | ) |
Description: Transform the plane equation so that, if e0 is the initial equation, e1 is transformed equation and P is a point, then e0.ValueAt(P) = e1.ValueAt(xform*P). Parameters: xform - [in] Invertable transformation. Returns: True if the plane equation was successfully transformed. False if xform is not invertable or the equation is not valid. Remarks: This function has to invert xform. If you have apply the same transformation to a bunch of planes, then it will be more efficient to calculate xform's inverse transpose and apply the resulting transformation to the equation's coefficients as if they were 4d point coordinates.
ON_PlaneEquation ON_PlaneEquation::UnitizedPlaneEquation | ( | ) | const |
Returns: The plane equation whose first three coefficient values are a unit vector.
ON_3dVector ON_PlaneEquation::UnitNormal | ( | ) | const |
Returns: Unitized direction or zero vector if not set.
double ON_PlaneEquation::ValueAt | ( | double | x, |
double | y, | ||
double | z | ||
) | const |
double* ON_PlaneEquation::ValueAt | ( | int | Pcount, |
const ON_3dPoint * | P, | ||
double * | value, | ||
double | value_range[2] | ||
) | const |
double* ON_PlaneEquation::ValueAt | ( | int | Pcount, |
const ON_3fPoint * | P, | ||
double * | value, | ||
double | value_range[2] | ||
) | const |
Description: Evaluate the plane at a list of point values. Parameters: Pcount - [in] number of points P - [in] points value - [in] If not null, value[] must be an array of length at least Pcount. The values will be stored in this array. If null, the an array will be allocated with onmalloc() and returned. value_range - [out] If not null, the range of values will be returned here. Returns: An array of Pcount values. If the input parameter value was null, then the array is allocated on the heap using onmalloc() and the caller is responsible for calling onfree() when finished. If the input is not valid, null is returned.
double ON_PlaneEquation::ValueAt | ( | ON_3dPoint | P | ) | const |
Description: Evaluate the plane at a point. Parameters: P - [in] Returns: x*P.x + y*P.y + z*P.z + d;
double ON_PlaneEquation::ValueAt | ( | ON_3dVector | P | ) | const |
double ON_PlaneEquation::ValueAt | ( | ON_4dPoint | P | ) | const |
ON_Interval ON_PlaneEquation::ValueRange | ( | const class ON_3dPointListRef & | point_list | ) | const |
Returns: ON_Interval::EmptyInterval if input is not valid.
ON_Interval ON_PlaneEquation::ValueRange | ( | const ON_SimpleArray< ON_3dPoint > & | point_list | ) | const |
Returns: ON_Interval::EmptyInterval if input is not valid.
ON_Interval ON_PlaneEquation::ValueRange | ( | const ON_SimpleArray< ON_3fPoint > & | point_list | ) | const |
Returns: ON_Interval::EmptyInterval if input is not valid.
ON_Interval ON_PlaneEquation::ValueRange | ( | size_t | point_index_count, |
const unsigned int * | point_index_list, | ||
const class ON_3dPointListRef & | point_list | ||
) | const |
Returns: ON_Interval::EmptyInterval if input is not valid.
ON_Interval ON_PlaneEquation::ValueRange | ( | size_t | point_index_count, |
size_t | point_index_stride, | ||
const unsigned int * | point_index_list, | ||
const class ON_3dPointListRef & | point_list | ||
) | const |
ON_Interval ON_PlaneEquation::ValueRange | ( | size_t | point_list_count, |
const ON_3dPoint * | point_list | ||
) | const |
Returns: ON_Interval::EmptyInterval if input is not valid.
ON_Interval ON_PlaneEquation::ValueRange | ( | size_t | point_list_count, |
const ON_3fPoint * | point_list | ||
) | const |
Returns: ON_Interval::EmptyInterval if input is not valid.
double ON_PlaneEquation::ZeroTolerance | ( | ) | const |
Description: This function calculates and evaluates points that would be exactly on the plane if double precision arithmetic were mathematically perfect and returns the largest value of the evaluations.
double ON_PlaneEquation::d |
4th coefficient of the plane equation.
|
static |
(ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN)
|
static |
(ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE)
C++ defaults for construction, destruction, copies, and operator= work fine.
|
static |
(0,0,1,0)
|
static |
(1,0,0,0)
|
static |
(0,1,0,0)
double ON_PlaneEquation::x |
double ON_PlaneEquation::y |
double ON_PlaneEquation::z |
|
static |
(0.0,0.0,0.0,0.0)