eloraiby / delaunay

Relatively Robust Divide and Conquer 2D Delaunay Construction Algorithm in $O(n \log n)$
GNU Affero General Public License v3.0
126 stars 34 forks source link

a little confuse #14

Open DamonsJ opened 5 years ago

DamonsJ commented 5 years ago

in the function : static int del_init_tri( delaunay_t del, int start ) I think this function is use for creating a initial triangle . here is the code which confused me : / d0->next = d5; d0->prev = d5;

    d1->next    = d3;
    d1->prev    = d3;

    d2->next    = d4;
    d2->prev    = d4;

    d3->next    = d1;
    d3->prev    = d1;

    d4->next    = d2;
    d4->prev    = d2;

    d5->next    = d0;
    d5->prev    = d0;

*/ why halfedge d0 has same next and prev and why it is d5? I think it should be: d0->next = d1; d0->prev = d2; d1->next = d2; d1->prev = d0; d2->next = d0; d2->prev = d1; where I am wrong? thanks!

trapazza commented 2 years ago

This bit confused me as well, did you get any info wrt this?

trapazza commented 2 years ago

I think it's creating the triangle edges in both clockwise and counter-clockwise directions, then linking them through next/prev.