Rhino C++ API  8.6
Public Member Functions | Public Attributes | List of all members
ON_SurfaceLeafBox Class Reference

#include <opennurbs_plus.h>

Public Member Functions

 ON_SurfaceLeafBox ()
 
bool GetClosestPointSeed (const ON_3dPoint &P, double *t0, double *t1) const
 
bool GetSideEquation (int side, ON_PlaneEquation &e) const
 
double Height () const
 
bool IsFartherThan (double d, const ON_3dPoint &P) const
 
bool IsFartherThan (double d, const ON_BoundingBox &bbox) const
 
bool IsFartherThan (double d, const ON_CurveLeafBox &crvleafbox) const
 
bool IsFartherThan (double d, const ON_Line &L) const
 
bool IsFartherThan (double d, const ON_SurfaceLeafBox &srfleafbox) const
 
bool IsPointIn (const ON_3dPoint &P) const
 
bool IsValid (ON_TextLog *text_log) const
 C++ default copy constructor, operator =, and destructor work fine. More...
 
double MinimumDistanceTo (const ON_3dPoint &P) const
 
double MinimumDistanceTo (const ON_BoundingBox &bbox) const
 
double MinimumDistanceTo (const ON_CurveLeafBox &crvleafbox) const
 
double MinimumDistanceTo (const ON_Line &L) const
 
double MinimumDistanceTo (const ON_SurfaceLeafBox &srfleafbox) const
 
ON_3dPoint PointAt (double s, double t) const
 
bool Set (const ON_BezierSurface *bez)
 
void SetEquationsHelper (const ON_BezierSurface *bez)
 
bool SetPlaneAndMonoHelper (const ON_BezierSurface *bez, double maxheight=0.0)
 

Public Attributes

bool m_bDegen
 True if the m_q[] are not convex (the m_c[] are always convex) More...
 
bool m_bMono
 
bool m_bPlane
 
bool m_bValid
 
ON_2dPoint m_c [4]
 
ON_3dVector m_e [4]
 
double m_h [2]
 
ON_Plane m_plane
 
ON_2dPoint m_q [4]
 

Constructor & Destructor Documentation

◆ ON_SurfaceLeafBox()

ON_SurfaceLeafBox::ON_SurfaceLeafBox ( )

Member Function Documentation

◆ GetClosestPointSeed()

bool ON_SurfaceLeafBox::GetClosestPointSeed ( const ON_3dPoint P,
double *  t0,
double *  t1 
) const

Description: Quickly estimate curve and surface parameters for finding closest points. Parameters: P - [in] another point crvleafbox - [in] srfleafbox - [in] t0 - [out] first surface parameter (0 <= t <= 1). t1 - [out] second surface parameter (0 <= t <= 1). Returns: True if the estimates were calculated. See Also: ON_CurveLeafBox::GetClosestPointSeed

◆ GetSideEquation()

bool ON_SurfaceLeafBox::GetSideEquation ( int  side,
ON_PlaneEquation e 
) const

Description: Get the equation of the 3d plane that lies on the side of the leaf box. Parameters: side - [in] 0: side from m_q[0] to m_q[1] 1: side from m_q[1] to m_q[2] 2: side from m_q[2] to m_q[3] 3: side from m_q[3] to m_q[0] 4: bottom 5: top e - [out] The leaf box lies on the negative side of the plane. Returns: True if successful.

◆ Height()

double ON_SurfaceLeafBox::Height ( ) const

Description: "Height" of the surface leaf box. Returns: Height of the surface leaf box.

◆ IsFartherThan() [1/5]

bool ON_SurfaceLeafBox::IsFartherThan ( double  d,
const ON_3dPoint P 
) const

Description: Quickly find an upper bound on the shortest distance between the this leaf box and the other object. Parameters: P - [in] another point bbox - [in] another axis aligned bounding box crvleafbox - [in] another curve tree node leaf box srfleafbox - [in] another surface tree node leaf box Returns: A distance that is greater than or equal to the longest distance from this leaf box to the other object. Put another way, if Q is any point on this leaf box and P is any point on the other object, then then P.DistanceTo(Q) <= MaximumDistanceTo(other). double MaximumDistanceTo( ON_3dPoint P ) const; double MaximumDistanceTo( const ON_BoundingBox& bbox ) const; double MaximumDistanceTo( const ON_CurveLeafBox& crvleafbox ) const; double MaximumDistanceTo( const ON_SurfaceLeafBox& srfleafbox ) const; Description: Quickly determine if the shortest distance between this leaf box and the other object is greater than d. Parameters: d - [in] distance (> 0.0) P - [in] another point bbox - [in] another axis aligned bounding box crvleafbox - [in] another curve tree node leaf box srfleafbox - [in] another surface tree node leaf box Returns: True if the shortest distance from this leaf box to the other object is greater than d. It is not the case that false means that the shortest distance is less than or equal to d.

◆ IsFartherThan() [2/5]

bool ON_SurfaceLeafBox::IsFartherThan ( double  d,
const ON_BoundingBox bbox 
) const

◆ IsFartherThan() [3/5]

bool ON_SurfaceLeafBox::IsFartherThan ( double  d,
const ON_CurveLeafBox crvleafbox 
) const

◆ IsFartherThan() [4/5]

bool ON_SurfaceLeafBox::IsFartherThan ( double  d,
const ON_Line L 
) const

◆ IsFartherThan() [5/5]

bool ON_SurfaceLeafBox::IsFartherThan ( double  d,
const ON_SurfaceLeafBox srfleafbox 
) const

◆ IsPointIn()

bool ON_SurfaceLeafBox::IsPointIn ( const ON_3dPoint P) const

Description: Determine if the point P is in this surface leaf box. Parameters: P - [in] Returns: True if the point is in the surface leaf box.

◆ IsValid()

bool ON_SurfaceLeafBox::IsValid ( ON_TextLog text_log) const

C++ default copy constructor, operator =, and destructor work fine.

Description: Test the leaf box to make sure its settings are valid. Parameters: text_log - [in] If an error is found and text_log is not null, then a short description of the problem is printed to the text_log. Returns: True if the leaf box is valid, and false otherwise.

◆ MinimumDistanceTo() [1/5]

double ON_SurfaceLeafBox::MinimumDistanceTo ( const ON_3dPoint P) const

Description: Quickly find a lower bound on the distance between the this leaf box and the other object. Parameters: P - [in] another point bbox - [in] another axis aligned bounding box crvleafbox - [in] another curve tree node leaf box srfleafbox - [in] another surface tree node leaf box Returns: A distance that is less than or equal to the shortest distance from this leaf box to the other object. Put another way, if Q is any point on this leaf box and P is any point on the other object, then then P.DistanceTo(Q) >= MinimumDistanceTo(other).

◆ MinimumDistanceTo() [2/5]

double ON_SurfaceLeafBox::MinimumDistanceTo ( const ON_BoundingBox bbox) const

◆ MinimumDistanceTo() [3/5]

double ON_SurfaceLeafBox::MinimumDistanceTo ( const ON_CurveLeafBox crvleafbox) const

◆ MinimumDistanceTo() [4/5]

double ON_SurfaceLeafBox::MinimumDistanceTo ( const ON_Line L) const

◆ MinimumDistanceTo() [5/5]

double ON_SurfaceLeafBox::MinimumDistanceTo ( const ON_SurfaceLeafBox srfleafbox) const

◆ PointAt()

ON_3dPoint ON_SurfaceLeafBox::PointAt ( double  s,
double  t 
) const

Description: Point on the planar quad/triangle that is the "center" of the surface leaf box. Parameters: s - [in] 0.0 <= s <= 1.0 t - [in] 0.0 <= t <= 1.0 Returns: point

◆ Set()

bool ON_SurfaceLeafBox::Set ( const ON_BezierSurface bez)

Description: Sets the leaf box to contain bezier surface. Parameters: bez - [in] Valid bezier surface. Returns: True if input was valid and leaf box is set.

◆ SetEquationsHelper()

void ON_SurfaceLeafBox::SetEquationsHelper ( const ON_BezierSurface bez)

Description: Expert user function to set m_e, m_r, and m_q. m_plane and m_bMono must be set before this function is called. Parameters: bez - [in] Valid bezier surface. See Also ON_SurfaceLeafBox::Set
ON_SurfaceLeafBox::SetPlaneAndMonoHelper

◆ SetPlaneAndMonoHelper()

bool ON_SurfaceLeafBox::SetPlaneAndMonoHelper ( const ON_BezierSurface bez,
double  maxheight = 0.0 
)

Description: Expert user function to quickly set m_plane an m_bMono. Parameters: bez - [in] Valid bezier surface. maxheight - [in] Ignore this expert user parameter. Returns: True if input was valid and m_plane and m_bMono are set. See Also ON_SurfaceLeafBox::Set
ON_SurfaceLeafBox::SetEquationsHelper

Member Data Documentation

◆ m_bDegen

bool ON_SurfaceLeafBox::m_bDegen

True if the m_q[] are not convex (the m_c[] are always convex)

◆ m_bMono

bool ON_SurfaceLeafBox::m_bMono

◆ m_bPlane

bool ON_SurfaceLeafBox::m_bPlane

◆ m_bValid

bool ON_SurfaceLeafBox::m_bValid

◆ m_c

ON_2dPoint ON_SurfaceLeafBox::m_c[4]

m_c[] = plane coordinates of bounding quad/triangle corners. The polygon connecting the m_c[] points is always convex, but it can happen that the polygon is a triangle. A point is in the surface leaf box if its projection is in the large quad and its distance from the plane is in the interval m_[0] to m_h[1]. The m_c[] are used to answer proximity queries.

◆ m_e

ON_3dVector ON_SurfaceLeafBox::m_e[4]

side plane equations d = m_e[i].x*s + m_e[i].y*t + m_e[i].z d is zero at m_c[i] and m_c[(i+1)%4]. d > 0 in the half space outside the surface leaf d is the 3d distance from the point m_plane to the bounding side plane.

◆ m_h

double ON_SurfaceLeafBox::m_h[2]

Height limits. m_h[0] <= 0.0 <= m_h[1]. If P is in the surface leaf box, then m_h[0] <= m_plane.plane_equation.ValueAt(P) <= m_h[1].

◆ m_plane

ON_Plane ON_SurfaceLeafBox::m_plane

◆ m_q

ON_2dPoint ON_SurfaceLeafBox::m_q[4]

m_q[] = plane coordinates of small quad with corners located at the projection of the bibezier corners to m_plane. In general, the m_q are in the interior of the surface leaf box. In some cases, the polygon connecting the m_q[] is not convex. m_q[] are used to calculate seed values.