Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authortamasmeszaros <meszaros.q@gmail.com>2022-01-12 15:54:18 +0300
committertamasmeszaros <meszaros.q@gmail.com>2022-02-03 18:10:03 +0300
commit72da90d28f1d63e84bd23f13a32edf9049489ec0 (patch)
tree91c09f6c00824e6f909d64382f44c377cef824ea /tests
parentb45c6ef173b6709b9215f82c59218728f43bfe6a (diff)
WIP
wip
Diffstat (limited to 'tests')
-rw-r--r--tests/libslic3r/test_marchingsquares.cpp14
-rw-r--r--tests/libslic3r/test_png_io.cpp4
-rw-r--r--tests/sla_print/sla_print_tests.cpp8
-rw-r--r--tests/sla_print/sla_test_utils.cpp6
-rw-r--r--tests/sla_print/sla_test_utils.hpp4
5 files changed, 18 insertions, 18 deletions
diff --git a/tests/libslic3r/test_marchingsquares.cpp b/tests/libslic3r/test_marchingsquares.cpp
index 3553697ac..32b137175 100644
--- a/tests/libslic3r/test_marchingsquares.cpp
+++ b/tests/libslic3r/test_marchingsquares.cpp
@@ -20,17 +20,17 @@
using namespace Slic3r;
-static double area(const sla::RasterBase::PixelDim &pxd)
+static double area(const sla::PixelDim &pxd)
{
return pxd.w_mm * pxd.h_mm;
}
static Slic3r::sla::RasterGrayscaleAA create_raster(
- const sla::RasterBase::Resolution &res,
+ const sla::Resolution &res,
double disp_w = 100.,
double disp_h = 100.)
{
- sla::RasterBase::PixelDim pixdim{disp_w / res.width_px, disp_h / res.height_px};
+ sla::PixelDim pixdim{disp_w / res.width_px, disp_h / res.height_px};
auto bb = BoundingBox({0, 0}, {scaled(disp_w), scaled(disp_h)});
sla::RasterBase::Trafo trafo;
@@ -107,7 +107,7 @@ static void test_expolys(Rst && rst,
svg.Close();
double max_rel_err = 0.1;
- sla::RasterBase::PixelDim pxd = rst.pixel_dimensions();
+ sla::PixelDim pxd = rst.pixel_dimensions();
double max_abs_err = area(pxd) * scaled(1.) * scaled(1.);
BoundingBox ref_bb;
@@ -175,7 +175,7 @@ TEST_CASE("Fully covered raster should result in a rectangle", "[MarchingSquares
TEST_CASE("4x4 raster with one ring", "[MarchingSquares]") {
- sla::RasterBase::PixelDim pixdim{1, 1};
+ sla::PixelDim pixdim{1, 1};
// We need one additional row and column to detect edges
sla::RasterGrayscaleAA rst{{4, 4}, pixdim, {}, agg::gamma_threshold(.5)};
@@ -205,7 +205,7 @@ TEST_CASE("4x4 raster with one ring", "[MarchingSquares]") {
TEST_CASE("4x4 raster with two rings", "[MarchingSquares]") {
- sla::RasterBase::PixelDim pixdim{1, 1};
+ sla::PixelDim pixdim{1, 1};
// We need one additional row and column to detect edges
sla::RasterGrayscaleAA rst{{5, 5}, pixdim, {}, agg::gamma_threshold(.5)};
@@ -321,7 +321,7 @@ static void recreate_object_from_rasters(const std::string &objname, float lh) {
std::vector<ExPolygons> layers = slice_mesh_ex(mesh.its, grid(float(bb.min.z()) + lh, float(bb.max.z()), lh));
- sla::RasterBase::Resolution res{2560, 1440};
+ sla::Resolution res{2560, 1440};
double disp_w = 120.96;
double disp_h = 68.04;
diff --git a/tests/libslic3r/test_png_io.cpp b/tests/libslic3r/test_png_io.cpp
index b4fcd6255..e8229b716 100644
--- a/tests/libslic3r/test_png_io.cpp
+++ b/tests/libslic3r/test_png_io.cpp
@@ -9,9 +9,9 @@
using namespace Slic3r;
-static sla::RasterGrayscaleAA create_raster(const sla::RasterBase::Resolution &res)
+static sla::RasterGrayscaleAA create_raster(const sla::Resolution &res)
{
- sla::RasterBase::PixelDim pixdim{1., 1.};
+ sla::PixelDim pixdim{1., 1.};
auto bb = BoundingBox({0, 0}, {scaled(1.), scaled(1.)});
sla::RasterBase::Trafo trafo;
diff --git a/tests/sla_print/sla_print_tests.cpp b/tests/sla_print/sla_print_tests.cpp
index db8c5e93e..f7b0df339 100644
--- a/tests/sla_print/sla_print_tests.cpp
+++ b/tests/sla_print/sla_print_tests.cpp
@@ -159,8 +159,8 @@ TEST_CASE("FloorSupportsDoNotPierceModel", "[SLASupportGeneration]") {
TEST_CASE("InitializedRasterShouldBeNONEmpty", "[SLARasterOutput]") {
// Default Prusa SL1 display parameters
- sla::RasterBase::Resolution res{2560, 1440};
- sla::RasterBase::PixelDim pixdim{120. / res.width_px, 68. / res.height_px};
+ sla::Resolution res{2560, 1440};
+ sla::PixelDim pixdim{120. / res.width_px, 68. / res.height_px};
sla::RasterGrayscaleAAGammaPower raster(res, pixdim, {}, 1.);
REQUIRE(raster.resolution().width_px == res.width_px);
@@ -186,8 +186,8 @@ TEST_CASE("MirroringShouldBeCorrect", "[SLARasterOutput]") {
TEST_CASE("RasterizedPolygonAreaShouldMatch", "[SLARasterOutput]") {
double disp_w = 120., disp_h = 68.;
- sla::RasterBase::Resolution res{2560, 1440};
- sla::RasterBase::PixelDim pixdim{disp_w / res.width_px, disp_h / res.height_px};
+ sla::Resolution res{2560, 1440};
+ sla::PixelDim pixdim{disp_w / res.width_px, disp_h / res.height_px};
double gamma = 1.;
sla::RasterGrayscaleAAGammaPower raster(res, pixdim, {}, gamma);
diff --git a/tests/sla_print/sla_test_utils.cpp b/tests/sla_print/sla_test_utils.cpp
index 1082df200..d98a92037 100644
--- a/tests/sla_print/sla_test_utils.cpp
+++ b/tests/sla_print/sla_test_utils.cpp
@@ -307,8 +307,8 @@ void check_validity(const TriangleMesh &input_mesh, int flags)
void check_raster_transformations(sla::RasterBase::Orientation o, sla::RasterBase::TMirroring mirroring)
{
double disp_w = 120., disp_h = 68.;
- sla::RasterBase::Resolution res{2560, 1440};
- sla::RasterBase::PixelDim pixdim{disp_w / res.width_px, disp_h / res.height_px};
+ sla::Resolution res{2560, 1440};
+ sla::PixelDim pixdim{disp_w / res.width_px, disp_h / res.height_px};
auto bb = BoundingBox({0, 0}, {scaled(disp_w), scaled(disp_h)});
sla::RasterBase::Trafo trafo{o, mirroring};
@@ -400,7 +400,7 @@ double raster_white_area(const sla::RasterGrayscaleAA &raster)
return a;
}
-double predict_error(const ExPolygon &p, const sla::RasterBase::PixelDim &pd)
+double predict_error(const ExPolygon &p, const sla::PixelDim &pd)
{
auto lines = p.lines();
double pix_err = pixel_area(FullWhite, pd) / 2.;
diff --git a/tests/sla_print/sla_test_utils.hpp b/tests/sla_print/sla_test_utils.hpp
index 2264ad856..7171914d4 100644
--- a/tests/sla_print/sla_test_utils.hpp
+++ b/tests/sla_print/sla_test_utils.hpp
@@ -175,7 +175,7 @@ void check_raster_transformations(sla::RasterBase::Orientation o,
ExPolygon square_with_hole(double v);
-inline double pixel_area(TPixel px, const sla::RasterBase::PixelDim &pxdim)
+inline double pixel_area(TPixel px, const sla::PixelDim &pxdim)
{
return (pxdim.h_mm * pxdim.w_mm) * px * 1. / (FullWhite - FullBlack);
}
@@ -183,7 +183,7 @@ inline double pixel_area(TPixel px, const sla::RasterBase::PixelDim &pxdim)
double raster_white_area(const sla::RasterGrayscaleAA &raster);
long raster_pxsum(const sla::RasterGrayscaleAA &raster);
-double predict_error(const ExPolygon &p, const sla::RasterBase::PixelDim &pd);
+double predict_error(const ExPolygon &p, const sla::PixelDim &pd);
sla::SupportPoints calc_support_pts(
const TriangleMesh & mesh,