-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parity with js version #4
Conversation
morishuz
commented
Sep 8, 2018
•
edited
Loading
edited
- added important changes from new js version to cpp
- removed issue with std::move. coords is now just an argument: simpler and safer.
- simplified sorting (helped with previous point)
- added tests to compare 5000 vertex triangulation with new js version
…nged sort to use lambda which simplifies const coord passing.
src/delaunator.cpp
Outdated
e = m_hull[e].next; | ||
while(!orient(x, y,m_hl[e].x, m_hl[e].y,m_hl[m_hl[e].next].x, m_hl[m_hl[e].next].y)) | ||
{ | ||
e = m_hl[e].next; | ||
|
||
if (e == start) { | ||
throw runtime_error("Something is wrong with the input points."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This place is different in JS — let's port over the fix here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good, i missed that. fixed now
src/delaunator.cpp
Outdated
const long int n = coords.size() >> 1; | ||
Delaunator::Delaunator() | ||
{ | ||
m_epilon = std::pow(2,-52); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo (epsilon)
@morishuz thank you for PR! Unfortunately I have to suggest to close it:
|
Already fixed by other commits, see #2 |