diff --git a/vcg/complex/algorithms/voronoi_remesher.h b/vcg/complex/algorithms/voronoi_remesher.h index eb15f920..75ae1610 100644 --- a/vcg/complex/algorithms/voronoi_remesher.h +++ b/vcg/complex/algorithms/voronoi_remesher.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -43,7 +44,10 @@ #include #include -//#define DEBUG_VORO 1 +#define DEBUG_VORO 1 +#include +#include + namespace vcg { namespace tri { @@ -142,7 +146,7 @@ public: for (size_t i=0; i(); @@ -161,7 +165,7 @@ public: /// \param borderCreaseAngleThreshold is the angle treshold for preserving corner points on the mesh boundary /// \return the remeshed mesh /// - static inline MeshPtr RemeshOneCC(Mesh & original, const ScalarType samplingRadius, const ScalarType borderCreaseAngleThreshold = 0.0) + static inline MeshPtr RemeshOneCC(Mesh & original, const ScalarType samplingRadius, const ScalarType borderCreaseAngleThreshold = 0.0, int idx = 0) { RequireCompactness(original); RequirePerFaceFlags(original); @@ -207,17 +211,9 @@ public: TrivialSampler ps(borderSamples); // uniform sampling - // (use different sampling radius for the edges) UpdateTopology::EdgeEdge(em); SurfaceSampling::EdgeMeshUniform(em, ps, samplingRadius, true); - - // convert to mesh - auto vi = Allocator::AddVertices(poissonEdgeMesh, borderSamples.size()); - for (auto p : borderSamples) - { - vi->P() = CoordType::Construct(p); - vi++; - } + BuildMeshFromCoordVector(poissonEdgeMesh, borderSamples); UpdateBounding::Box(poissonEdgeMesh); // remove duplicate vertices @@ -484,6 +480,8 @@ protected: const std::vector & seedFixed, std::vector & seedVVec) { + // TODO mark here all seeds (cross-border) + typedef typename vcg::SpatialHashTable HashVertexGrid; seedVVec.clear();