mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Optimization of the tool path preview generation algorithm:
1) Replaced linear search with logarithmic search. 2) Templated the travel path generation, replaced 3 functions with one.
This commit is contained in:
parent
66535b41d5
commit
80490550b5
4 changed files with 161 additions and 309 deletions
|
@ -14,14 +14,14 @@ public:
|
|||
{
|
||||
float rgba[4];
|
||||
|
||||
Color();
|
||||
Color(float r, float g, float b, float a);
|
||||
Color(const float *argba) { memcpy(this->rgba, argba, sizeof(float) * 4); }
|
||||
Color(float r = 1.f, float g = 1.f, float b = 1.f, float a = 1.f) { rgba[0] = r; rgba[1] = g; rgba[2] = b; rgba[3] = a; }
|
||||
|
||||
std::vector<unsigned char> as_bytes() const;
|
||||
|
||||
static const Color Dummy;
|
||||
};
|
||||
|
||||
|
||||
// Color mapping from a <min, max> range into a smooth rainbow of 10 colors.
|
||||
struct Range
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue