Description
A GtsTriangle is defined by three GtsEdge. They are oriented, the normal to the triangle points toward an observer seing the three edges in counter-clockwise order.
When destroying a GtsTriangle, all the edges not used by another triangle are also destroyed. This default behaviour can be changed punctually by setting the global variable gts_allow_floating_edges to TRUE. You must not forget to set this variable back to FALSE as all the algorithms of GTS assume the default behaviour.
Details
GTS_TRIANGLE_CLASS()
#define GTS_TRIANGLE_CLASS(klass) |
Casts klass to GtsTriangleClass.
GTS_TRIANGLE()
#define GTS_TRIANGLE(obj) |
Casts obj to GtsTriangle.
GTS_IS_TRIANGLE()
#define GTS_IS_TRIANGLE(obj) |
Evaluates to TRUE if obj is a descendant of GtsTriangle, FALSE otherwise.
struct GtsTriangleClass
The triangle class, just derived from GtsObject.
struct GtsTriangle
struct GtsTriangle {
GtsObject object;
GtsEdge * e1;
GtsEdge * e2;
GtsEdge * e3;
}; |
The triangle object.
gts_triangle_set ()
Sets the edge of triangle to e1, e2 and e3 while checking that they
define a valid triangle.
gts_triangle_perimeter ()
gts_triangle_quality ()
The quality of a triangle is defined as the ratio of its surface to
its perimeter relative to this same ratio for an equilateral
triangle with the same area. The quality is then one for an
equilateral triangle and tends to zero for a very stretched triangle.
gts_triangle_normal ()
void gts_triangle_normal (GtsTriangle *t,
gdouble *x,
gdouble *y,
gdouble *z); |
Computes the coordinates of the oriented normal of t as the
cross-product of two edges, using the left-hand rule. The normal is
not normalized. If this triangle is part of a closed and oriented
surface, the normal points to the outside of the surface.
gts_triangle_revert ()
Changes the orientation of triangle t, turning it inside out.
gts_triangle_orientation ()
Checks for the orientation of the plane (x,y) projection of a
triangle. See gts_point_orientation() for details. This function
is geometrically robust.
gts_triangle_is_duplicate ()
gts_triangles_are_compatible ()
Checks if t1 and t2 have compatible orientations i.e. if t1 and
t2 can be part of the same surface without conflict in the surface
normal orientation.
gts_triangle_enclosing ()
Builds a new triangle (including new vertices and edges) enclosing
the plane projection of all the points in points. This triangle is
equilateral and encloses a rectangle defined by the maximum and
minimum x and y coordinates of the points. scale is an homothetic
scaling factor. If equal to one, the triangle encloses exactly the
enclosing rectangle.
gts_triangles_common_edge ()
gts_triangle_neighbor_number ()
gts_triangle_neighbors ()
gts_triangle_vertices_edges ()
Given t and e, returns v1, v2, v3, e1, e2 and e3. e1
has v1 and v2 as vertices, e2 has v2 and v3 as vertices
and e3 has v3 and v1 as vertices. v1, v2 and v3 respects
the orientation of t. If e is not NULL, e1 and e are
identical.
gts_triangle_vertex_opposite ()
This function fails if e is not an edge of t.
gts_triangle_edge_opposite ()
gts_triangle_vertices ()
Fills v1, v2 and v3 with the oriented set of vertices, summits of t.
gts_triangle_vertex()
#define gts_triangle_vertex(t) |
Evaluates to the GtsVertex of t not used by t->e1.
gts_triangle_use_edges ()
gts_triangle_circumcircle_center ()
gts_triangle_is_stabbed ()
gts_triangles_are_folded ()
gboolean gts_triangles_are_folded (GSList *triangles,
GtsVertex *A,
GtsVertex *B,
gdouble max); |
Given a list of triangles sharing A and B as vertices, checks if any
two triangles in the list make an angle larger than a given value defined
by max.
gts_triangles_from_edges ()
GSList* gts_triangles_from_edges (GSList *edges); |
Builds a list of unique triangles which have one of their edges in edges.