Adaptive layer height profile -> Added Adaptive button to imgui dialog

This commit is contained in:
Enrico Turri 2019-11-12 14:18:43 +01:00
parent 9d5da8b18c
commit b77ba32bb2
5 changed files with 34 additions and 5 deletions

View file

@ -609,7 +609,11 @@ int generate_layer_height_texture(
const Vec3crd &color1 = palette_raw[idx1];
const Vec3crd &color2 = palette_raw[idx2];
coordf_t z = cell_to_z * coordf_t(cell);
assert(z >= lo && z <= hi);
#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
assert((lo - EPSILON <= z) && (z <= hi + EPSILON));
#else
assert(z >= lo && z <= hi);
#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
// Intensity profile to visualize the layers.
coordf_t intensity = cos(M_PI * 0.7 * (mid - z) / h);
// Color mapping from layer height to RGB.