-
Notifications
You must be signed in to change notification settings - Fork 119
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
Removing QuickHull dependency #881
Conversation
Looks like some nanobind changes are in the PR - are they needed? |
No they aren't, I didn't realize that changes to nanobind were made, I am not sure how that happened. Also, I am unsure as to how to revert those, any ideas? |
Not completely sure - maybe start here? https://stackoverflow.com/questions/5669358/can-i-do-a-partial-revert-in-git |
Thanks, for the help, seems like I've fixed that issue. |
also please give us a summary on what you have changed comparing to the upstream version |
Ok, so basically I compiled all the header files into |
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.
Any troubler resolving conflicts?
src/manifold/src/quickhull.hpp
Outdated
AB.m_opp = 6; | ||
AB.m_face = 0; | ||
AB.m_next = 1; | ||
m_halfEdges.push_back(AB); |
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.
Can we do something like halfedges.push_back({b, 6, 0, 1})
instead?
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.
Or even just list them all together: halfEdges = {{b, 6, 0, 1}, {...}, ...}
;
src/manifold/src/quickhull.hpp
Outdated
|
||
// HalfEdgeMesh.hpp | ||
|
||
class HalfEdgeMesh { |
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.
Considering we have our own halfedge mesh data structure in Impl
already, is there a chance we can use that instead of this one?
I've made the requested changes, and resolved them for clarity. As discussed I'll tackle the Half edge mesh data structure in another PR. |
Ok, so the tests are failing because
Any ideas on how I can fix it? |
bindings/python/CMakeLists.txt
Outdated
@@ -14,7 +14,6 @@ | |||
|
|||
project(python) | |||
|
|||
add_subdirectory(third_party) |
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.
revert this line.
you removed both the third-party directory inside |
So, I think I'm encountering this error now, although I am not sure
Based on a search, I think it could be caused by But, since I'm not sure could you suggest how to solve this issue? |
yeah just the manifold.yml, remove the third_party pattern. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #881 +/- ##
==========================================
- Coverage 91.84% 89.19% -2.65%
==========================================
Files 37 66 +29
Lines 4976 9691 +4715
Branches 0 1051 +1051
==========================================
+ Hits 4570 8644 +4074
- Misses 406 1047 +641 ☔ View full report in Codecov by Sentry. |
I've sent a request for re-review, could you go through it once, and tell me if I should change something. |
src/manifold/src/quickhull.h
Outdated
@@ -0,0 +1,826 @@ | |||
#ifndef QUICKHULL_HPP_ | |||
#define QUICKHULL_HPP_ |
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.
I think you should add the copyright header from the upstream library (or make one for them), as well as change the define to pragma once
that we typically use.
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.
Should I add both Manfiold copyright header and the upstream header? (also they did mention that we don't need to add anything so what should I add)
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.
I think we can include both.
src/manifold/src/quickhull.h
Outdated
} | ||
|
||
inline double getSquaredDistance(const glm::dvec3& p1, const glm::dvec3& p2) { | ||
return (glm::dot(p1 - p2, p1 - p2)); |
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.
why the additional bracket?
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.
I missed it, I'll change that.
src/manifold/src/quickhull.cpp
Outdated
/* | ||
* Implementation of the 3D QuickHull algorithm by Antti Kuukka | ||
* | ||
* No copyrights. What follows is 100% Public Domain. |
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.
Not sure if this is the best way to put it, I think we typically just acknowledge the source, put an URL as well as state its license. From my understanding, the code is under a certain license doesn't mean the author has no copyright over it.
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 was what he had included in his code. I can include the link, but I don't know which license to acknowledge, could you just tell me what exactly do I need to include I will add that below our license.
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.
Public domain does mean there is no longer a copyright holder. We should modify this line, since our version is no longer public domain (see the apache license above). I would change this to "Derived from the public domain work of Antti Kuukka at github/..."
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.
I've made the change to the license, I hope it's alright now.
Thank you for merging #875, now for the next steps, I was wondering what changes should I make in this pull request? |
Start by merging master and re-enabling your tests - they should work in this branch, right? In fact, that's probably all that's needed to merge this - I believe the rest we're planning for follow-on PRs, right? |
So, yeah ideally it should pass the tests, but I realized a flaw, since while calculating in the algorithm we use a variable epsilon which changes with scale, we won't be able to find the exact epsilon to check whether the point is positive or not, and since when we store it in a mesh or a manifold, the pts are converted back to floats rather than the double used to calculate the hull. I am thinking we can either shift the check for valid hull inside the algorithm implementation itself, so we can check relative to the variable epsilon, or we would need to check using a floating epsilon if we check outside the implementation. What would you suggest? |
We'll be switching to double soon, so as a stopgap, can you just put epsilon as a parameter to |
I've made the change you suggested, currently I'm using the |
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.
Good work - when the tests pass, let's merge it! I look forward to seeing this merge deeper into our own data structures next.
Yeah, I think this seems good for this PR, I look forward to integrating it further into our data structures, I will start working on it from tomorrow. |
Not used since: af2304d ("Removing QuickHull dependency (elalish#881)", 2024-08-08)
I have removed the dependency of quickhull, I was not sure whether we wanted to delete the Makefile for third-party so, I have kept that for now. I also removed the Vector3 struct of the original implementation,replacing it with glm::vec3, and some functions that acted on Vector3. I wanted to know how to use squaredLength() functions and length() functions that show up in editor.d.ts, but are not a part of glm, currently I just added those functions in the namespace of mathutils, but was wondering whether there was a way to access them?