Example #1
0
static gdouble cost_angle (GtsEdge * e)
{
  if (e->triangles && e->triangles->next)
    return fabs (gts_triangles_angle (e->triangles->data,
				      e->triangles->next->data));
  return G_MAXDOUBLE;
}
Example #2
0
File: optimize.c Project: bert/gts
static void angle_stats (GtsEdge * e, GtsRange * angle)
{
    GSList * i;
    GtsTriangle * t1 = NULL, * t2 = NULL;

    i = e->triangles;
    while (i) {
        if (GTS_IS_FACE (i->data)) {
            if (!t1) t1 = i->data;
            else if (!t2) t2 = i->data;
            else return;
        }
        i = i->next;
    }
    if (!t1 || !t2)
        return;

    gts_range_add_value (angle, fabs (gts_triangles_angle (t1, t2)));
}