WIP
wip
This commit is contained in:
parent
b45c6ef173
commit
72da90d28f
10 changed files with 147 additions and 93 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue