-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add do_snap parameter to PMP::autorefine_triangle_soup #8744
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?
Conversation
…umber type; tested with EPECK et EPICK
What do you think of |
do you suggest to create a new function |
renaming the named parameter, provided Mael thinks it is a better name too. |
I do not like an |
note that's a named parameter, not a free function |
there is already the named parameter : |
OK, but I also meant the function |
for that one it could be |
and PMP examples fully red https://cgal.geometryfactory.com/CGAL/testsuite/summary-6.1-Ic-91.html?package=Polygon_mesh_processing_Examples |
a8c3c28
to
ab56f76
Compare
void autorefine_triangle_soup(PointRange& soup_points, | ||
TriangleRange& soup_triangles, | ||
const NamedParameters& np = parameters::default_values()) | ||
bool autorefine_triangle_soup_(PointRange& soup_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.
Why does the function name end with an underscore ?
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 need to find another name; I did that temporarily. I added a front function, autorefine_triangle_soup, that dispatches execution between this function and snap_triangle_soup because the mutual calling between them posed difficulties. Is autorefine_triangle_soup_internal a good name?
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.
Putting it in an internal namespace?
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 already the case
} | ||
}; | ||
|
||
CGAL_MUTEX map_mutex; |
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 really have such a global variable?
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 moved it inside the class that is using 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.
We need to schedule a meeting about the visitor wrapper to discuss it + we need a test ensuring that it works as expected.
Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt
Outdated
Show resolved
Hide resolved
Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt
Outdated
Show resolved
Hide resolved
#define PMP_ROUNDING_VERTICES_IN_POLYGON_SOUP_VERBOSE | ||
// #define CGAL_PMP_AUTOREFINE_USE_DEFAULT_VERBOSE |
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.
#define PMP_ROUNDING_VERTICES_IN_POLYGON_SOUP_VERBOSE | |
// #define CGAL_PMP_AUTOREFINE_USE_DEFAULT_VERBOSE |
|
||
namespace PMP = CGAL::Polygon_mesh_processing; | ||
|
||
struct Track_visitor |
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 move the visitor to a test. The example is meant to be minimalistic
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.
Actually it seems that a lot of stuff from this example should be in a test.
Polygon_mesh_processing/doc/Polygon_mesh_processing/Concepts/PMPAutorefinementVisitor.h
Outdated
Show resolved
Hide resolved
size_t id=0; | ||
for(typename PolygonRange::iterator it=soup_triangles.begin(); it!=soup_triangles.end(); ++it) | ||
indexes_soup_triangles.emplace_back((*it), id++); | ||
std::cout << "Test 0" << std::endl; |
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.
debug that should be hidden
bool res=polygon_soup_snap_rounding_impl(soup_points, indexes_soup_triangles, np); | ||
|
||
soup_triangles.clear(); | ||
for(const Indexes_range<Triangle> &t: indexes_soup_triangles) |
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.
missing soup_triangles.reserve(indexes_soup_triangles.size())
}; | ||
|
||
template <typename PolygonRange,typename Map> | ||
struct Wrapp_id_visitor |
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 you inherit from the default visitor, you can only define function you'd like to override.
inline void verbatim_triangle_copy(std::size_t /*tgt_id*/, std::size_t /*src_id*/) {} | ||
inline void new_subtriangle(std::size_t tgt_id, std::size_t src_id) | ||
{ | ||
CGAL_SCOPED_LOCK(map_mutex); |
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 only be used if TBB is used
private: | ||
PolygonRange* triangles; | ||
Map* map_newtriangles; | ||
inline static CGAL_MUTEX map_mutex; |
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 remark here
…e wrapp_visitor of snap_rounding
…MPAutorefinementVisitor.h Co-authored-by: Sebastien Loriot <[email protected]>
…sh_processing.txt Co-authored-by: Sebastien Loriot <[email protected]>
…sh_processing.txt Co-authored-by: Sebastien Loriot <[email protected]>
Summary of Changes
The PR adds the
do_snap
parameter toautorefine_triangle_soup()
. When set totrue
, the coordinates are rounded to fit indouble
with additional subdivisions, preventing any self-intersections from occurring.Todo
Release Management