#include <opennurbs_line.h>
|
| | ON_Triangle ()=default |
| | Default constructor is uninitialized. More...
|
| |
| | ON_Triangle (const ON_3dPoint vertices[3]) |
| |
| | ON_Triangle (const ON_3dPoint &a, const ON_3dPoint &b, const ON_3dPoint &c) |
| |
| | ON_Triangle (double x) |
| | Allows Triangle(0.0) ZeroTriangle. More...
|
| |
| | ON_Triangle (const ON_Triangle &tri)=default |
| |
| | ~ON_Triangle ()=default |
| |
| double | Area () const |
| |
| ON_BoundingBox | BoundingBox () const |
| |
| bool | ClosestPointTo (const ON_3dPoint &test_point, double *s1, double *s2) const |
| |
| ON_3dPoint | ClosestPointTo (const ON_3dPoint &test_point) const |
| |
| void | Create (const ON_3dPoint vertices[3]) |
| |
| void | Create (const ON_3dPoint &a, const ON_3dPoint &b, const ON_3dPoint &c) |
| |
| double | DistanceTo (const ON_3dPoint &test_point) const |
| |
| ON_Line | Edge (int i) const |
| |
| bool | GetBoundingBox (ON_BoundingBox &bbox, int bGrowBox=false) const |
| |
| bool | GetTightBoundingBox (ON_BoundingBox &tight_bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const |
| |
| bool | IsDegenerate (double tol=ON_ZERO_TOLERANCE) const |
| |
| bool | IsValid () const |
| |
| ON_3dVector | Normal () const |
| |
| | operator const ON_3dPoint * () const |
| |
| | operator ON_3dPoint * () |
| |
| ON_Triangle & | operator= (const ON_Triangle &tri)=default |
| |
| ON_3dPoint & | operator[] (int) |
| | Triangle[i] = Triangle.m_V[i]. More...
|
| |
| const ON_3dPoint & | operator[] (int) const |
| |
| ON_PlaneEquation | PlaneEquation () const |
| |
| ON_3dPoint | PointAt (double s1, double s2) const |
| |
| void | Reverse (int i) |
| |
| bool | Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis_of_rotation, const ON_3dPoint ¢er_of_rotation) |
| | rotate line about a point and axis More...
|
| |
| bool | Rotate (double angle_in_radians, const ON_3dVector &axis_of_rotation, const ON_3dPoint ¢er_of_rotation) |
| |
| bool | Transform (const ON_Xform &xform) |
| |
| bool | Translate (const ON_3dVector &delta) |
| |
| ON_3dVector | UnitNormal () const |
| |
◆ ON_Triangle() [1/5]
| ON_Triangle::ON_Triangle |
( |
| ) |
|
|
default |
Default constructor is uninitialized.
◆ ON_Triangle() [2/5]
| ON_Triangle::ON_Triangle |
( |
const ON_3dPoint |
vertices[3] | ) |
|
◆ ON_Triangle() [3/5]
◆ ON_Triangle() [4/5]
| ON_Triangle::ON_Triangle |
( |
double |
x | ) |
|
Allows Triangle(0.0) ZeroTriangle.
◆ ON_Triangle() [5/5]
◆ ~ON_Triangle()
| ON_Triangle::~ON_Triangle |
( |
| ) |
|
|
default |
◆ Area()
| double ON_Triangle::Area |
( |
| ) |
const |
Returns: Area of triangle
◆ BoundingBox()
Description: Get Triangles 3d axis aligned bounding box. Returns: 3d bounding box.
◆ ClosestPointTo() [1/2]
| bool ON_Triangle::ClosestPointTo |
( |
const ON_3dPoint & |
test_point, |
|
|
double * |
s1, |
|
|
double * |
s2 |
|
) |
| const |
Description: Find the point on the triangle that is closest to the test_point. Parameters: test_point - [in] s1, s2 - [out] PointAt( *s1, *s2) is the point on the triangle closest to test_point. Returns: true if successful.
◆ ClosestPointTo() [2/2]
Description: Find the point on the triangle that is closest to the test_point. Parameters: test_point - [in] Returns: The point on the line that is closest to test_point.
◆ Create() [1/2]
| void ON_Triangle::Create |
( |
const ON_3dPoint |
vertices[3] | ) |
|
Description: Create a Triangle from three points. Parameters: vertices - [in] vertices
◆ Create() [2/2]
Description: Create a Triangle from three points. Parameters: a,b,c - [in] vertices
◆ DistanceTo()
| double ON_Triangle::DistanceTo |
( |
const ON_3dPoint & |
test_point | ) |
const |
Description: Find the point on the triangle that is closest to the test_point. Parameters: test_point -[in] Returns: distance from the point on triangle that is closest to test_point. See Also: ON_3dPoint::DistanceTo ON_Line::ClosestPointTo
◆ Edge()
| ON_Line ON_Triangle::Edge |
( |
int |
i | ) |
const |
Returns: Edge opposite m_V[i] Specifically, ON_Line( m_V[(i+1)%3 ], m_V[(i+2)%3 ] )
◆ GetBoundingBox()
| bool ON_Triangle::GetBoundingBox |
( |
ON_BoundingBox & |
bbox, |
|
|
int |
bGrowBox = false |
|
) |
| const |
Description: Get line's 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.
◆ GetTightBoundingBox()
| bool ON_Triangle::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.
◆ IsDegenerate()
| bool ON_Triangle::IsDegenerate |
( |
double |
tol = ON_ZERO_TOLERANCE | ) |
const |
Returns: true if Area()< tol Note: Recall Area = .5* base * height. So this degeneracy tests for a combination long enough and high enough. See Also: ON_Triangle::Area()
◆ IsValid()
| bool ON_Triangle::IsValid |
( |
| ) |
const |
◆ Normal()
◆ operator const ON_3dPoint *()
| ON_Triangle::operator const ON_3dPoint * |
( |
| ) |
const |
◆ operator ON_3dPoint *()
◆ operator=()
◆ operator[]() [1/2]
Triangle[i] = Triangle.m_V[i].
◆ operator[]() [2/2]
| const ON_3dPoint& ON_Triangle::operator[] |
( |
int |
| ) |
const |
◆ PlaneEquation()
Returns: Plane containing Triangle with normal given by UnitNormal(). Notes: Ensure !IsDegenerate() to gaurentee meaningful result
◆ PointAt()
| ON_3dPoint ON_Triangle::PointAt |
( |
double |
s1, |
|
|
double |
s2 |
|
) |
| const |
Description: Evaluate point on triangle. Parameters: s1, s2 - [in] evaluation parameter. Returns: (1-s1-s2)* m_V[0] + s1*m_V[1] + s2*m_V[2] Notes: Point is in the triangle iff s1>=0, s2>=0 and s1 + s2<=1. Other values produce points on the plane of the triangle.
◆ Reverse()
| void ON_Triangle::Reverse |
( |
int |
i | ) |
|
Description: Reverse endpoints of Edge[i].
◆ Rotate() [1/2]
| bool ON_Triangle::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
◆ Rotate() [2/2]
| bool ON_Triangle::Rotate |
( |
double |
angle_in_radians, |
|
|
const ON_3dVector & |
axis_of_rotation, |
|
|
const ON_3dPoint & |
center_of_rotation |
|
) |
| |
◆ Transform()
| bool ON_Triangle::Transform |
( |
const ON_Xform & |
xform | ) |
|
◆ Translate()
| bool ON_Triangle::Translate |
( |
const ON_3dVector & |
delta | ) |
|
◆ UnitNormal()
Returns: Normal().Unitize() Notes: Ensure !IsDegenerate() to gaurentee that UnitNormal().Length()==1 and the result is not just a bunch of noise. Can return zero vector in some degenerate cases.
◆ m_V
◆ NanTriangle
◆ UnsetTriangle
◆ ZeroTriangle