You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i noticed that, in rare cases, jarvis_march fails to produce a valid hull. Instead, it keeps looping around the supplied point list. I have a really hard time understanding the problem (shouldn't be co-planarity, since it works in other cases). Anyway, i applied a patch that works for me. Not sure a PR is worth it, here my addition (which is admittedly not really mathematic-ish):
local checked = 1
while(visited[q]) do
checked = checked + 1
q = points[q + 1] and q + 1 or 1
if (checked == #points) then
return hull
end
end
.. which goes right at line 40, before the loop. This at least prevents the algo to loop over infinitely, while still supplying a valid hull (at least, it looks to me in a test case with ~ 200 procedurally generated point clouds). I'm bothering to write here because it looks @Yonaba's Lua implementation is the landing page for people with convex-hull needs :)
The text was updated successfully, but these errors were encountered:
Well, after more work, i discovered that the bug persists. If you're interested, this implementation worked for me. My - really rough - Lua port is here
Hi, i noticed that, in rare cases,
jarvis_march
fails to produce a valid hull. Instead, it keeps looping around the supplied point list. I have a really hard time understanding the problem (shouldn't be co-planarity, since it works in other cases). Anyway, i applied a patch that works for me. Not sure a PR is worth it, here my addition (which is admittedly not really mathematic-ish):.. which goes right at line 40, before the loop. This at least prevents the algo to loop over infinitely, while still supplying a valid hull (at least, it looks to me in a test case with ~ 200 procedurally generated point clouds). I'm bothering to write here because it looks @Yonaba's Lua implementation is the landing page for people with convex-hull needs :)
The text was updated successfully, but these errors were encountered: