Skip to content

Commit 571be12

Browse files
committed
better management of selections in attributes interpolation (now does a logical or, better plays with interpolation callbacks)
1 parent 62a021e commit 571be12

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/lib/geogram/basic/attributes.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ namespace GEO {
720720
}
721721

722722
static void scale_value(uint8_t& to, double s) {
723-
to = uint8_t(double(to)*s);
723+
to = uint8_t(double(to)*s != 0.0);
724724
}
725725

726726
static void scale_value(int32_t& to, double s) {
@@ -746,7 +746,7 @@ namespace GEO {
746746
}
747747

748748
static void madd_value(uint8_t& to, double s, uint8_t& from) {
749-
to = uint8_t(double(to) + s*double(from));
749+
to = uint8_t(double(to) + s*double(from) != 0.0);
750750
}
751751

752752
static void madd_value(int32_t& to, double s, int32_t& from) {

src/lib/geogram/mesh/mesh_surface_intersection.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -770,21 +770,18 @@ namespace GEO {
770770
mesh_.facets.attributes(), "original_facet_id"
771771
);
772772

773-
Attribute<double> tex_coord(
774-
mesh_.facet_corners.attributes(), "tex_coord"
775-
);
776-
777773
for(index_t c: mesh_.facet_corners) {
778774
index_t f = c/3;
779775
index_t f0 = original_facet_id[f];
776+
// If this is an original facet, there is nothing to do !
780777
if(f == f0) {
781778
continue;
782779
}
783780

781+
index_t v = mesh_.facet_corners.vertex(c);
784782
index_t v1 = mesh_.facets.vertex(f0,0);
785783
index_t v2 = mesh_.facets.vertex(f0,1);
786784
index_t v3 = mesh_.facets.vertex(f0,2);
787-
index_t v = mesh_.facet_corners.vertex(c);
788785

789786
index_t c1 = mesh_.facets.corner(f0,0);
790787
index_t c2 = mesh_.facets.corner(f0,1);

0 commit comments

Comments
 (0)