mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 11:35:52 +08:00
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_opengl_3
This commit is contained in:
commit
8d8fa46f3f
@ -581,11 +581,6 @@ static void process_arrangeable(const ArrangePolygon &arrpoly,
|
||||
const Vec2crd &offs = arrpoly.translation;
|
||||
double rotation = arrpoly.rotation;
|
||||
|
||||
// This fixes:
|
||||
// https://github.com/prusa3d/PrusaSlicer/issues/2209
|
||||
if (p.points.size() < 3)
|
||||
return;
|
||||
|
||||
outp.emplace_back(std::move(p));
|
||||
outp.back().rotation(rotation);
|
||||
outp.back().translation({offs.x(), offs.y()});
|
||||
|
@ -503,21 +503,19 @@ static void write_thumbnail(Zipper &zipper, const ThumbnailData &data)
|
||||
}
|
||||
}
|
||||
|
||||
void SL1Archive::export_print(const std::string fname,
|
||||
void SL1Archive::export_print(Zipper &zipper,
|
||||
const SLAPrint &print,
|
||||
const ThumbnailsList &thumbnails,
|
||||
const std::string &prjname)
|
||||
{
|
||||
Zipper zipper{fname};
|
||||
|
||||
std::string project =
|
||||
prjname.empty() ?
|
||||
boost::filesystem::path(zipper.get_filename()).stem().string() :
|
||||
prjname;
|
||||
|
||||
|
||||
ConfMap iniconf, slicerconf;
|
||||
fill_iniconf(iniconf, print);
|
||||
|
||||
|
||||
iniconf["jobDir"] = project;
|
||||
|
||||
fill_slicerconf(slicerconf, print);
|
||||
@ -527,13 +525,13 @@ void SL1Archive::export_print(const std::string fname,
|
||||
zipper << to_ini(iniconf);
|
||||
zipper.add_entry("prusaslicer.ini");
|
||||
zipper << to_ini(slicerconf);
|
||||
|
||||
|
||||
size_t i = 0;
|
||||
for (const sla::EncodedRaster &rst : m_layers) {
|
||||
|
||||
std::string imgname = project + string_printf("%.5d", i++) + "." +
|
||||
rst.extension();
|
||||
|
||||
|
||||
zipper.add_entry(imgname.c_str(), rst.data(), rst.size());
|
||||
}
|
||||
|
||||
@ -549,4 +547,14 @@ void SL1Archive::export_print(const std::string fname,
|
||||
}
|
||||
}
|
||||
|
||||
void SL1Archive::export_print(const std::string fname,
|
||||
const SLAPrint &print,
|
||||
const ThumbnailsList &thumbnails,
|
||||
const std::string &prjname)
|
||||
{
|
||||
Zipper zipper{fname, Zipper::FAST_COMPRESSION};
|
||||
|
||||
export_print(zipper, print, thumbnails, prjname);
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
@ -22,8 +22,13 @@ protected:
|
||||
SLAPrinterConfig & cfg() { return m_cfg; }
|
||||
const SLAPrinterConfig & cfg() const { return m_cfg; }
|
||||
|
||||
void export_print(Zipper &,
|
||||
const SLAPrint &print,
|
||||
const ThumbnailsList &thumbnails,
|
||||
const std::string &projectname);
|
||||
|
||||
public:
|
||||
|
||||
|
||||
SL1Archive() = default;
|
||||
explicit SL1Archive(const SLAPrinterConfig &cfg): m_cfg(cfg) {}
|
||||
explicit SL1Archive(SLAPrinterConfig &&cfg): m_cfg(std::move(cfg)) {}
|
||||
|
@ -224,4 +224,14 @@ sla::RasterEncoder SL1_SVGArchive::get_encoder() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SL1_SVGArchive::export_print(const std::string fname,
|
||||
const SLAPrint &print,
|
||||
const ThumbnailsList &thumbnails,
|
||||
const std::string &projectname)
|
||||
{
|
||||
Zipper zipper{fname, Zipper::TIGHT_COMPRESSION};
|
||||
|
||||
SL1Archive::export_print(zipper, print, thumbnails, projectname);
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
@ -14,6 +14,11 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
void export_print(const std::string fname,
|
||||
const SLAPrint &print,
|
||||
const ThumbnailsList &thumbnails,
|
||||
const std::string &projectname = "") override;
|
||||
|
||||
using SL1Archive::SL1Archive;
|
||||
};
|
||||
|
||||
|
@ -818,7 +818,7 @@ private:
|
||||
}
|
||||
// Providing a new mesh, therefore this volume will get a new unique ID assigned.
|
||||
ModelVolume(ModelObject *object, const ModelVolume &other, TriangleMesh &&mesh) :
|
||||
name(other.name), source(other.source), m_mesh(new TriangleMesh(std::move(mesh))), config(other.config), m_type(other.m_type), object(object), m_transformation(other.m_transformation)
|
||||
name(other.name), source(other.source), config(other.config), object(object), m_mesh(new TriangleMesh(std::move(mesh))), m_type(other.m_type), m_transformation(other.m_transformation)
|
||||
{
|
||||
assert(this->id().valid());
|
||||
assert(this->config.id().valid());
|
||||
@ -833,7 +833,7 @@ private:
|
||||
assert(this->config.id() == other.config.id());
|
||||
this->set_material_id(other.material_id());
|
||||
this->config.set_new_unique_id();
|
||||
if (mesh.facets_count() > 1)
|
||||
if (m_mesh->facets_count() > 1)
|
||||
calculate_convex_hull();
|
||||
assert(this->config.id().valid());
|
||||
assert(this->config.id() != other.config.id());
|
||||
|
Loading…
x
Reference in New Issue
Block a user