aewallin / openvoronoi

2D voronoi diagram for point and line-segment sites using incremental topology-oriented algorithm. C++ with python bindings. Licensed under LGPL2.1.
http://www.anderswallin.net/cam/
GNU Lesser General Public License v2.1
198 stars 68 forks source link

About the possibility of extending the library to ArcSite #56

Open A-112211 opened 9 months ago

A-112211 commented 9 months ago

Hello,Mr.Wallin,There are three questions I want to share with you.The first one,I've read the codes about construction voronoi diagram of point site and line site in detail;a little bug about construction voronoi diagram of line site with test data: ovd::Point p0(-1.0, 0.0); ovd::Point p1(-1.0, 2.0);

ovd::Point p2(0.0, 2.0);
ovd::Point p3(0.0, 1.0);

ovd::Point p4(1.0, 1.0);
ovd::Point p5(1.0, 0.0);

//insert point site
int id0 = vd->insert_point_site(p0);
int id1 = vd->insert_point_site(p1);
int id2 = vd->insert_point_site(p2);
int id3 = vd->insert_point_site(p3);
int id4 = vd->insert_point_site(p4);
int id5 = vd->insert_point_site(p5);

vd->insert_line_site(id0, id1);
vd->insert_line_site(id1, id2);
vd->insert_line_site(id2, id3);
vd->insert_line_site(id3, id4);
vd->insert_line_site(id4, id5);
vd->insert_line_site(id5, id0);

we construct voronoi diagram successfully ,however ,when we change the direction of line site" vd->insert_line_site(id5, id0)" to" vd->insert_line_site(id0, id5)";failed, the reason for which is when we change the direction of line site,the offset direction for is unchanged ,which leads to the solution lies the other side of line site,thus add edge unsuccessfully.

The second one,I can't understand the logic of construction of separator of line site ,,specially about the API process_null_edge(),can you give some details about that.

The last one,I've read your blog about about if extension of Arc site is possible; the first difficulty is about Arc predicates,which you've given the math expression about in_region(p),apex_point(p),I've checked that,it's right;the second is about edge-parametrizations for the new type of voronoi-edges that will occur when we have arc-sites (arc/point, arc/line, and arc/arc) written in your blog,then calculate voronoi vertex position is necessary,which is mentioned in the thesis"Topology-oriented incremental computation of Voronoi diagrams of circular arcs and straight-line segments",or a more detailed version Msc of Stefan Huber"Computation of Voronoi Diagrams of Circular Arcs and Straight Lines",and split vertex is added to avoid loop in delete tree,I don't know if the construction of separator of arc site is as same as the line site.

aewallin commented 9 months ago

Hi it's been many years since I worked on this code, and the algorithm is complex enough so that major improvements are not going to happen by just working a few hours on it, so I don't expect much progress will happen from my side in the near future.

Documentation could/should be improved a lot, so that others, like you, can step in and make useful contributions. Getting started with readthedocs (e.g. https://readthedocs.org/projects/cpp-documentation-example/ ) would probably be a first step. Pull requests are welcome.

A-112211 commented 9 months ago

Thank you vary much!Mr.Wallin,It may be difficult as you said,but can you give some details about the difficulty of construction of arc site,like the choice of split vertex to avoid cycle in delete tree or others,the separartor of arc site may be the core difficulty in my opinion.