Some helpful functions when working with triangles. More...
#include <vcl_algorithm.h>#include <vcl_utility.h>#include <vcl_cmath.h>#include <vgl/vgl_line_segment_3d.h>#include <vgl/vgl_point_3d.h>Go to the source code of this file.
Enumerations | |
| enum | vgl_triangle_3d_intersection_t { None = 0, Skew, Coplanar } |
Functions | |
| vcl_vector< vcl_pair< unsigned, unsigned > > | vgl_triangle_3d_coincident_edges (const vgl_point_3d< double > &a_p1, const vgl_point_3d< double > &a_p2, const vgl_point_3d< double > &a_p3, const vgl_point_3d< double > &b_p1, const vgl_point_3d< double > &b_p2, const vgl_point_3d< double > &b_p3) |
| Check for coincident edges of triangles a and b. | |
| bool | vgl_triangle_3d_test_inside (const vgl_point_3d< double > &i_pnt, const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2, const vgl_point_3d< double > &p3) |
| Check if the given point is inside the triangle. | |
| bool | vgl_triangle_3d_test_inside_simple (const vgl_point_3d< double > &i_pnt, const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2, const vgl_point_3d< double > &p3) |
| Check if point i_pnt is inside the triangle. | |
| vgl_triangle_3d_intersection_t | vgl_triangle_3d_line_intersection (const vgl_line_segment_3d< double > &line, const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2, const vgl_point_3d< double > &p3, vgl_point_3d< double > &i_pnt, bool ignore_coplanar=false) |
| Compute the intersection point between the line segment and triangle. | |
| vgl_triangle_3d_intersection_t | vgl_triangle_3d_triangle_intersection (const vgl_point_3d< double > &a_p1, const vgl_point_3d< double > &a_p2, const vgl_point_3d< double > &a_p3, const vgl_point_3d< double > &b_p1, const vgl_point_3d< double > &b_p2, const vgl_point_3d< double > &b_p3) |
| Compute if the given triangles a and b intersect. | |
| vgl_triangle_3d_intersection_t | vgl_triangle_3d_triangle_intersection (const vgl_point_3d< double > &a_p1, const vgl_point_3d< double > &a_p2, const vgl_point_3d< double > &a_p3, const vgl_point_3d< double > &b_p1, const vgl_point_3d< double > &b_p2, const vgl_point_3d< double > &b_p3, vgl_line_segment_3d< double > &i_line) |
| Compute the intersection line of the given triangles. | |
| vgl_triangle_3d_intersection_t | vgl_triangle_3d_plane_intersection (const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2, const vgl_point_3d< double > &p3, const vgl_plane_3d< double > &i_plane, vgl_line_segment_3d< double > &i_line) |
| Compute the line of intersection of the given triangle and plane. | |
| double | vgl_triangle_3d_longest_side (const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2, const vgl_point_3d< double > &p3) |
| Compute the longest side of the given triangle. | |
| double | vgl_triangle_3d_shortest_side (const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2, const vgl_point_3d< double > &p3) |
| Compute the shortest side of the given triangle. | |
| vgl_point_3d< double > | vgl_triangle_3d_closest_point (const vgl_point_3d< double > &q, const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2, const vgl_point_3d< double > &p3) |
| Compute the closest point on a triangle to a reference point. | |
| double | vgl_triangle_3d_distance (const vgl_point_3d< double > &q, const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2, const vgl_point_3d< double > &p3) |
| Compute the distance to the closest point on a triangle from a reference point. | |
| bool | vgl_triangle_3d_triangle_coplanar (const vgl_point_3d< double > &a_p1, const vgl_point_3d< double > &a_p2, const vgl_point_3d< double > &a_p3, const vgl_point_3d< double > &b_p1, const vgl_point_3d< double > &b_p2, const vgl_point_3d< double > &b_p3) |
| Check if the two triangles are coplanar. | |
| double | vgl_triangle_3d_area (const vgl_point_3d< double > &p0, const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2) |
| Compute the area of a triangle. | |
| double | vgl_triangle_3d_aspect_ratio (const vgl_point_3d< double > &p0, const vgl_point_3d< double > &p1, const vgl_point_3d< double > &p2) |
| Compute the aspect ratio of a triangle. | |
Some helpful functions when working with triangles.
Definition in file vgl_triangle_3d.h.
Definition at line 16 of file vgl_triangle_3d.h.
| double vgl_triangle_3d_area | ( | const vgl_point_3d< double > & | p0, |
| const vgl_point_3d< double > & | p1, | ||
| const vgl_point_3d< double > & | p2 | ||
| ) |
Compute the area of a triangle.
The triangle is represented by its vertices p1, p2, p3
Definition at line 1303 of file vgl_triangle_3d.cxx.
| double vgl_triangle_3d_aspect_ratio | ( | const vgl_point_3d< double > & | p0, |
| const vgl_point_3d< double > & | p1, | ||
| const vgl_point_3d< double > & | p2 | ||
| ) |
Compute the aspect ratio of a triangle.
The triangle is represented by its vertices p1, p2, p3
Compute the aspect ratio of a triangle.
The triangle is represented by its vertices p1, p2, p3
Definition at line 1325 of file vgl_triangle_3d.cxx.
| vgl_point_3d<double> vgl_triangle_3d_closest_point | ( | const vgl_point_3d< double > & | q, |
| const vgl_point_3d< double > & | p1, | ||
| const vgl_point_3d< double > & | p2, | ||
| const vgl_point_3d< double > & | p3 | ||
| ) |
Compute the closest point on a triangle to a reference point.
The triangle is represented by its vertices p1, p2, p3.
| q | The reference point. |
Definition at line 1198 of file vgl_triangle_3d.cxx.
| vcl_vector<vcl_pair<unsigned,unsigned> > vgl_triangle_3d_coincident_edges | ( | const vgl_point_3d< double > & | a_p1, |
| const vgl_point_3d< double > & | a_p2, | ||
| const vgl_point_3d< double > & | a_p3, | ||
| const vgl_point_3d< double > & | b_p1, | ||
| const vgl_point_3d< double > & | b_p2, | ||
| const vgl_point_3d< double > & | b_p3 | ||
| ) |
Check for coincident edges of triangles a and b.
Definition at line 26 of file vgl_triangle_3d.cxx.
| double vgl_triangle_3d_distance | ( | const vgl_point_3d< double > & | q, |
| const vgl_point_3d< double > & | p1, | ||
| const vgl_point_3d< double > & | p2, | ||
| const vgl_point_3d< double > & | p3 | ||
| ) |
Compute the distance to the closest point on a triangle from a reference point.
The triangle is represented by its vertices p1, p2, p3.
| q | The reference point. |
Definition at line 1274 of file vgl_triangle_3d.cxx.
| vgl_triangle_3d_intersection_t vgl_triangle_3d_line_intersection | ( | const vgl_line_segment_3d< double > & | line, |
| const vgl_point_3d< double > & | p1, | ||
| const vgl_point_3d< double > & | p2, | ||
| const vgl_point_3d< double > & | p3, | ||
| vgl_point_3d< double > & | i_pnt, | ||
| bool | ignore_coplanar | ||
| ) |
Compute the intersection point between the line segment and triangle.
The triangle is represented by its vertices p1, p2, p3
The triangle is represented by its vertices p1, p2, p3
Definition at line 221 of file vgl_triangle_3d.cxx.
| double vgl_triangle_3d_longest_side | ( | const vgl_point_3d< double > & | p1, |
| const vgl_point_3d< double > & | p2, | ||
| const vgl_point_3d< double > & | p3 | ||
| ) | [inline] |
Compute the longest side of the given triangle.
The triangle is represented by its vertices p1, p2, p3
Definition at line 102 of file vgl_triangle_3d.h.
| vgl_triangle_3d_intersection_t vgl_triangle_3d_plane_intersection | ( | const vgl_point_3d< double > & | p1, |
| const vgl_point_3d< double > & | p2, | ||
| const vgl_point_3d< double > & | p3, | ||
| const vgl_plane_3d< double > & | i_plane, | ||
| vgl_line_segment_3d< double > & | i_line | ||
| ) |
Compute the line of intersection of the given triangle and plane.
The triangle is represented by its vertices p1, p2, p3
The triangle is represented by its vertices p1, p2, p3
Definition at line 1104 of file vgl_triangle_3d.cxx.
| double vgl_triangle_3d_shortest_side | ( | const vgl_point_3d< double > & | p1, |
| const vgl_point_3d< double > & | p2, | ||
| const vgl_point_3d< double > & | p3 | ||
| ) | [inline] |
Compute the shortest side of the given triangle.
The triangle is represented by its vertices p1, p2, p3
Definition at line 115 of file vgl_triangle_3d.h.
| bool vgl_triangle_3d_test_inside | ( | const vgl_point_3d< double > & | i_pnt, |
| const vgl_point_3d< double > & | p1, | ||
| const vgl_point_3d< double > & | p2, | ||
| const vgl_point_3d< double > & | p3 | ||
| ) |
Check if the given point is inside the triangle.
The triangle is represented by its vertices p1, p2, p3
Definition at line 80 of file vgl_triangle_3d.cxx.
| bool vgl_triangle_3d_test_inside_simple | ( | const vgl_point_3d< double > & | i_pnt, |
| const vgl_point_3d< double > & | p1, | ||
| const vgl_point_3d< double > & | p2, | ||
| const vgl_point_3d< double > & | p3 | ||
| ) |
Check if point i_pnt is inside the triangle.
The triangle is represented by its vertices p1, p2, p3
Definition at line 167 of file vgl_triangle_3d.cxx.
| bool vgl_triangle_3d_triangle_coplanar | ( | const vgl_point_3d< double > & | a_p1, |
| const vgl_point_3d< double > & | a_p2, | ||
| const vgl_point_3d< double > & | a_p3, | ||
| const vgl_point_3d< double > & | b_p1, | ||
| const vgl_point_3d< double > & | b_p2, | ||
| const vgl_point_3d< double > & | b_p3 | ||
| ) |
Check if the two triangles are coplanar.
The triangles are represented by their respective vertices a_p1, a_p2, a_p3 and b_p1, b_p2, b_p3
Definition at line 1287 of file vgl_triangle_3d.cxx.
| vgl_triangle_3d_intersection_t vgl_triangle_3d_triangle_intersection | ( | const vgl_point_3d< double > & | a_p1, |
| const vgl_point_3d< double > & | a_p2, | ||
| const vgl_point_3d< double > & | a_p3, | ||
| const vgl_point_3d< double > & | b_p1, | ||
| const vgl_point_3d< double > & | b_p2, | ||
| const vgl_point_3d< double > & | b_p3 | ||
| ) |
Compute if the given triangles a and b intersect.
The triangles are represented by their respective vertices a_p1, a_p2, a_p3 and b_p1, b_p2, b_p3
The triangle are represented by their respective vertices a_p1, a_p2, a_p3 and b_p1, b_p2, b_p3
Definition at line 754 of file vgl_triangle_3d.cxx.
| vgl_triangle_3d_intersection_t vgl_triangle_3d_triangle_intersection | ( | const vgl_point_3d< double > & | a_p1, |
| const vgl_point_3d< double > & | a_p2, | ||
| const vgl_point_3d< double > & | a_p3, | ||
| const vgl_point_3d< double > & | b_p1, | ||
| const vgl_point_3d< double > & | b_p2, | ||
| const vgl_point_3d< double > & | b_p3, | ||
| vgl_line_segment_3d< double > & | i_line | ||
| ) |
Compute the intersection line of the given triangles.
Compute the intersection line of the given triangles.
Definition at line 327 of file vgl_triangle_3d.cxx.
1.7.5.1