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

insert_point_site fail #50

Closed trlsmax closed 1 year ago

trlsmax commented 3 years ago

I try to build the cpp example on win10 with vs2019. build ok, but even insert first point site made program crash. In medial axis example, it failed at line 27: int id0 = vd->insert_point_site(p0); image

Is that openvoronoi is not support windows? Or I use the wrong version of boost ?

vespakoen commented 1 year ago

I got the same on macOS (running any of the tests)

I wonder if it works on Linux since in CI things seem to work fine.

Screenshot 2022-12-15 at 17 06 50
vespakoen commented 1 year ago

I can confirm that it works correctly on linux, and the this line seems to have an effect on the macOS / windows issue:

https://github.com/aewallin/openvoronoi/blob/master/src/common/halfedgediagram.hpp#L277

When that is commented out, things >seem< to work. perhaps @aewallin can tell us more with that hint?

EDIT: When that is commented out, the minimal example seems to work, others don't segfault anymore but the graph is invalid, so it seems something is working differently in linux vs macos, and it might have to do with edge invalidation, but that is all I can figure out with my limited C++ / boost::graph knowledge ;)

aewallin commented 1 year ago

Does macOS always use Clang as the compiler? gcc vs. clang could be tested on linux also. I can try to take a look at some point - but it's years since I worked with this code seriously..

mmassing commented 1 year ago

Hi Anders, have you seen my PR #53 ? It should fix this issue.

aewallin commented 1 year ago

now merged. but I probably won't have time to test in the next week or so..

mmassing commented 1 year ago

Thanks!