18 #include <CGAL/AABB_tree.h>
19 #include <CGAL/AABB_traits.h>
20 #include <CGAL/AABB_face_graph_triangle_primitive.h>
29 #include <boost/foreach.hpp>
34 #pragma warning(disable : 4244)
35 #pragma warning(disable : 4267)
43 using Ray = CGALKernel::Ray_3;
48 template<
typename Po
int3d,
typename Vector >
55 double b = 2.0 * v * w;
56 double c = (w * w) - r * r;
57 double delta = b * b - 4 * a * c;
68 double t = (-b + std::sqrt(delta)) / (2.0 * a);
107 template<
typename VertexIterator,
108 typename HalfedgeGraph,
110 typename CMDMNearestMap >
113 const PointMap &pm_degr,
114 const CMDMNearestMap &nearest_pmap,
115 const VertexIterator p_vertex,
116 std::vector< double > &tab_distance1,
117 std::vector< double > &tab_distance2,
118 std::vector< CGALPoint > &tab_point1,
119 std::vector< CGALPoint > &tab_point2,
126 double variance1 = 0;
129 double variance2 = 0;
131 double covariance = 0;
133 std::vector< double > tab_wi1;
134 std::vector< double > tab_wi2;
135 double somme_distance1 = 0;
136 double somme_distance2 = 0;
137 double somme_wi1 = 0;
138 double somme_wi2 = 0;
139 for(
unsigned int i = 0; i < tab_point1.size(); i++)
141 auto distance_pt1 = tab_point1[i] -
get(pm_degr, p_vertex);
142 double dist_pt1 = sqrt(distance_pt1 * distance_pt1);
143 double wi1 = 1 /
variance / sqrt(2 * 3.141592) *
146 tab_wi1.push_back(wi1);
148 somme_distance1 += tab_distance1[i] * wi1;
150 auto distance_pt2 = tab_point2[i] -
get(nearest_pmap, p_vertex);
151 double dist_pt2 = sqrt(distance_pt2 * distance_pt2);
153 double wi2 = 1 /
variance / sqrt(2 * 3.141592) *
155 tab_wi2.push_back(wi2);
157 somme_distance2 += tab_distance2[i] * wi2;
159 moyenne1 = somme_distance1 / (double)somme_wi1;
160 moyenne2 = somme_distance2 / (double)somme_wi2;
163 for(
unsigned int i = 0; i < tab_point1.size(); i++)
165 variance1 += tab_wi1[i] * pow(tab_distance1[i] - moyenne1, 2);
166 variance2 += tab_wi2[i] * pow(tab_distance2[i] - moyenne2, 2);
168 covariance += tab_wi1[i] * (tab_distance1[i] - moyenne1) *
169 (tab_distance2[i] - moyenne2);
172 variance1 = variance1 / somme_wi1;
173 variance2 = variance2 / somme_wi2;
174 variance1 = sqrt(variance1);
175 variance2 = sqrt(variance2);
176 covariance = covariance / somme_wi1;
177 covariance = (covariance < 0) ? 0 : covariance;
182 (
std::fabs(moyenne1 - moyenne2)) / (std::max(moyenne1, moyenne2) + 1);
185 (
std::fabs(variance1 - variance2)) / (std::max(variance1, variance2) + 1);
187 double f3 = (
std::fabs(variance1 * variance2 - covariance)) /
188 (variance1 * variance2 + 1);
190 tab_f1[p_vertex] += f1;
191 tab_f2[p_vertex] += f2;
192 tab_f3[p_vertex] += f3;
209 template<
typename VertexIterator,
210 typename HalfedgeGraph,
212 typename CMDMNearestMap >
215 const PointMap &pm_degr,
216 const CMDMNearestMap &nearest_pmap,
217 const VertexIterator p_vertex,
218 std::vector< std::array< double, 3 > > &tab_color1,
219 std::vector< std::array< double, 3 > > &tab_color2,
220 std::vector< CGALPoint > &tab_point1,
221 std::vector< CGALPoint > &tab_point2,
230 std::vector< double > tab_wi1;
231 std::vector< double > tab_wi2;
232 double somme_wi1 = 0;
233 double somme_wi2 = 0;
235 for(
unsigned int i = 0; i < tab_point1.size(); i++)
237 auto distance_pt1 = tab_point1[i] -
get(pm_degr, p_vertex);
238 double dist_pt1 = sqrt(distance_pt1 * distance_pt1);
239 double wi1 = 1 /
variance / sqrt(2 * 3.141592) *
241 tab_wi1.push_back(wi1);
244 auto distance_pt2 = tab_point2[i] -
get(nearest_pmap, p_vertex);
245 double dist_pt2 = sqrt(distance_pt2 * distance_pt2);
246 double wi2 = 1 /
variance / sqrt(2 * 3.141592) *
248 tab_wi2.push_back(wi2);
252 std::vector< double > tab_Chr1;
254 std::vector< double > tab_Chr2;
256 std::vector< double > tab_dH;
258 double muL1 = 0, muCh1 = 0;
259 double variance1_L = 0, sL1 = 0;
261 double muL2 = 0, muCh2 = 0;
262 double variance2_L = 0, sL2 = 0;
264 double dL_sq = 0, dCh_sq = 0, dH_sq = 0, sL12 = 0;
266 double somme1_L = 0, somme1_Chr = 0;
267 double somme2_L = 0, somme2_Chr = 0;
268 for(
unsigned int i = 0; i < tab_point1.size(); i++)
271 tab_Chr1.push_back(sqrt(tab_color1[i][1] * tab_color1[i][1] +
272 tab_color1[i][2] * tab_color1[i][2]));
273 somme1_L += tab_color1[i][0] * tab_wi1[i];
274 somme1_Chr += tab_Chr1[i] * tab_wi1[i];
276 tab_Chr2.push_back(sqrt(tab_color2[i][1] * tab_color2[i][1] +
277 tab_color2[i][2] * tab_color2[i][2]));
278 somme2_L += tab_color2[i][0] * tab_wi2[i];
279 somme2_Chr += tab_Chr2[i] * tab_wi2[i];
283 dH = std::pow(tab_color1[i][1] - tab_color2[i][1], 2) +
284 std::pow(tab_color1[i][2] - tab_color2[i][2], 2) -
285 std::pow(tab_Chr1[i] - tab_Chr2[i], 2);
286 tab_dH.push_back((dH < 0) ? 0 : sqrt(dH));
289 muL1 = somme1_L / somme_wi1;
290 muCh1 = somme1_Chr / somme_wi1;
292 muL2 = somme2_L / somme_wi2;
293 muCh2 = somme2_Chr / somme_wi2;
296 for(
unsigned int i = 0; i < tab_point1.size(); i++)
298 variance1_L += tab_wi1[i] * pow(tab_color1[i][0] - muL1, 2);
299 variance2_L += tab_wi2[i] * pow(tab_color2[i][0] - muL2, 2);
301 dH_sq += tab_wi1[i] * tab_dH[i];
302 sL12 += tab_wi1[i] * (tab_color1[i][0] - muL1) *
303 (tab_color2[i][0] - muL2);
306 variance1_L = variance1_L / somme_wi1;
307 sL1 = (variance1_L < 0) ? 0 : sqrt(variance1_L);
309 variance2_L = variance2_L / somme_wi2;
310 sL2 = (variance2_L < 0) ? 0 : sqrt(variance2_L);
312 sL12 = sL12 / somme_wi1;
313 sL12 = (sL12 < 0) ? 0 : sL12;
315 dL_sq = (muL1 - muL2) * (muL1 - muL2);
316 dCh_sq = (muCh1 - muCh2) * (muCh1 - muCh2);
318 dH_sq = dH_sq / somme_wi1;
319 dH_sq = dH_sq * dH_sq;
322 double c1 = 0.002, c2 = 0.1, c3 = 0.1, c4 = 0.002,
325 double f4 = 1 - (1 / (c1 * dL_sq + 1));
327 double f5 = 1 - ((2 * sL1 * sL2 + c2) / (sL1 * sL1 + sL2 * sL2 + c2));
329 double f6 = 1 - ((sL12 + c3) / (sL1 * sL2 + c3));
331 double f7 = 1 - (1 / (c4 * dCh_sq + 1));
333 double f8 = 1 - (1 / (c5 * dH_sq + 1));
335 tab_f4[p_vertex] += f4;
336 tab_f5[p_vertex] += f5;
337 tab_f6[p_vertex] += f6;
338 tab_f7[p_vertex] += f7;
339 tab_f8[p_vertex] += f8;
351 template<
typename HalfedgeGraph,
352 typename VertexColorMap =
typename FEVV::
353 PMap_traits< FEVV::vertex_color_t, MeshSurface >::pmap_type >
356 const HalfedgeGraph &m_poly,
358 std::vector< double > &init_grid_L,
359 std::vector< double > &grid_L,
360 std::vector< std::vector< std::pair< double, double > > > &init_grid_AB)
367 using Color =
typename boost::property_traits< VertexColorMap >::value_type;
368 VertexColorMap _LAB2000HL_Vertexcolormap;
372 double *RGB_Vcolor =
new double[3];
373 double *LAB_Vcolor =
new double[3];
374 double *LAB2000HL_Vcolor =
new double[3];
376 RGB_Vcolor[0] = (v_cm)[vi][0];
377 RGB_Vcolor[1] = (v_cm)[vi][1];
378 RGB_Vcolor[2] = (v_cm)[vi][2];
381 rgb_to_lab(RGB_Vcolor[0], RGB_Vcolor[1], RGB_Vcolor[2], LAB_Vcolor);
390 put(_LAB2000HL_Vertexcolormap,
392 Color(LAB2000HL_Vcolor[0], LAB2000HL_Vcolor[1], LAB2000HL_Vcolor[2]));
396 delete[] LAB2000HL_Vcolor;
399 return _LAB2000HL_Vertexcolormap;
411 template<
typename CMDMMap,
412 typename HalfedgeGraph,
413 typename CMDMNearestMap,
416 typename FaceIterator =
417 typename boost::graph_traits< HalfedgeGraph >::face_iterator >
420 const HalfedgeGraph &m_poly_degrad,
421 CMDMMap &cmdm_degrad,
422 CMDMNearestMap &cmdmm_degrad,
424 const PointMap &pm_degrad,
425 const HalfedgeGraph &m_poly_original,
426 CGAL::SM_Face_index *tab_matched_facet)
429 typename CGAL::AABB_face_graph_triangle_primitive< HalfedgeGraph >;
430 using AABB_Traits =
typename CGAL::AABB_traits< CGALKernel, AABB_Primitive >;
431 using AABB_Tree =
typename CGAL::AABB_tree< AABB_Traits >;
433 using Point_and_primitive_id =
typename AABB_Tree::Point_and_primitive_id;
435 auto original_faces =
faces(m_poly_original);
437 FaceIterator orig_begin = original_faces.first;
438 FaceIterator orig_end = original_faces.second;
440 AABB_Tree tree(orig_begin, orig_end, m_poly_original);
441 tree.accelerate_distance_queries();
450 for(
int i = 0; i < (int)
num_vertices(m_poly_degrad); i++)
454 Point_and_primitive_id pp =
455 tree.closest_point_and_primitive(
get(pm_degrad, vi));
456 auto f_nearest = pp.second;
464 put(cmdmm_degrad, vi, pp.first);
465 tab_matched_facet[i] = f_nearest;
471 put(cmdm_degrad, vi, 0.);
472 put(tag_map, vi, ind);
479 template<
typename PointMap,
480 typename HalfedgeGraph,
481 typename FaceNormalMap,
482 typename VertexCMDMMap >
485 const PointMap &pm_degrad,
486 const FaceNormalMap &fnm_degrad,
488 const HalfedgeGraph &m_poly_original,
489 const PointMap &pm_original,
490 const FaceNormalMap &fnm_original,
493 VertexCMDMMap &cmdm_pmap,
497 auto curvature_map_degr =
501 auto curvature_map_orig =
506 CGAL::SM_Face_index *tab_matched_facet =
510 VertexCMDMMap curv_match_pmap;
512 if(
has_map(pmaps_degrad, std::string(
"v:cmdm_match")))
515 boost::any_cast< VertexCMDMMap >(pmaps_degrad.at(
"v:cmdm_match"));
520 FEVV::make_vertex_property_map< HalfedgeGraph, double >(m_poly_degrad);
521 pmaps_degrad[
"v:cmd_match"] = curv_match_pmap;
526 CMDM_nearest_map cmdm_nearest_pmap;
528 if(
has_map(pmaps_degrad, std::string(
"v:cmdm_nearest")))
530 cmdm_nearest_pmap = boost::any_cast< CMDM_nearest_map >(
531 pmaps_degrad.at(
"v:cmdm_nearest"));
536 FEVV::make_vertex_property_map< HalfedgeGraph, CGALPoint >(
538 pmaps_degrad[
"v:cmdm_nearest"] = cmdm_nearest_pmap;
542 vertex_tag_map tag_map;
544 if(
has_map(pmaps_degrad, std::string(
"v:tag")))
546 tag_map = boost::any_cast< vertex_tag_map >(pmaps_degrad.at(
"v:tag"));
551 FEVV::make_vertex_property_map< HalfedgeGraph, int >(m_poly_degrad);
552 pmaps_degrad[
"v:tag"] = tag_map;
559 double *tab_f1 =
new double[(int)
num_vertices(m_poly_degrad)]();
560 double *tab_f2 =
new double[(int)
num_vertices(m_poly_degrad)]();
561 double *tab_f3 =
new double[(int)
num_vertices(m_poly_degrad)]();
562 double *tab_f4 =
new double[(int)
num_vertices(m_poly_degrad)]();
563 double *tab_f5 =
new double[(int)
num_vertices(m_poly_degrad)]();
564 double *tab_f6 =
new double[(int)
num_vertices(m_poly_degrad)]();
565 double *tab_f7 =
new double[(int)
num_vertices(m_poly_degrad)]();
566 double *tab_f8 =
new double[(int)
num_vertices(m_poly_degrad)]();
576 for(
int ii = 0; ii < (int)
num_vertices(m_poly_original); ii++)
579 auto p0 =
get(pm_original, vi);
580 tab_pm_original[ii] = p0;
584 for(
int ii = 0; ii < (int)
num_vertices(m_poly_degrad); ii++)
587 auto p1 =
get(pm_degrad, vi);
588 tab_pm_degrad[ii] = p1;
600 for(
int ii = 0; ii < (int)
num_vertices(m_poly_degrad); ii++)
603 auto p2 =
get(cmdm_nearest_pmap, vi);
604 tab_cmdm_nearest_pmap[ii] = p2;
609 static std::vector< double > init_grid_L;
610 static std::vector< double > grid_L;
611 static std::vector< std::vector< std::pair< double, double > > > init_grid_AB;
617 m_poly_original, pmaps_original, init_grid_L, grid_L, init_grid_AB);
619 m_poly_degrad, pmaps_degrad, init_grid_L, grid_L, init_grid_AB);
620 VertexColorMap v_cm_match_pmap;
624 double radius_curvature = 0.001;
625 for(
int l = 0; l < nb_level; l++)
627 double min_nrm_min_curvature_deg, max_nrm_min_curvature_deg,
628 min_nrm_max_curvature_deg, max_nrm_max_curvature_deg;
629 double min_nrm_min_curvature_org, max_nrm_min_curvature_org,
630 min_nrm_max_curvature_org, max_nrm_max_curvature_org;
637 maxdim * radius_curvature,
638 min_nrm_min_curvature_deg,
639 max_nrm_min_curvature_deg,
640 min_nrm_max_curvature_deg,
641 max_nrm_max_curvature_deg);
647 maxdim * radius_curvature,
648 min_nrm_min_curvature_org,
649 max_nrm_min_curvature_org,
650 min_nrm_max_curvature_org,
651 max_nrm_max_curvature_org);
659 tab_cmdm_nearest_pmap,
673 std::vector< CGALPoint > tab_point1;
674 std::vector< CGALPoint > tab_point2;
676 std::vector< double > tab_distance1;
677 std::vector< double > tab_distance2;
679 std::vector< std::array< double, 3 > > tab_color1;
680 std::vector< std::array< double, 3 > > tab_color2;
685 tab_cmdm_nearest_pmap,
691 radius_curvature * 3 * maxdim,
710 radius_curvature * 3 * maxdim);
725 radius_curvature * 3 * maxdim);
727 radius_curvature += 0.0005;
730 double sum_f1 = 0, sum_f2 = 0, sum_f3 = 0, sum_f4 = 0, sum_f5 = 0, sum_f6 = 0,
731 sum_f7 = 0, sum_f8 = 0;
732 double w2 = 0.091, w5 = 0.22, w6 = 0.032,
737 for(
int i = 0; i < nb_vertex; ++i)
751 (w2 * tab_f2[i] + w5 * tab_f5[i] + w6 * tab_f6[i] + w7 * tab_f7[i]) /
754 put(cmdm_pmap, vi, LD);
757 sum_f1 = sum_f1 / (nb_vertex * nb_level);
758 sum_f2 = sum_f2 / (nb_vertex * nb_level);
759 sum_f3 = sum_f3 / (nb_vertex * nb_level);
760 sum_f4 = sum_f4 / (nb_vertex * nb_level);
761 sum_f5 = sum_f5 / (nb_vertex * nb_level);
762 sum_f6 = sum_f6 / (nb_vertex * nb_level);
763 sum_f7 = sum_f7 / (nb_vertex * nb_level);
764 sum_f8 = sum_f8 / (nb_vertex * nb_level);
766 CMDM_value = w2 * sum_f2 + w5 * sum_f5 + w6 * sum_f6 + w7 * sum_f7;
768 delete[] tab_pm_original;
769 delete[] tab_pm_degrad;
770 delete[] tab_matched_facet;
771 delete[] tab_cmdm_nearest_pmap;
792 template<
typename HalfedgeGraph,
793 typename CurvatureVertexMap,
794 typename CMDMCurvatureMatchMap,
795 typename VertexColorMap >
798 const HalfedgeGraph &m_poly_degrad,
799 const HalfedgeGraph &m_poly_orig,
802 const CurvatureVertexMap curv_orig,
803 const VertexColorMap vcm_orig,
804 CMDMCurvatureMatchMap curvmatch_pmap,
805 VertexColorMap colmatch_pmap,
806 CGAL::SM_Face_index *tab_matched_facet)
808 using Color =
typename boost::property_traits< VertexColorMap >::value_type;
810 double *tab_curvmatch_pmap =
new double[(int)
num_vertices(m_poly_degrad)];
818 auto *f_nearest = &tab_matched_facet[ind];
833 &tab_pm_orig[
target(
halfedge(*f_nearest, m_poly_orig), m_poly_orig)];
834 auto *x2 = &tab_pm_orig[
target(
835 next(
halfedge(*f_nearest, m_poly_orig), m_poly_orig), m_poly_orig)];
836 auto *x3 = &tab_pm_orig[
target(
840 double l1 = sqrt((*x3 - *x2) * (*x3 - *x2));
841 double l2 = sqrt((*x1 - *x3) * (*x1 - *x3));
842 double l3 = sqrt((*x1 - *x2) * (*x1 - *x2));
844 auto *pt_matched = &tab_cmdmm_degrad[i];
845 auto v1 = *x1 - *pt_matched;
846 auto v2 = *x2 - *pt_matched;
847 auto v3 = *x3 - *pt_matched;
849 double t1 = sqrt(v1 * v1);
850 double t2 = sqrt(v2 * v2);
851 double t3 = sqrt(v3 * v3);
853 double p1 = (l1 + t2 + t3) / 2;
854 double p2 = (t1 + l2 + t3) / 2;
855 double p3 = (t1 + t2 + l3) / 2;
857 double a1 = (p1 * (p1 - l1) * (p1 - t3) * (p1 - t2));
858 double a2 = (p2 * (p2 - l2) * (p2 - t3) * (p2 - t1));
859 double a3 = (p3 * (p3 - l3) * (p3 - t1) * (p3 - t2));
877 double c2 =
get(curv_orig,
888 std::array< double, 3 > col1 = {
895 std::array< double, 3 > col2 = {
905 std::array< double, 3 > col3 = {
919 double curvmatch = 0.0;
920 std::array< double, 3 > colmatch = {0, 0, 0};
921 if((a1 + a2 + a3) > 0)
923 curvmatch = (a1 * c1 + a2 * c2 + a3 * c3) / (a1 + a2 + a3);
924 colmatch = {(a1 * col1[0] + a2 * col2[0] + a3 * col3[0]) / (a1 + a2 + a3),
925 (a1 * col1[1] + a2 * col2[1] + a3 * col3[1]) / (a1 + a2 + a3),
926 (a1 * col1[2] + a2 * col2[2] + a3 * col3[2]) /
931 curvmatch = (c1 + c2 + c3) / 3;
932 colmatch = {(col1[0] + col2[0] + col3[0]) / 3,
933 (col1[1] + col2[1] + col3[1]) / 3,
934 (col1[2] + col2[2] + col3[2]) / 3};
937 tab_curvmatch_pmap[i] = curvmatch;
938 tab_colmatch_pmap[i] =
948 put(curvmatch_pmap, vi, tab_curvmatch_pmap[index]);
949 put(colmatch_pmap, vi, tab_colmatch_pmap[index]);
953 delete[] tab_curvmatch_pmap;
954 delete[] tab_colmatch_pmap;
977 template<
typename VertexIterator,
978 typename HalfedgeGraph,
980 typename CurvatureVertexMap,
981 typename CMDMCurvatureMatchMap,
982 typename VertexColorMap >
985 const HalfedgeGraph &m_degr,
987 const TagMap &tags_pmap,
989 const CurvatureVertexMap &curv_pmap_degr,
990 const VertexColorMap &col_pmap_degr,
991 const CMDMCurvatureMatchMap &curvmatch_pmap,
992 const VertexColorMap &colmatch_pmap,
993 const VertexIterator &p_vertex,
995 std::vector< CGALPoint > &tab_point1,
996 std::vector< CGALPoint > &tab_point2,
997 std::vector< double > &tab_distance1,
998 std::vector< double > &tab_distance2,
999 std::vector< std::array< double, 3 > > &tab_color1,
1000 std::vector< std::array< double, 3 > > &tab_color2)
1004 std::stack< VertexIterator > s;
1006 auto *o = &tab_pm_degr[p_vertex];
1012 tab_point1.push_back(
1013 tab_pm_degr[p_vertex]);
1014 tab_distance1.push_back(
get(curv_pmap_degr, p_vertex).KmaxCurv);
1015 std::array< double, 3 > VertexColor1 = {(col_pmap_degr)[p_vertex][0],
1016 (col_pmap_degr)[p_vertex][1],
1017 (col_pmap_degr)[p_vertex][2]};
1018 tab_color1.push_back(VertexColor1);
1020 tab_point2.push_back(tab_nearest_pmap[p_vertex]);
1022 tab_distance2.push_back(
get(curvmatch_pmap, p_vertex));
1023 std::array< double, 3 > VertexColor2 = {(colmatch_pmap)[p_vertex][0],
1024 (colmatch_pmap)[p_vertex][1],
1025 (colmatch_pmap)[p_vertex][2]};
1026 tab_color2.push_back(VertexColor2);
1028 int nb_sommet_in_sphere = 0;
1032 VertexIterator v_it = s.top();
1040 auto v_target_of_h =
target(h, m_degr);
1042 auto v_target_of_hopp =
target(h_opp, m_degr);
1044 auto *p1 = &tab_pm_degr[v_target_of_h];
1046 auto *p2 = &tab_pm_degr[v_target_of_hopp];
1051 &tab_nearest_pmap[v_target_of_h];
1054 &tab_nearest_pmap[v_target_of_hopp];
1058 auto v = (*p2 - *p1);
1059 auto vm = (*p2m - *p1m);
1061 if(v_it == p_vertex || v * (*p - *o) >= 0.0)
1063 double len_old = std::sqrt(v * v);
1065 double len_edge = std::sqrt(v * v);
1067 nb_sommet_in_sphere++;
1070 double weighted_curv1, weighted_curv2;
1071 std::array< double, 3 > weighted_col1, weighted_col2;
1073 bool is_already_integrated =
false;
1084 is_already_integrated =
true;
1087 if(is_already_integrated ==
false)
1089 if(len_old != 0 && isect)
1091 weighted_p1 = *p1 + v;
1093 (1 - len_edge / len_old) *
1094 get(curv_pmap_degr,
target(h, m_degr)).KmaxCurv +
1095 len_edge / len_old *
1099 (1 - len_edge / len_old) *
1100 get(col_pmap_degr,
target(h, m_degr))[0] +
1101 len_edge / len_old *
1104 (1 - len_edge / len_old) *
1105 get(col_pmap_degr,
target(h, m_degr))[1] +
1106 len_edge / len_old *
1109 (1 - len_edge / len_old) *
1110 get(col_pmap_degr,
target(h, m_degr))[2] +
1111 len_edge / len_old *
1115 weighted_p2 = *p1m + (len_edge / len_old) * vm;
1117 (1 - len_edge / len_old) *
1118 get(curvmatch_pmap,
target(h, m_degr)) +
1119 len_edge / len_old *
1122 (1 - len_edge / len_old) *
1123 get(colmatch_pmap,
target(h, m_degr))[0] +
1124 len_edge / len_old *
1127 (1 - len_edge / len_old) *
1128 get(colmatch_pmap,
target(h, m_degr))[1] +
1129 len_edge / len_old *
1132 (1 - len_edge / len_old) *
1133 get(colmatch_pmap,
target(h, m_degr))[2] +
1134 len_edge / len_old *
1157 tab_point1.push_back(weighted_p1);
1158 tab_distance1.push_back(weighted_curv1);
1159 tab_color1.push_back(weighted_col1);
1161 tab_point2.push_back(weighted_p2);
1162 tab_distance2.push_back(weighted_curv2);
1163 tab_color2.push_back(weighted_col2);
1179 template<
typename HalfedgeGraph,
typename CurvatureVertexMap >
1182 CurvatureVertexMap &curv_vmap,
1187 auto curv =
get(curv_vmap, vi);
1188 double kmax = curv.KmaxCurv * coef;
1189 double kmin = std::abs(curv.KminCurv * coef);
1190 curv.KmaxCurv = (kmax + kmin) / 2.;
1191 put(curv_vmap, vi, curv);
1205 template<
typename HalfedgeGraph,
1208 typename FaceNormalMap,
1209 typename VertexCMDMMap >
1212 const PointMap &pm_degrad,
1213 const FaceNormalMap &fnm_degrad,
1215 const HalfedgeGraph &m_poly_original,
1216 const PointMap &pm_original,
1217 const FaceNormalMap &fnm_original,
1220 VertexCMDMMap &cmdm_pmap,
1223 GeometryTraits gt_deg(m_poly_degrad);
1224 GeometryTraits gt_org(m_poly_original);