7#ifndef PXR_BASE_GF_PLANE_H
8#define PXR_BASE_GF_PLANE_H
15#include "pxr/base/gf/api.h"
20PXR_NAMESPACE_OPEN_SCOPE
48 Set(normal, distanceToOrigin);
75 void Set(
const GfVec3d &normal,
double distanceToOrigin) {
76 _normal = normal.GetNormalized();
77 _distance = distanceToOrigin;
118 return (_normal == p._normal &&
119 _distance == p._distance);
125 return ! (*
this == p);
132 return p * _normal - _distance;
149 _distance = -_distance;
197PXR_NAMESPACE_CLOSE_SCOPE
GF_API bool GfFitPlaneToPoints(const std::vector< GfVec3d > &points, GfPlane *fitPlane)
Fits a plane to the given points.
Stores a 4x4 matrix of double elements.
Basic type: 3-dimensional plane.
GF_API GfVec4d GetEquation() const
Give the coefficients of the equation of the plane.
GfPlane(const GfVec3d &normal, double distanceToOrigin)
This constructor sets this to the plane perpendicular to normal and at distance units from the origin...
bool operator!=(const GfPlane &p) const
Component-wise inequality test.
void Set(const GfVec3d &normal, double distanceToOrigin)
Sets this to the plane perpendicular to normal and at distance units from the origin.
bool IntersectsPositiveHalfSpace(const GfVec3d &pt) const
Returns true if the given point is on the plane or within its positive half space.
GfPlane()
The default constructor leaves the plane parameters undefined.
GfPlane(const GfVec4d &eqn)
This constructor creates a plane given by the equation eqn[0] * x + eqn[1] * y + eqn[2] * z + eqn[3] ...
GfPlane(const GfVec3d &p0, const GfVec3d &p1, const GfVec3d &p2)
This constructor sets this to the plane that contains the three given points.
bool operator==(const GfPlane &p) const
Component-wise equality test.
GF_API GfPlane & Transform(const GfMatrix4d &matrix)
Transforms the plane by the given matrix.
GF_API void Set(const GfVec3d &normal, const GfVec3d &point)
This constructor sets this to the plane perpendicular to normal and that passes through point.
GfPlane(const GfVec3d &normal, const GfVec3d &point)
This constructor sets this to the plane perpendicular to normal and that passes through point.
GfVec3d Project(const GfVec3d &p) const
Return the projection of p onto the plane.
GF_API void Set(const GfVec3d &p0, const GfVec3d &p1, const GfVec3d &p2)
This constructor sets this to the plane that contains the three given points.
const GfVec3d & GetNormal() const
Returns the unit-length normal vector of the plane.
double GetDistanceFromOrigin() const
Returns the distance of the plane from the origin.
double GetDistance(const GfVec3d &p) const
Returns the distance of point from the plane.
void Reorient(const GfVec3d &p)
Flip the plane normal (if necessary) so that p is in the positive halfspace.
GF_API void Set(const GfVec4d &eqn)
This method sets this to the plane given by the equation eqn[0] * x + eqn[1] * y + eqn[2] * z + eqn[3...
GF_API bool IntersectsPositiveHalfSpace(const GfRange3d &box) const
Returns true if the given aligned bounding box is at least partially on the positive side (the one th...
Basic type: 3-dimensional floating point range.
Basic type for a vector of 3 double components.
Basic type for a vector of 4 double components.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].