Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Add edges to check delaunay
- stack_edges_delaunay.push(current_halfedge);
- stack_edges_delaunay.push(current_halfedge->next);
- stack_edges_delaunay.push(current_halfedge->next->next);
- //While exist some edge to check delaunay
- while(!stack_edges_delaunay.empty()) {
- HalfEdge *edge_delaunay = stack_edges_delaunay.top();
- stack_edges_delaunay.pop();
- if (edge_delaunay->twin->f != NULL && edge_delaunay->f != NULL) {
- if (Math::orientation25D(*(edge_delaunay->twin->next->next->v), *(edge_delaunay->v), *(edge_delaunay->next->v), *(edge_delaunay->next->next->v))){
- HalfEdge *e1 = edge_delaunay->next;
- HalfEdge *e2 = edge_delaunay->next->next;
- HalfEdge *et1 = edge_delaunay->twin->next;
- HalfEdge *et2 = edge_delaunay->twin->next->next;
- //New vertices assignations
- edge_delaunay->v = edge_delaunay->twin->next->next->v;
- edge_delaunay->twin->v = edge_delaunay->next->next->v;
- //New edges assignations
- edge_delaunay->next = e2;
- e2->next = et1;
- et1->next = edge_delaunay;
- edge_delaunay->twin->next = et2;
- et2->next = e1;
- e1->next = edge_delaunay->twin;
- //Change edge of face edge
- edge_delaunay->f->e = edge_delaunay;
- //Change edge of face twin edge
- edge_delaunay->twin->f->e = edge_delaunay->twin;
- printf("FACES! %lu | %lu\n",edge_delaunay->f, edge_delaunay->twin->f);
- //Add next edges to check delaunay
- stack_edges_delaunay.push(et1);
- stack_edges_delaunay.push(et2);
- //Update face of auxiliar point if it is necessary
- if (edge_delaunay->f == faux || edge_delaunay->twin->f == faux) {
- float inter = Math::orientation2D(*(edge_delaunay->v), *(edge_delaunay->twin->v), paux);
- if (inter > 0){
- faux = edge_delaunay->f;
- } else {
- faux = edge_delaunay->twin->f;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement