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

A Simplex in 3d. More...

#include <opennurbs_convex_poly.h>

Public Member Functions

 ON_3dSimplex ()
 An empty simplex. More...
 
 ON_3dSimplex (const ON_3dPoint &a)
 0-simplex in 3d More...
 
 ON_3dSimplex (const ON_3dPoint &a, const ON_3dPoint &b)
 1-simplex More...
 
 ON_3dSimplex (const ON_3dPoint &a, const ON_3dPoint &b, const ON_3dPoint &c)
 2-simplex More...
 
 ON_3dSimplex (const ON_3dPoint &a, const ON_3dPoint &b, const ON_3dPoint &c, const ON_3dPoint &d)
 3-simplex More...
 
 ON_3dSimplex (const ON_3dSimplex &rhs)=default
 
 ~ON_3dSimplex ()=default
 
bool AddVertex (const ON_3dPoint &)
 
ON_BoundingBox BoundingBox () const
 
int Count () const
 Number of Vertices <=4. More...
 
ON_3dVector Edge (int e0, int e1) const
 
ON_3dPoint Evaluate (const double *b) const
 
ON_3dPoint Evaluate (const ON_4dPoint &b) const
 
ON_3dVector FaceNormal (int noti=0) const
 
ON_3dVector FaceUnitNormal (int noti=0) const
 
bool GetBoundingBox (ON_BoundingBox &bbox, int bGrowBox=false) const
 
bool GetClosestPoint (const ON_3dPoint &P0, ON_4dPoint &Bary, double maximum_distance=ON_DBL_MAX) const
 
bool GetClosestPointToOrigin (ON_4dPoint &Bary) const
 
bool GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const
 
bool IsValid (double eps) const
 true if the Vertices are affinely independent More...
 
double MaximumCoordinate () const
 
ON_3dSimplexoperator= (const ON_3dSimplex &rhs)=default
 
const ON_3dPointoperator[] (int i) const
 
ON_3dPointoperator[] (int)
 Returns a Vertex or a reference to one when 0<=i<Count() More...
 
bool RemoveVertex (int i)
 
bool Rotate (double angle_in_radians, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
 
bool Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation, const ON_3dPoint &center_of_rotation)
 rotate line about a point and axis More...
 
bool SetVertex (int i, ON_3dPoint P)
 
double SignedVolume () const
 returns ON_UNSET_VALUE if Count()<4 else the signed volume More...
 
bool Transform (const ON_Xform &xform)
 
bool Translate (const ON_3dVector &delta)
 
ON_3dPointVertex (int i)
 
ON_3dPoint Vertex (int i) const
 
double Volume () const
 

Detailed Description

A Simplex in 3d.

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_3dSimplex() [1/6]

ON_3dSimplex::ON_3dSimplex ( )

An empty simplex.

◆ ON_3dSimplex() [2/6]

ON_3dSimplex::ON_3dSimplex ( const ON_3dPoint a)
explicit

0-simplex in 3d

◆ ON_3dSimplex() [3/6]

ON_3dSimplex::ON_3dSimplex ( const ON_3dPoint a,
const ON_3dPoint b 
)

1-simplex

◆ ON_3dSimplex() [4/6]

ON_3dSimplex::ON_3dSimplex ( const ON_3dPoint a,
const ON_3dPoint b,
const ON_3dPoint c 
)

2-simplex

◆ ON_3dSimplex() [5/6]

ON_3dSimplex::ON_3dSimplex ( const ON_3dPoint a,
const ON_3dPoint b,
const ON_3dPoint c,
const ON_3dPoint d 
)

3-simplex

◆ ON_3dSimplex() [6/6]

ON_3dSimplex::ON_3dSimplex ( const ON_3dSimplex rhs)
default

◆ ~ON_3dSimplex()

ON_3dSimplex::~ON_3dSimplex ( )
default

Member Function Documentation

◆ AddVertex()

bool ON_3dSimplex::AddVertex ( const ON_3dPoint )

append new vertex at end

◆ BoundingBox()

ON_BoundingBox ON_3dSimplex::BoundingBox ( ) const

Description: Get Simplex's 3d axis aligned bounding box. Returns: 3d bounding box.

◆ Count()

int ON_3dSimplex::Count ( ) const

Number of Vertices <=4.

◆ Edge()

ON_3dVector ON_3dSimplex::Edge ( int  e0,
int  e1 
) const

Edge vector from Vertex(e0) to Vertex(e1)

◆ Evaluate() [1/2]

ON_3dPoint ON_3dSimplex::Evaluate ( const double *  b) const

Description: Evaluate a point in a Simplex from a barycentric coordinate b. Returns: The point b[0] * Vertex[0] + ... + b[Count()-1] * Vertex[Count()-1] Notes: If b[0] + ... + b[Count()-1] = 1 and b[i]>=0 for i=0 to Count()-1 then the returned point is on the simplex

◆ Evaluate() [2/2]

ON_3dPoint ON_3dSimplex::Evaluate ( const ON_4dPoint b) const

◆ FaceNormal()

ON_3dVector ON_3dSimplex::FaceNormal ( int  noti = 0) const

FaceNormal(noti) is the oriented face normal obtained by omitting vertex noti. FaceNormal returns ON_UNSET_VALUE if Count()<3 or Count()==4 noti not 0,1,2 or 3. FaceUnitNormal returns ON_UNSET_VALUE if Count()<3 or Count()==4 noti not 0,1,2 or 3 or if FaceNormal(noti)=Zero_Vector

◆ FaceUnitNormal()

ON_3dVector ON_3dSimplex::FaceUnitNormal ( int  noti = 0) const

◆ GetBoundingBox()

bool ON_3dSimplex::GetBoundingBox ( ON_BoundingBox bbox,
int  bGrowBox = false 
) const

Description: Get simplexes 3d axis aligned bounding box or the union of the input box with the object's bounding box. Parameters: bbox - [in/out] 3d axis aligned bounding box bGrowBox - [in] (default=false) If true, then the union of the input bbox and the object's bounding box is returned in bbox. If false, the object's bounding box is returned in bbox. Returns: true if object has bounding box and calculation was successful.

◆ GetClosestPoint()

bool ON_3dSimplex::GetClosestPoint ( const ON_3dPoint P0,
ON_4dPoint Bary,
double  maximum_distance = ON_DBL_MAX 
) const

Description: Find Closest Point to this simplex from a base point P0 or the Origin. If true is returned then Evaluate(Bary) is the closest point on the Simplex. maximum_distance - optional upperbound on closest point. If maximum_distance>=0 is specified and Dist(P0, Simplex)>maximum_distance then false is returned.

◆ GetClosestPointToOrigin()

bool ON_3dSimplex::GetClosestPointToOrigin ( ON_4dPoint Bary) const

◆ GetTightBoundingBox()

bool ON_3dSimplex::GetTightBoundingBox ( ON_BoundingBox tight_bbox,
bool  bGrowBox = false,
const ON_Xform xform = nullptr 
) const

Description: Get tight bounding box with respect to a given frame Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the line's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed triangle is calculated. The triangle is not modified. Returns: True if a valid tight_bbox is returned.

◆ IsValid()

bool ON_3dSimplex::IsValid ( double  eps) const

true if the Vertices are affinely independent

◆ MaximumCoordinate()

double ON_3dSimplex::MaximumCoordinate ( ) const

Maximum absolute value of vertex coordinates

◆ operator=()

ON_3dSimplex& ON_3dSimplex::operator= ( const ON_3dSimplex rhs)
default

◆ operator[]() [1/2]

const ON_3dPoint& ON_3dSimplex::operator[] ( int  i) const

◆ operator[]() [2/2]

ON_3dPoint& ON_3dSimplex::operator[] ( int  )

Returns a Vertex or a reference to one when 0<=i<Count()

◆ RemoveVertex()

bool ON_3dSimplex::RemoveVertex ( int  i)

If 0<=i<Count() modify this simplex by removing Vertex[i], specifically,
Vertex[k] is fixed for k<i , and Vertex[k] <- Vertex[k+1] for i<= k= Count()-2

◆ Rotate() [1/2]

bool ON_3dSimplex::Rotate ( double  angle_in_radians,
const ON_3dVector axis_of_rotation,
const ON_3dPoint center_of_rotation 
)

◆ Rotate() [2/2]

bool ON_3dSimplex::Rotate ( double  sin_angle,
double  cos_angle,
const ON_3dVector axis_of_rotation,
const ON_3dPoint center_of_rotation 
)

rotate line about a point and axis

◆ SetVertex()

bool ON_3dSimplex::SetVertex ( int  i,
ON_3dPoint  P 
)

Modify a vertex. i<Count()

◆ SignedVolume()

double ON_3dSimplex::SignedVolume ( ) const

returns ON_UNSET_VALUE if Count()<4 else the signed volume

◆ Transform()

bool ON_3dSimplex::Transform ( const ON_Xform xform)

◆ Translate()

bool ON_3dSimplex::Translate ( const ON_3dVector delta)

◆ Vertex() [1/2]

ON_3dPoint& ON_3dSimplex::Vertex ( int  i)

◆ Vertex() [2/2]

ON_3dPoint ON_3dSimplex::Vertex ( int  i) const

◆ Volume()

double ON_3dSimplex::Volume ( ) const

Count() Volume() returns 0 0.0 1 0.0 2 length >=0 3 area >=0 4 volume >=0