mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
PlaceholderParser: new interpolate_table() "function"
interpolate_table(x, (x0, y0), (x1, y1), (x2, y2), ...) interpolates a table at position x.
This commit is contained in:
parent
95d12c24f6
commit
05194ab1f4
3 changed files with 544 additions and 266 deletions
|
@ -65,6 +65,9 @@ SCENARIO("Placeholder parser scripting", "[PlaceholderParser]") {
|
|||
SECTION("math: zdigits(5., 15, 8)") { REQUIRE(parser.process("{zdigits(5, 15, 8)}") == "000005.00000000"); }
|
||||
SECTION("math: digits(13.84375892476, 15, 8)") { REQUIRE(parser.process("{digits(13.84375892476, 15, 8)}") == " 13.84375892"); }
|
||||
SECTION("math: zdigits(13.84375892476, 15, 8)") { REQUIRE(parser.process("{zdigits(13.84375892476, 15, 8)}") == "000013.84375892"); }
|
||||
SECTION("math: interpolate_table(13.84375892476, (0, 0), (20, 20))") { REQUIRE(std::stod(parser.process("{interpolate_table(13.84375892476, (0, 0), (20, 20))}")) == Approx(13.84375892476)); }
|
||||
SECTION("math: interpolate_table(13, (0, 0), (20, 20), (30, 20))") { REQUIRE(std::stod(parser.process("{interpolate_table(13, (0, 0), (20, 20), (30, 20))}")) == Approx(13.)); }
|
||||
SECTION("math: interpolate_table(25, (0, 0), (20, 20), (30, 20))") { REQUIRE(std::stod(parser.process("{interpolate_table(25, (0, 0), (20, 20), (30, 20))}")) == Approx(20.)); }
|
||||
|
||||
// Test the "coFloatOrPercent" and "xxx_extrusion_width" substitutions.
|
||||
// first_layer_extrusion_width ratio_over first_layer_heigth.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue