-
Notifications
You must be signed in to change notification settings - Fork 114
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
Cleaning Hull Algorithm Code #904
Conversation
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.
You should make your changes in one PR or the other - you don't want to generate a bunch of merge conflicts for yourself. Do whatever feels easiest to keep track of.
src/manifold/src/quickhull.cpp
Outdated
|
||
ConvexHull getConvexHullAsMesh(const Vec<glm::dvec3>& pointCloud, bool CCW, | ||
double epsilon) { | ||
Vec<glm::dvec3> pointCloudVec(pointCloud); |
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.
Unnecessary?
src/manifold/src/quickhull.cpp
Outdated
double epsilon) { | ||
Vec<glm::dvec3> pointCloudVec(pointCloud); | ||
QuickHull qh(pointCloudVec); | ||
return qh.buildMesh(CCW, epsilon); |
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.
Let's get rid of CCW too - CCW is always positive in Manifold.
src/manifold/src/impl.cpp
Outdated
@@ -488,8 +488,7 @@ void Manifold::Impl::Hull(const std::vector<glm::vec3>& vertPos) { | |||
Vec<glm::dvec3> pointCloudVec(numVert); | |||
manifold::transform(vertPos.begin(), vertPos.end(), pointCloudVec.begin(), | |||
[](const glm::vec3& v) { return glm::dvec3(v); }); | |||
QuickHull qh(pointCloudVec); | |||
ConvexHull hull = qh.getConvexHullAsMesh(pointCloudVec, false); | |||
ConvexHull hull = getConvexHullAsMesh(pointCloudVec, false); |
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.
You might just merge getConvexHullAsMesh
into Impl::Hull
and put this combined implementation in quickhull.cpp
. Then you can remove ConvexHull
and directly construct halfedge_
and vertPos_
.
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 have merged getConvexHullAsMesh
into Impl::Hull
and removed ConvexHull
. I think it's better to keep the Hull
function inside Impl
, since it follows a similar flow to the other functions inside Impl
. Although if you think it's better to put it into quickhull.cpp
, I can make that change.
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 mean both - notice how our Impl
functions are implemented across many files? You can implement Impl::Hull
in quickhull.cpp
if you want, so long as it imports impl.h
.
I was going through the So maybe we can break the |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #904 +/- ##
==========================================
- Coverage 91.84% 89.68% -2.16%
==========================================
Files 37 66 +29
Lines 4976 9696 +4720
Branches 0 1042 +1042
==========================================
+ Hits 4570 8696 +4126
- Misses 406 1000 +594 ☔ View full report in Codecov by Sentry. |
I think you probably want to do this in the optimization PR. |
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 is looking like great progress to me - @pca006132 any changes you want to see before we merge?
LGTM |
I've removed some redundant functions and structs, I also removed some comments. I had made some changes in the previous PR, which also removed some redundancy in the code. Should I make the same changes here? (like modifying the
for_each
loop to merge two for loops)I was thinking I can pass the
vertPos_
andhalfedge_
to the function as arguments and then modify them inside the quickhull implementation to reduce the size of theimpl
Hull function and also reduce theConvexHull
class. What do you think?