mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 02:37:51 -06:00
Replaced Point3 with Eigen Vec3crd, removed Point3 from the Perl binding.
This commit is contained in:
parent
0b5b02e002
commit
ac72cd779f
19 changed files with 68 additions and 118 deletions
|
@ -561,15 +561,15 @@ int generate_layer_height_texture(
|
|||
void *data, int rows, int cols, bool level_of_detail_2nd_level)
|
||||
{
|
||||
// https://github.com/aschn/gnuplot-colorbrewer
|
||||
std::vector<Point3> palette_raw;
|
||||
palette_raw.push_back(Point3(0x01A, 0x098, 0x050));
|
||||
palette_raw.push_back(Point3(0x066, 0x0BD, 0x063));
|
||||
palette_raw.push_back(Point3(0x0A6, 0x0D9, 0x06A));
|
||||
palette_raw.push_back(Point3(0x0D9, 0x0F1, 0x0EB));
|
||||
palette_raw.push_back(Point3(0x0FE, 0x0E6, 0x0EB));
|
||||
palette_raw.push_back(Point3(0x0FD, 0x0AE, 0x061));
|
||||
palette_raw.push_back(Point3(0x0F4, 0x06D, 0x043));
|
||||
palette_raw.push_back(Point3(0x0D7, 0x030, 0x027));
|
||||
std::vector<Vec3crd> palette_raw;
|
||||
palette_raw.push_back(Vec3crd(0x01A, 0x098, 0x050));
|
||||
palette_raw.push_back(Vec3crd(0x066, 0x0BD, 0x063));
|
||||
palette_raw.push_back(Vec3crd(0x0A6, 0x0D9, 0x06A));
|
||||
palette_raw.push_back(Vec3crd(0x0D9, 0x0F1, 0x0EB));
|
||||
palette_raw.push_back(Vec3crd(0x0FE, 0x0E6, 0x0EB));
|
||||
palette_raw.push_back(Vec3crd(0x0FD, 0x0AE, 0x061));
|
||||
palette_raw.push_back(Vec3crd(0x0F4, 0x06D, 0x043));
|
||||
palette_raw.push_back(Vec3crd(0x0D7, 0x030, 0x027));
|
||||
|
||||
// Clear the main texture and the 2nd LOD level.
|
||||
// memset(data, 0, rows * cols * (level_of_detail_2nd_level ? 5 : 4));
|
||||
|
@ -600,8 +600,8 @@ int generate_layer_height_texture(
|
|||
int idx1 = clamp(0, int(palette_raw.size() - 1), int(floor(idxf)));
|
||||
int idx2 = std::min(int(palette_raw.size() - 1), idx1 + 1);
|
||||
coordf_t t = idxf - coordf_t(idx1);
|
||||
const Point3 &color1 = palette_raw[idx1];
|
||||
const Point3 &color2 = palette_raw[idx2];
|
||||
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);
|
||||
// Intensity profile to visualize the layers.
|
||||
|
@ -636,8 +636,8 @@ int generate_layer_height_texture(
|
|||
int idx1 = clamp(0, int(palette_raw.size() - 1), int(floor(idxf)));
|
||||
int idx2 = std::min(int(palette_raw.size() - 1), idx1 + 1);
|
||||
coordf_t t = idxf - coordf_t(idx1);
|
||||
const Point3 &color1 = palette_raw[idx1];
|
||||
const Point3 &color2 = palette_raw[idx2];
|
||||
const Vec3crd &color1 = palette_raw[idx1];
|
||||
const Vec3crd &color2 = palette_raw[idx2];
|
||||
// Color mapping from layer height to RGB.
|
||||
Vec3d color(
|
||||
lerp(coordf_t(color1(0)), coordf_t(color2(0)), t),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue