Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_world_coordinates

This commit is contained in:
enricoturri1966 2022-02-14 11:06:30 +01:00
commit d5639889d0
3 changed files with 23 additions and 17 deletions

View file

@ -69,7 +69,7 @@ name = Photon Mono X
variants = default variants = default
technology = SLA technology = SLA
family = PHOTON MONO family = PHOTON MONO
default_materials = Generic Blue Resin MONO @0.05 default_materials = Generic Blue Resin @MONO 0.05
# All presets starting with asterisk, for example *common*, are intermediate and they will # All presets starting with asterisk, for example *common*, are intermediate and they will
# not make it into the user interface. # not make it into the user interface.
@ -1940,15 +1940,14 @@ support_pillar_widening_factor = 0
supports_enable = 1 supports_enable = 1
support_small_pillar_diameter_percent = 60% support_small_pillar_diameter_percent = 60%
[sla_print:0.05 ANYCUBIC SLA] [sla_print:0.05 Normal @ANYCUBIC]
inherits = *common print ANYCUBIC SLA* inherits = *common print ANYCUBIC SLA*
layer_height = 0.05 layer_height = 0.05
########### Materials ########### Materials
[sla_material:*common ANYCUBIC SLA*] [sla_material:*common ANYCUBIC SLA*]
compatible_printers_condition = family=="PHOTON MONO" compatible_printers_condition = printer_notes=~/.*PHOTONMONOX.*/
compatible_prints_condition = layer_height == 0.05 compatible_prints_condition = layer_height == 0.05
exposure_time = 7 exposure_time = 7
initial_exposure_time = 40 initial_exposure_time = 40
@ -1959,13 +1958,14 @@ material_notes = LIFT_DISTANCE=8.0\nLIFT_SPEED=2.5\nRETRACT_SPEED=3.0\nBOTTOM_LI
[sla_material:*common 0.05 ANYCUBIC SLA*] [sla_material:*common 0.05 ANYCUBIC SLA*]
inherits = *common ANYCUBIC SLA* inherits = *common ANYCUBIC SLA*
[sla_material:Generic Blue Resin MONO @0.05] [sla_material:Generic Blue Resin @MONO 0.05]
inherits = *common 0.05 ANYCUBIC SLA* inherits = *common 0.05 ANYCUBIC SLA*
exposure_time = 2.5 exposure_time = 2.5
initial_exposure_time = 40 initial_exposure_time = 40
material_type = Tough material_type = Tough
material_vendor = Generic material_vendor = Generic
material_colour = #6080EC material_colour = #6080EC
compatible_printers_condition = printer_notes=~/.*PHOTONMONOX.*/
########## Printers ########## Printers
@ -1973,8 +1973,8 @@ material_colour = #6080EC
printer_technology = SLA printer_technology = SLA
printer_model = PHOTON MONO X printer_model = PHOTON MONO X
printer_variant = default printer_variant = default
default_sla_material_profile = Generic Blue Resin MONO @0.05 default_sla_material_profile = Generic Blue Resin @MONO 0.05
default_sla_print_profile = 0.05 ANYCUBIC SLA default_sla_print_profile = 0.05 Normal @ANYCUBIC
thumbnails = 224x168 thumbnails = 224x168
sla_archive_format = pwmx sla_archive_format = pwmx
bed_shape = 1.48x1.02,193.48x1.02,193.48x121.02,1.48x121.02 bed_shape = 1.48x1.02,193.48x1.02,193.48x121.02,1.48x121.02
@ -1996,5 +1996,3 @@ printer_correction = 1,1,1
gamma_correction = 1 gamma_correction = 1
area_fill = 45 area_fill = 45
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.'\nPRINTER_VENDOR_ANYCUBIC\nPRINTER_MODEL_PHOTONMONOX\n printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.'\nPRINTER_VENDOR_ANYCUBIC\nPRINTER_MODEL_PHOTONMONOX\n

View file

@ -6,6 +6,8 @@
#include <limits> #include <limits>
#include <cstdint> #include <cstdint>
#include <algorithm> #include <algorithm>
#include <string_view>
using namespace std::literals;
namespace Slic3r { namespace Slic3r {
@ -77,20 +79,23 @@ void append_svg(std::string &buf, const Polygon &poly)
char intbuf[coord_t_bufsize]; char intbuf[coord_t_bufsize];
buf += std::string("<path d=\"M ") + decimal_from(c.x(), intbuf); buf += "<path d=\"M "sv;
buf += std::string(" ") + decimal_from(c.y(), intbuf) + " m"; buf += decimal_from(c.x(), intbuf);
buf += " "sv;
buf += decimal_from(c.y(), intbuf);
buf += " m"sv;
for (auto &p : poly) { for (auto &p : poly) {
auto d = p - c; auto d = p - c;
if (d.squaredNorm() == 0) continue; if (d.squaredNorm() == 0) continue;
buf += " "; buf += " "sv;
buf += decimal_from(p.x() - c.x(), intbuf); buf += decimal_from(p.x() - c.x(), intbuf);
buf += " "; buf += " "sv;
buf += decimal_from(p.y() - c.y(), intbuf); buf += decimal_from(p.y() - c.y(), intbuf);
c = p; c = p;
} }
buf += " z\""; // mark path as closed buf += " z\""sv; // mark path as closed
buf += " />\n"; buf += " />\n"sv;
} }
} // namespace } // namespace
@ -167,12 +172,12 @@ public:
sla::EncodedRaster encode(sla::RasterEncoder /*encoder*/) const override sla::EncodedRaster encode(sla::RasterEncoder /*encoder*/) const override
{ {
std::vector<uint8_t> data; std::vector<uint8_t> data;
constexpr const char finish[] = "</svg>\n"; constexpr auto finish = "</svg>\n"sv;
data.reserve(m_svg.size() + std::size(finish)); data.reserve(m_svg.size() + std::size(finish));
std::copy(m_svg.begin(), m_svg.end(), std::back_inserter(data)); std::copy(m_svg.begin(), m_svg.end(), std::back_inserter(data));
std::copy(finish, finish + std::size(finish) - 1, std::back_inserter(data)); std::copy(finish.begin(), finish.end() - 1, std::back_inserter(data));
return sla::EncodedRaster{std::move(data), "svg"}; return sla::EncodedRaster{std::move(data), "svg"};
} }

View file

@ -5,6 +5,9 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <boost/algorithm/string/replace.hpp>
#include <boost/log/trivial.hpp>
#define TAG_INTRO "ANYCUBIC\0\0\0\0" #define TAG_INTRO "ANYCUBIC\0\0\0\0"
#define TAG_HEADER "HEADER\0\0\0\0\0\0" #define TAG_HEADER "HEADER\0\0\0\0\0\0"