diff --git a/src/libslic3r/Format/SL1_SVG.cpp b/src/libslic3r/Format/SL1_SVG.cpp index 52fad1473..0ea230611 100644 --- a/src/libslic3r/Format/SL1_SVG.cpp +++ b/src/libslic3r/Format/SL1_SVG.cpp @@ -13,7 +13,7 @@ namespace { size_t constexpr coord_t_bufsize = 40; -inline char const* decimal_from(coord_t snumber, char* buffer) +char const* decimal_from(coord_t snumber, char* buffer) { std::make_unsigned_t number = 0; @@ -75,17 +75,18 @@ void append_svg(std::string &buf, const Polygon &poly) auto c = poly.points.front(); -// char intbuf[coord_t_bufsize]; + char intbuf[coord_t_bufsize]; - buf += std::string(" SL1_SVGArchive::create_raster() const // auto res_x = size_t(cfg().display_pixels_x.getInt()); // auto res_y = size_t(cfg().display_pixels_y.getInt()); - size_t res_x = std::round(scaled(w) / cfg().sla_output_precision.getFloat()); - size_t res_y = std::round(scaled(h) / cfg().sla_output_precision.getFloat()); + float precision_nm = scaled(cfg().sla_output_precision.getFloat()); + size_t res_x = std::round(scaled(w) / precision_nm); + size_t res_y = std::round(scaled(h) / precision_nm); std::array mirror; @@ -199,6 +201,7 @@ std::unique_ptr SL1_SVGArchive::create_raster() const if (orientation == sla::RasterBase::roPortrait) { std::swap(w, h); + std::swap(res_x, res_y); } BoundingBox svgarea{{0, 0}, {scaled(w), scaled(h)}}; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 3070f865b..5a674da84 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3809,10 +3809,10 @@ void PrintConfigDef::init_sla_params() def = this->add("sla_output_precision", coFloat); def->label = L("SLA output precision"); def->tooltip = L("Minimum resolution in nanometers"); - def->sidetext = L("nm"); - def->min = 1; + def->sidetext = L("mm"); + def->min = SCALING_FACTOR; def->mode = comExpert; - def->set_default_value(new ConfigOptionFloat(1000)); + def->set_default_value(new ConfigOptionFloat(0.001)); } void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &value)