aewallin / openvoronoi

2D voronoi diagram for point and line-segment sites using incremental topology-oriented algorithm. C++ with python bindings. Licensed under LGPL2.1.

Home Page:http://www.anderswallin.net/cam/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems with several linesites outgoing from the same pointsite

Rogach opened this issue · comments

Simple testcase:

    ovd::Point p1(0.0, 0.0);
    ovd::Point p2(-0.5, 0);
    ovd::Point p3(0.5, 0);
    ovd::Point p4(0, 0.5);

    int v1 = vd->insert_point_site(p1);
    int v2 = vd->insert_point_site(p2);
    int v3 = vd->insert_point_site(p3);
    int v4 = vd->insert_point_site(p4);

    vd->insert_line_site(v1, v2);
    vd->insert_line_site(v1, v3);
    vd->insert_line_site(v1, v4);

Output:

voronoidiagram.cpp:1563: void ovd::VoronoiDiagram::add_edges(ovd::HEFace, ovd::HEFace, ovd::HEFace, std::pair<void*, void*>): Assertion `(new_count % 2) == 0' failed.

Almost any set of coordinates resembling these also fails, but with another problem:

    ovd::Point p1(0.002, 0.030);
    ovd::Point p2(-0.473, 0.099);
    ovd::Point p3(0.571, 0.008);
    ovd::Point p4(0.100, 0.524);

    int v1 = vd->insert_point_site(p1);
    int v2 = vd->insert_point_site(p2);
    int v3 = vd->insert_point_site(p3);
    int v4 = vd->insert_point_site(p4);

    vd->insert_line_site(v1, v2);
    vd->insert_line_site(v1, v3);
    vd->insert_line_site(v1, v4);

gives:

voronoidiagram.cpp:1216: void* ovd::VoronoiDiagram::find_seed_vertex(ovd::HEFace, ovd::Site*): Assertion `minPred < 0' failed.

yes, these are called "spikes" in the Held papers, and I remember that I
got some very simple example to work, but then did not have time to look at
this further.
For e.g. cnc-milling of pockets these "spikes" are not very relevant
because any pocket or an 'island' contained within the pocket is just a
simple polygon and does not contain a spike.
It would be a useful addition to support spikes however. The logic is much
the same as for line-sites, but the handling of the end-point and insertion
of separator-edges (often no separator should be added) is different.

On Thu, Feb 26, 2015 at 8:12 PM, Rogach notifications@github.com wrote:

Simple testcase:

ovd::Point p1(0.0, 0.0);
ovd::Point p2(-0.5, 0);
ovd::Point p3(0.5, 0);
ovd::Point p4(0, 0.5);

int v1 = vd->insert_point_site(p1);
int v2 = vd->insert_point_site(p2);
int v3 = vd->insert_point_site(p3);
int v4 = vd->insert_point_site(p4);

vd->insert_line_site(v1, v2);
vd->insert_line_site(v1, v3);
vd->insert_line_site(v1, v4);

Output:

voronoidiagram.cpp:1563: void ovd::VoronoiDiagram::add_edges(ovd::HEFace, ovd::HEFace, ovd::HEFace, std::pair<void*, void*>): Assertion `(new_count % 2) == 0' failed.

Almost any set of coordinates resembling these also fails, but with
another problem:

ovd::Point p1(0.002, 0.030);
ovd::Point p2(-0.473, 0.099);
ovd::Point p3(0.571, 0.008);
ovd::Point p4(0.100, 0.524);

int v1 = vd->insert_point_site(p1);
int v2 = vd->insert_point_site(p2);
int v3 = vd->insert_point_site(p3);
int v4 = vd->insert_point_site(p4);

vd->insert_line_site(v1, v2);
vd->insert_line_site(v1, v3);
vd->insert_line_site(v1, v4);

gives:

voronoidiagram.cpp:1216: void* ovd::VoronoiDiagram::find_seed_vertex(ovd::HEFace, ovd::Site*): Assertion `minPred < 0' failed.


Reply to this email directly or view it on GitHub
#25.