-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Polyhedron demo - Use subdomain's color only when meshing from labeled images #7800
Polyhedron demo - Use subdomain's color only when meshing from labeled images #7800
Conversation
…e_patch_index-color Polyhedron demo - Use subdomain's color only when meshing from labeled images # Conflicts: # Polyhedron/demo/Polyhedron/Scene_triangulation_3_item.cpp
Domains colors better follow item color
Successfully tested in CGAL-6.0-Ic-96 |
double i = -1; | ||
double patch_hsv_value = use_subdomain_colors ? fmod(c.valueF() + .5, 1.) : c.valueF(); | ||
for (Indices::iterator it = surface_patch_indices_.begin(), | ||
end = surface_patch_indices_.end(); it != end; ++it, i += 1.) | ||
{ | ||
double hue = c.hueF() + 1. / double(nb_patch_indices) * i; | ||
if (hue > 1) { hue -= 1.; } | ||
colors[*it] = QColor::fromHsvF(hue, c.saturationF(), patch_hsv_value); | ||
} |
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.
@ange-clement I have an issue with the demo, and it is caused by this old PR (merged Nov 6 2023).
I think the issue is with this loop (and the next one, that is similar).
Let's suppose nb_patch_indices==1
. At the first iteration of the loop, i
is equal to -1
, and the expression
c.hueF() + 1. / double(nb_patch_indices) * i
is equal to
c.hueF() - 1.
and then is almost certainly an invalid hue (the only valid negative hue is -1.f, for achromatic colors).
Why start i
at -1
instead of 0
like it was before?
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.
What is more, but that is not directly related to your PR, hue
should be in float
instead of double
.
Summary of Changes
Fixes issue #7799 : Surface_patch_index are not colored anymore.
Now, Surface_patch_index are colored by default.
But when meshing from labelled images, the subdomain colors are used.
Release Management