-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add advancing front surface reconstruction algorithm #1996
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
base: master
Are you sure you want to change the base?
Add advancing front surface reconstruction algorithm #1996
Conversation
|
Hi, thanks again for contributing. This PR is particularly hard to deal with: a complex algorithm implemented in some 3.5K lines of code. I'm no expert in meshing in general and this algorithm in particular, so I won't be able to assess this code in terms of how well it implements the papers. Further, even thoroughly checking the logic and exploring refactoring possibilities is well beyond what I can realistically do. Therefore, in my review I will concentrate on making sure that the overall code style is in the PCL spirit. So far I have only scanned the code. Here are initial suggestions:
My next step will be reviewing the |
| { | ||
|
|
||
| /** \brief Align pn's normal with av so they point in the same direction */ | ||
| bool |
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.
Do we need return type? I don't see you ever using it.
|
|
||
| /** \brief Align pn's normal with av so they point in the same direction */ | ||
| bool | ||
| alignNormal (Eigen::Vector3f &pn, const Eigen::Vector3f &av) |
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.
Maybe alignNormals?
| bool | ||
| alignNormal (Eigen::Vector3f &pn, const Eigen::Vector3f &av) | ||
| { | ||
| double dot = pn.dot (av); |
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.
No need to upcast to double. And in general, this function can be reduced to:
if (pn.dot (av) < 0.0f)
pn *= -1;| bool | ||
| alignNormal (AfrontVertexPointType &pn, const AfrontVertexPointType &av) | ||
| { | ||
| Eigen::Vector3f normal = pn.getNormalVector3fMap (); |
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 it should work if you pass pn.getNormalVector3fMap () directly to the alignNormal function, the underlying data should be modified.
I'd move these two functions and the next one (checkNormal) to the common module. I don't really see any existing header file there that would naturally fit them, so propose to create a new one "normals.h".
While doing so, I'd make alignNormals templated on the point types, something like:
template <typename PointNT1, typename PointNT2>
alignNormals (PointNT1& pn, const PointNT2& av)to ensure reusability.
|
|
||
| /** \brief Check if two normals are within a tolerance */ | ||
| bool | ||
| checkNormal (const Eigen::Vector3f n1, const Eigen::Vector3f n2, const double &tol) |
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.
Perhaps checkNormalsEqual?
tol -> angular_threshold
It also makes sense to mention in the docstring that the threshold is in radians.
| } | ||
|
|
||
| AfrontGuidanceFieldPointType | ||
| convertAfrontPointTypeToAfrontGuidanceFieldPointType (const AfrontVertexPointType &p, const double rho) |
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.
Only used in one place, so may be moved directly there. Alternatively, make this a member function of the vertex point type.
| * \return The mid point of the half edge | ||
| */ | ||
| Eigen::Vector3f | ||
| getMidPoint (const Eigen::Vector3f &p1, const Eigen::Vector3f &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.
This is really trivial and is only used in two places, I'd simply expand this at the points of usage.
| * \return DistPoint2LineResults | ||
| */ | ||
| DistPoint2LineResults | ||
| distPoint2Line (const Eigen::Vector3f &p1, const Eigen::Vector3f &p2, const Eigen::Vector3f &p) |
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.
There is a point to line distance function in common in "distances.h" can we reuse 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.
It looks like they are for checking against a line with infinite length, where I need to check against a line segment. Should I add these to this file? I would rename the methods to:
distPointToLineSeg
distLineSegToLineSeg
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.
Yes, please. I'd spell "segment" completely, and also move "distance" part to the end to be similar with already existing function names, i.e. pointToLineSegmentDistance and lineSegmentToLineSegmentDistance. What do you think?
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.
Sounds good.
| * \return DistLine2LineResults | ||
| */ | ||
| DistLine2LineResults | ||
| distLine2Line (const Eigen::Vector3f &p1, const Eigen::Vector3f &p2, const Eigen::Vector3f &p3, const Eigen::Vector3f &p4) |
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 integrate this into aforementioned header file?
| * \return IntersectionLine2PlaneResults | ||
| */ | ||
| IntersectionLine2PlaneResults | ||
| intersectionLine2Plane (const Eigen::Vector3f &p1, const Eigen::Vector3f &p2, const Eigen::Vector3f &origin, const Eigen::Vector3f &u, const Eigen::Vector3f &v) |
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.
There is a function to compute line with plane intersection in common module "intersections.h" file. Can we reuse 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.
I only see lineWithLineIntersection and planeWithPlaneIntersection but no lineWithPlaneIntersection. Is it located somewhere else?
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.
Sorry, my bad. Can we add your function there, then?
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.
OK good. I will move the function to the intersection.h file.
|
#1960 was merged so let's rebase this one to remove the redundant commits. |
|
Hey @taketwo, I just saw this mentioned in a talk at ROSCon, I agree with your first comment- this is hard to review. I just thought I'd mention the ROSCon talk video should be available either now or soon. |
|
Hi Alex, after having read your comment several times, I'm still not sure what was mentioned in the ROSCon talk and what relation it has with this PR. But I'm intrigued, please post a link when it's online ;) |
|
Yes, I was in the talk when I commented above. The talk gave a bit of a explaination, showed some results and then mentioned that it would be available soon as the PR was being reviewed. The results looked good and useful so I checked it out during the talk. @taketwo, I saw your comment that it's hard to check the algorithm, and that you'd just review if the code was in the style of PCL, so I thought it would be helpful to see the results. Maybe @Levi-Armstrong can link to results somewhere. |
|
Sure, the results I presented are shown here. I am currently traveling back from ROSCon 2017 and on Monday I will begin addressing the comments above. |
67410b6 to
cb75d1d
Compare
|
FYI: I'm starting to look at this again. |
SergioRAgostinho
left a comment
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.
Here's a first review which focuses only on CMake related code.
| #ifndef PCL_SURFACE_ADVANCING_FRONT_H_ | ||
| #define PCL_SURFACE_ADVANCING_FRONT_H_ | ||
|
|
||
| #define PCL_NO_PRECOMPILE |
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 normally not a good policy. What forces you to define this?
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 believe it was left over from when I was developing outside pcl. I was getting errors related to my custom point type when using them with other libraries like mls and kdtree, but when I added the define they all went away.
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 reason for not registering your point type in point_types.h[pp] like all the others? Looking at the points included there I would say yours is a perfectly eligible candidate.
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 a support point type for this specific algorithm. What use will it have outside?
Added deficit: will increase build time and binary sizes due to additional template instantiations for all PCL algorithms.
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.
The plan was to only be used by this algorithm. I need to cache additional information for each point in the mesh to support the mesher, but there should not be any use for it outside of this.
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.
👍 makes sense. Let's keep it then.
cmake/pcl_options.cmake
Outdated
|
|
||
| option(BUILD_tools "Useful PCL-based command line tools" ON) | ||
|
|
||
| option(BUILD_surface_afront_debug "Enable afront mesher debug interface" OFF) |
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 should not be added here. At this level there's no guarantee that the surface module will be built, therefore makes no sense to show this here.
Note to self: I have a comment stating that the debug interface should be limited to a tool
surface/CMakeLists.txt
Outdated
| ENDIF(BUILD_surface_on_nurbs) | ||
|
|
||
| IF(BUILD_surface_afront_debug) | ||
| add_definitions(-DAFRONTDEBUG) |
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 still need to see how this is implemented but in general I would prefer to not add definitions. Is there an easy way to avoid this?
surface/CMakeLists.txt
Outdated
| else(BUILD_surface_afront_debug) | ||
| target_link_libraries("${LIB_NAME}" pcl_common pcl_search pcl_kdtree pcl_octree ${VTK_LIBRARIES} ${ON_NURBS_LIBRARIES}) | ||
| endif(BUILD_surface_afront_debug) | ||
|
|
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.
Do you see how things are done for QHull in line 180, that's how you should link with VTK. Move your condition below line 194.
surface/CMakeLists.txt
Outdated
| set(SUBSYS_DEPS common search kdtree octree geometry visualization) | ||
| else(BUILD_surface_afront_debug) | ||
| set(SUBSYS_DEPS common search kdtree octree geometry) | ||
| endif(BUILD_surface_afront_debug) |
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 the perfect file to define your BUILD_surface_afront_debug option. But this block needs to move below line 15, since if the surface module is not build, this option should not pop-up.
You're adding a dependency to geometry which in turn only depends of common. geometry has a number of meshing primitives so I would say that functionally this dependency makes sense. To be checked is exactly what you use from there.
Your conditional branch should not set SUBSYS_DEPS directly, it should just append the visualization dependency to it. I want the module mandatory dependencies to appear on top first, isolated from whatever options the user decides later down the road, in case the surfacemodule is built
test/surface/CMakeLists.txt
Outdated
| if (BUILD_io AND BUILD_features) | ||
| IF(BUILD_surface_afront_debug) | ||
| add_definitions(-DAFRONTDEBUG) | ||
| ENDIF(BUILD_surface_afront_debug) |
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.
Keeping in mind my comment of adding definitions, you should not need to add this here as well. It should come exported the moment you link with the surface target.
tools/CMakeLists.txt
Outdated
| if (BUILD_tools) | ||
| IF(BUILD_surface_afront_debug) | ||
| add_definitions(-DAFRONTDEBUG) | ||
| ENDIF(BUILD_surface_afront_debug) |
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.
Same comment as before
|
FYI: I should be able to start addressing the open items this week. |
|
Thanks. Let's address things by stages, starting with just CMake related issues at first. If possible leave each review stage on it's own commit to make it easier to traverse the history of changes. |
|
Some of the CMake issues are related to debug visualization. As I wrote early on, I think we should just get rid of it. What's your stance on this? |
|
I was wondering if we could refactor that code and use it as a tool. I had a "similar" situation in the past, when I wrote a tracker class, and (of course) found out at some point that it was necessary to inject some more code to aid in understanding what was happening with the tracker. My solution for that was to derive a child class of the tracker to work as a debugger of what was going. The debugger was working as the middle man, wrapping all calls to the parent while having access to the protected members. In this case, the debugger class would only reside in the tools module, alongside an application which invokes it. I was wondering if such strategy could be applied here as well. |
|
This sounds like a reasonable thing to do, although will require extra effort from Levi. |
|
I will see what I can do. I believe this would be good to have since the paper mentions advanced techniques for reconstructing sharp edges where the tool would be useful for implementing this in the future. |
|
Thanks! Then I would suggest to pull the visualization code/tool for another PR, and for now strip this one of everything related to that. Does it sound reasonable? I'll try to go through another review stage in the upcoming days. |
SergioRAgostinho
left a comment
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.
2nd review focused on the new point type you're defining.
| * | ||
| * Point Cloud Library (PCL) - www.pointclouds.org | ||
| * Copyright (c) 2017-, Southwest Research Institute | ||
| * |
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 Sergey already mentioned this somewhere else but you need to add Open Perception here as well.
| #define PCL_SURFACE_ADVANCING_FRONT_POINT_TYPE_H_ | ||
|
|
||
| #include <pcl/point_types.h> | ||
| #include <pcl/register_point_struct.h> |
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 one should not be required, since it's already included by point_types.h
|
|
||
| #include <pcl/point_types.h> | ||
| #include <pcl/register_point_struct.h> | ||
| #include <pcl/impl/instantiate.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.
Why is this required here? There's nothing on this file which makes instantiations.
|
|
||
| namespace pcl | ||
| { | ||
| namespace afront |
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 don't think this extra namespace is required. You're already naming everything Afront....
| curvature = p.curvature; | ||
| max_step = p.max_step; | ||
| max_step_search_radius = p.max_step_search_radius; | ||
| } |
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 are you required to define this? This looks like the default copy constructor and the compiler should generate one for you automatically.
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 just noticed that most of the existing if not all did this so I assumed that there was a reason behind it. Let me know if you would like it removed?
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.
Yes please. 👍 There's a couple of things that happen if you define the copy constructor, because intuitively you're telling the compiler "Wait. My copy process is more complex than usual" and the compiler won't generate a couple of useful methods for you in that case. See https://stackoverflow.com/questions/3734247/what-are-all-the-member-functions-created-by-compiler-for-a-class-does-that-hap#3734268 for more info.
| friend std::ostream & | ||
| operator<< (std::ostream &os, const AfrontVertexPointType &p) | ||
| { | ||
| os << p.x << "\t" << p.y << "\t" << p.z; |
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 actually print all your point type's internal members.
| data_n[3] = 0.0f; | ||
| curvature = p.curvature; | ||
| ideal_edge_length = p.ideal_edge_length; | ||
| } |
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.
Same comment as before.
| friend std::ostream & | ||
| operator<< (std::ostream &os, const AfrontGuidanceFieldPointType &p) | ||
| { | ||
| os << p.x << "\t" << p.y << "\t" << p.z; |
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.
Same comment as before.
| } // namespace afront | ||
| } // namespace pcl | ||
| POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::afront::AfrontVertexPointType, | ||
| (float, x, x) (float, y, y) (float, z, z) (float, normal_x, normal_x) (float, normal_y, normal_y) (float, normal_z, normal_z) (float, curvature, curvature) (float, max_step, max_step) (float, max_step_search_radius, max_step_search_radius)) |
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 you span this over multiple lines to increase readability? Each field on each line.
| (float, x, x) (float, y, y) (float, z, z) (float, normal_x, normal_x) (float, normal_y, normal_y) (float, normal_z, normal_z) (float, curvature, curvature) (float, max_step, max_step) (float, max_step_search_radius, max_step_search_radius)) | ||
|
|
||
| POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::afront::AfrontGuidanceFieldPointType, | ||
| (float, x, x) (float, y, y) (float, z, z) (float, normal_x, normal_x) (float, normal_y, normal_y) (float, normal_z, normal_z) (float, curvature, curvature) (float, ideal_edge_length, ideal_edge_length)) |
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.
Same comment as above.
9096172 to
b50bcea
Compare
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.
Only had time to review the functions you added to common/distance.
Also, there's still a number of warnings being printed in Travis that need to be suppressed.
surface/CMakeLists.txt
Outdated
| "include/pcl/${SUBSYS_NAME}/texture_mapping.h" | ||
| "include/pcl/${SUBSYS_NAME}/poisson.h" | ||
| "include/pcl/${SUBSYS_NAME}/advancing_front.h" | ||
| "include/pcl/${SUBSYS_NAME}/advancing_front_point_type.h" |
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'm thinking that it might not be worth to have a separate header for this. To decide later in a future review.
| Eigen::Vector3f p; /**< \brief The closest point on line segment. */ | ||
| float mu; /**< \brief The corresponding line paramentric value resulting in the minimum distance. */ | ||
| double d; /**< \brief The distance between point and line segments */ | ||
| }; |
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 don't think it makes sense to define this PointToLineSegmentDistanceResults type. I'll suggest a different function signature for pointToLineSegmentDistance and delete this definition altogether.
| else if (c2 <= c1) | ||
| results.mu = 1.0; | ||
| else | ||
| results.mu = c1 / c2; |
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.
it makes no sense to clamp mu between 0 and 1.
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.
It is measuring the distance between a point and a Line segment. Example for the case of triangle edge, I need to know the distance from a point to a line segment so mu must be clamped between 0 and 1 to get the correct distance.
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.
Yes, but this function will be used for more than your triangular case, so that check needs to be done a posteriori.
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.
That's fine as long as the function return mu I can check it in my code.
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.
Then again, the name of the function is distance to line segment and not really distance to line.
@taketwo opinion: Should we allow the option of clamping as a parameter?
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.
Another option could be to modify the existing sqrPointToLineDistance to calculate mu. Then I can get the information I need if that simplifies things.
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.
Oh true, that methods exists! Then my comment makes no sense. I'll delete/strike through everything which is not longer valid.
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.
For clamping please use a combination of std::max and std::min
| results.mu = c1 / c2; | ||
|
|
||
| results.p = results.points[0] + results.mu * v; | ||
| results.d = (p - results.p).norm (); |
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.
If mu is clamped this distance is incorrect.
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.
Explanation above.
| * \param[in] p2 Terminating point of the line | ||
| * \param[in] p The point for calulating the distance to the line | ||
| * \return DistPoint2LineResults | ||
| */ |
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 should not be defined inline and should not be in the header. Create distances.cpp, add the corresponding entry in the CMake file and move it there.
| result.parallel = true; | ||
|
|
||
| dist = pointToLineSegmentDistance (p1, p2, p3); | ||
| result.mu[0] = dist.mu; |
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 only need to compute the point to line segment once because they're parallel. In this situation, you should set both mus and the corresponding interception points to NaN
| else | ||
| { | ||
| result.mu[0] = (d1343 * d4321 - d1321 * d4343) / denom; | ||
| result.mu[1] = (d1343 + result.mu[0] * d4321) / d4343; |
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.
According to my calculations this should be
mu0 = (d4343 * d1321 - d4321* d1343) /det;
mu1 = (d4321 * d1321 - d2121* d1343) /det;Edit: Forgot the determinant. Now the expressions look the same.
| if (result.mu[1] > 1.0) | ||
| result.mu[1] = 1.0; | ||
| else if (result.mu[1] < 0.0) | ||
| result.mu[1] = 0.0; |
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.
Just like before, these clampings make no sense.
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.
Use the combination of std::min and std::max
| result.mu[1] = 0.0; | ||
|
|
||
| result.p[0] = p1 + result.mu[0] * (p2 - p1); | ||
| result.p[1] = p3 + result.mu[1] * (p4 - p3); |
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 makes no sense if the mus are clamped.
|
|
||
| result.d = (result.p[1] - result.p[0]).norm (); | ||
| return result; | ||
| } |
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.
Similar comment here as before in pointToLineSegmentDistance. Move the function to a cpp file, change the signature in the same way and make the corresponding overload.
|
Update the comments. After the discussion, the target now is only changes in the functions signatures and the moving to a normal .cpp file. |
taketwo
left a comment
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.
So far we've been dealing with the helper functions, not the algorithm proper, and the conversation has already 92 comments. To make this more digestable, would it make sense to branch out the meshing class and tool into a separate PR? And here keep only helpers and their tests?
|
|
||
| } | ||
|
|
||
| #include <pcl/common/impl/normals.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.
None of these functions are templated, so should go into src/normals.cpp.
|
|
||
| namespace pcl | ||
| { | ||
| /** \brief Align pn's normal with av so they point in the same direction */ |
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.
Please add explanation of what is returned, not obvious.
| { | ||
| /** \brief Align pn's normal with av so they point in the same direction */ | ||
| bool | ||
| alignNormals (Eigen::Ref<Eigen::Vector3f> pn, const Eigen::Ref<const Eigen::Vector3f> &av); |
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.
Apparently Eigen::Ref<> is the right way to take Eigen objects by reference, but it is not how it is done in PCL. I would be okay if you consistently used this style through the contribution, but it's not the case. Thus I'd propose to switch to "standard" reference to avoid confusing users.
|
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
|
@Levi-Armstrong Hi, I find the pull request about "A implementation of a advancing front surface reconstruction algorithm based on the following papers." But I cannot find the function in pcl repo. Regards, |
|
@Micalson The only way to use it currently, is to build my branch in this PR to be able to leverage this meshing algorithm at them moment. I need to wrap up a few things before this can be merged, but I wanted to fix one know issue at the moment. It currently sometimes will wrap on its self. I believe I have a solution but I have not had time to implement and test. If you run into any issues let me know. |
|
@Levi-Armstrong I get it. Thanks for your reply. |
|
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
65af268 to
52ada29
Compare
|
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
|
This pull request has been automatically marked as stale because it hasn't had Come back whenever you have time. We look forward to your contribution. |
A implementation of a advancing front surface reconstruction algorithm based on the following papers.
Advancing Front Papers
High-Quality Extraction of Isosurfaces from Regular and Irregular Grids
J. Schreiner, C. Scheidegger, C. Silva
IEEE Transactions on Visualization and Computer Graphics (Proceedings of IEEE Visualization); 2006
Direct (Re)Meshing for Efficient Surface Processing
J. Schreiner, C. Scheidegger, S. Fleishman, C. Silva
Computer Graphics Forum (Proceedings of Eurographics); 2006
Triangulating Point-Set Surfaces With Bounded Error
C. Scheidegger, S. Fleishman, C. Silva
Proceedings of the third Eurographics/ACM Symposium on Geometry Processing; 2005
Testing
pcl_advancing_front_reconstruction bun0.pcd bun0.ply -radius 0.05 -rho 0.6Debug interface
In cmake gui enable BUILD_surface_afront_debug and rebuild. When running the command above a pcl viewer window will open and press numbers 0-9 to generated 10^x triangles.
Maintainers
This includes commits from the PR #1960. I planned on waiting for the PR to be merged before submitting this, but my budget goes away at the end of this month so I wanted to get this submitted before then.
Images