From b410eea5c1c511620abda8cad1e80f88cf9d406a Mon Sep 17 00:00:00 2001 From: Barak Itkin Date: Sat, 28 Jul 2012 15:55:09 +0300 Subject: [PATCH] Make flip-fixing a bit more efficient by trying to "give up" eralier --- poly2tri-c/refine/cdt-flipfix.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/poly2tri-c/refine/cdt-flipfix.c b/poly2tri-c/refine/cdt-flipfix.c index e359cdd..3efeb09 100644 --- a/poly2tri-c/refine/cdt-flipfix.c +++ b/poly2tri-c/refine/cdt-flipfix.c @@ -132,16 +132,16 @@ p2tr_cdt_try_flip (P2trCDT *self, AB = to_flip; - CA = p2tr_point_get_edge_to (C, A, FALSE); - AD = p2tr_point_get_edge_to (A, D, FALSE); - DB = p2tr_point_get_edge_to (D, B, FALSE); - BC = p2tr_point_get_edge_to (B, C, FALSE); - /* Check if the quadriliteral ADBC is concave (because if it is, we * can't flip the edge) */ if (p2tr_triangle_circumcircle_contains_point (AB->tri, &D->c) != P2TR_INCIRCLE_IN) return NULL; + CA = p2tr_point_get_edge_to (C, A, FALSE); + AD = p2tr_point_get_edge_to (A, D, FALSE); + DB = p2tr_point_get_edge_to (D, B, FALSE); + BC = p2tr_point_get_edge_to (B, C, FALSE); + p2tr_edge_remove (AB); DC = p2tr_mesh_new_edge (self->mesh, D, C, FALSE); -- 2.50.1