Skip to content

PMP: Accelerate isotropic remeshing #5507

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

Merged
merged 27 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
19e5e4a
Use flaat_set and put it outside the loop
afabri Mar 2, 2021
10f454d
reserve(8) for incident faces to a vertex
afabri Mar 2, 2021
5e2a580
map -> unordered_map
afabri Mar 2, 2021
95ea922
Important gain for Euler::add_face()
afabri Mar 2, 2021
a945c4f
small_vector has reserve()
afabri Mar 2, 2021
22789f6
Replace geometric by combinatorial test
afabri Mar 2, 2021
2ac977b
Early exit in do_intersect of Sphere/Bbox_3
afabri Mar 3, 2021
82e5b3a
Do not collect in a vector per patch, but do the tests directly (@ja…
afabri Mar 3, 2021
dad0287
Remove trailing whitespace
afabri Mar 3, 2021
e7f18df
No need for calling abs for a squared distance
afabri Mar 3, 2021
431c5b8
Comment something experimental that sneaked in
afabri Mar 3, 2021
7785a9c
Use certainly()
afabri Mar 3, 2021
4fab843
Add static filter for Equal_3::operator()(Vector_3, Null_vector)
afabri Mar 3, 2021
2e3bfa8
Reduce calls to target @sloriot please double check the correctness
afabri Mar 4, 2021
45265a7
Replace vector with optional by two vectors. No idea what is better yet
afabri Mar 4, 2021
b1c2dd8
WIP: early exit in the static filter
afabri Mar 7, 2021
643810f
WIP for not hard coding conservative. Todo: Use of Has_filtered
afabri Mar 9, 2021
9274503
remove debug code
afabri Mar 9, 2021
cea8cca
WIP: less computations of degree
afabri Mar 9, 2021
b523916
Check that the kernel has static filters
afabri Mar 10, 2021
ac708f6
use nested class for dispatch
sloriot Mar 10, 2021
3614dee
don't reinvent the wheel
sloriot Mar 10, 2021
2b5cb2d
copy tags
sloriot Mar 10, 2021
e6c2e5c
Simplify. todo: tighter bounds per case or factorization with a lambda
afabri Mar 10, 2021
da17681
Avoid computing degree several times
afabri Mar 10, 2021
109a893
remove #ifdef that should be defined
janetournois Mar 19, 2021
29a40dc
Remove the timer and the output of the result
afabri Mar 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BGL/include/CGAL/boost/graph/Euler_operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,9 @@ add_face(const VertexRange& vr, Graph& g)
patch_start, patch_end;
// cache for set_next and vertex' set_halfedge
typedef std::pair<halfedge_descriptor, halfedge_descriptor> NextCacheEntry;
typedef std::vector<NextCacheEntry> NextCache;
typedef boost::container::small_vector<NextCacheEntry,9> NextCache;
NextCache next_cache;
next_cache.reserve(3 * n);
//next_cache.reserve(3 * n); Unfortunately small_vector has no reserve

// re-link patches if necessary
for (unsigned int i = 0, ii = 1; i<n; ++i, ++ii, ii %= n)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <limits>
#include <utility>
#include <vector>
#include <unordered_map>

#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP
# ifndef CGAL_PMP_COMPUTE_NORMAL_DEBUG
Expand Down Expand Up @@ -506,6 +507,7 @@ compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits<Polyg
typedef typename GT::Vector_3 Vector_3;

std::vector<face_descriptor> incident_faces;
incident_faces.reserve(8);
for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh))
{
if(f == boost::graph_traits<PolygonMesh>::null_face())
Expand Down Expand Up @@ -669,7 +671,7 @@ compute_vertex_normal(typename boost::graph_traits<PolygonMesh>::vertex_descript
VPMap vpmap = choose_parameter(get_parameter(np, internal_np::vertex_point),
get_const_property_map(vertex_point, pmesh));

typedef std::map<face_descriptor, Vector_3> Face_vector_map;
typedef std::unordered_map<face_descriptor, Vector_3> Face_vector_map;
typedef boost::associative_property_map<Face_vector_map> Default_map;

typedef typename internal_np::Lookup_named_param_def<internal_np::face_normal_t,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <boost/range/size.hpp>
#include <boost/range/value_type.hpp>
#include <boost/range/reference.hpp>
#include <boost/container/flat_set.hpp>

#include <array>
#include <set>
Expand Down Expand Up @@ -177,14 +178,16 @@ bool is_polygon_soup_a_polygon_mesh(const PolygonRange& polygons)
//check there is no duplicated ordered edge, and
//check there is no polygon with twice the same vertex
std::set<std::pair<V_ID, V_ID> > edge_set;
boost::container::flat_set<V_ID> polygon_vertices;
V_ID max_id = 0;

for(const Polygon& polygon : polygons)
{
std::size_t nb_edges = boost::size(polygon);
if(nb_edges < 3)
return false;

std::set<V_ID> polygon_vertices;
polygon_vertices.clear();
V_ID prev = *std::prev(boost::end(polygon));
for(V_ID id : polygon)
{
Expand Down