Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer
This commit is contained in:
commit
3bdc6e49c1
29 changed files with 997 additions and 115 deletions
|
@ -165,17 +165,6 @@ void BackgroundSlicingProcess::process_fff()
|
|||
}
|
||||
}
|
||||
|
||||
static void write_thumbnail(Zipper& zipper, const ThumbnailData& data)
|
||||
{
|
||||
size_t png_size = 0;
|
||||
void* png_data = tdefl_write_image_to_png_file_in_memory_ex((const void*)data.pixels.data(), data.width, data.height, 4, &png_size, MZ_DEFAULT_LEVEL, 1);
|
||||
if (png_data != nullptr)
|
||||
{
|
||||
zipper.add_entry("thumbnail/thumbnail" + std::to_string(data.width) + "x" + std::to_string(data.height) + ".png", (const std::uint8_t*)png_data, png_size);
|
||||
mz_free(png_data);
|
||||
}
|
||||
}
|
||||
|
||||
void BackgroundSlicingProcess::process_sla()
|
||||
{
|
||||
assert(m_print == m_sla_print);
|
||||
|
@ -189,12 +178,7 @@ void BackgroundSlicingProcess::process_sla()
|
|||
ThumbnailsList thumbnails = this->render_thumbnails(
|
||||
ThumbnailsParams{current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true, true});
|
||||
|
||||
Zipper zipper(export_path);
|
||||
m_sla_print->export_print(zipper);
|
||||
for (const ThumbnailData& data : thumbnails)
|
||||
if (data.is_valid())
|
||||
write_thumbnail(zipper, data);
|
||||
zipper.finalize();
|
||||
m_sla_print->export_print(export_path, thumbnails);
|
||||
|
||||
m_print->set_status(100, (boost::format(_utf8(L("Masked SLA file exported to %1%"))) % export_path).str());
|
||||
} else if (! m_upload_job.empty()) {
|
||||
|
@ -739,13 +723,7 @@ void BackgroundSlicingProcess::prepare_upload()
|
|||
|
||||
ThumbnailsList thumbnails = this->render_thumbnails(
|
||||
ThumbnailsParams{current_print()->full_print_config().option<ConfigOptionPoints>("thumbnails")->values, true, true, true, true});
|
||||
// true, false, true, true); // renders also supports and pad
|
||||
Zipper zipper{source_path.string()};
|
||||
m_sla_print->export_print(zipper, m_upload_job.upload_data.upload_path.string());
|
||||
for (const ThumbnailData& data : thumbnails)
|
||||
if (data.is_valid())
|
||||
write_thumbnail(zipper, data);
|
||||
zipper.finalize();
|
||||
m_sla_print->export_print(source_path.string(),thumbnails, m_upload_job.upload_data.upload_path.string());
|
||||
}
|
||||
|
||||
m_print->set_status(100, (boost::format(_utf8(L("Scheduling upload to `%1%`. See Window -> Print Host Upload Queue"))) % m_upload_job.printhost->get_host()).str());
|
||||
|
|
|
@ -5086,9 +5086,9 @@ BoundingBoxf3 GLCanvas3D::_max_bounding_box(bool include_gizmos, bool include_be
|
|||
|
||||
// clamp max bb size with respect to bed bb size
|
||||
if (!m_picking_enabled) {
|
||||
static const double max_scale_factor = 1.5;
|
||||
static const double max_scale_factor = 2.0;
|
||||
const Vec3d bb_size = bb.size();
|
||||
const Vec3d bed_bb_size = bed_bb.size();
|
||||
const Vec3d bed_bb_size = m_bed.build_volume().bounding_volume().size();
|
||||
if (bb_size.x() > max_scale_factor * bed_bb_size.x() ||
|
||||
bb_size.y() > max_scale_factor * bed_bb_size.y() ||
|
||||
bb_size.z() > max_scale_factor * bed_bb_size.z()) {
|
||||
|
|
|
@ -496,7 +496,7 @@ static const FileWildcards file_wildcards_by_type[FT_SIZE] = {
|
|||
|
||||
/* FT_TEX */ { "Texture"sv, { ".png"sv, ".svg"sv } },
|
||||
|
||||
/* FT_SL1 */ { "Masked SLA files"sv, { ".sl1"sv, ".sl1s"sv } },
|
||||
/* FT_SL1 */ { "Masked SLA files"sv, { ".sl1"sv, ".sl1s"sv, ".pwmx"sv } },
|
||||
};
|
||||
|
||||
// This function produces a Win32 file dialog file template mask to be consumed by wxWidgets on all platforms.
|
||||
|
|
|
@ -134,15 +134,14 @@ void GLGizmoRotate::on_render()
|
|||
if (shader != nullptr) {
|
||||
shader->start_using();
|
||||
|
||||
const float radius = Offset + m_parent.get_selection().get_bounding_box().radius();
|
||||
const bool radius_changed = std::abs(m_old_radius - radius) > EPSILON;
|
||||
m_old_radius = radius;
|
||||
const bool radius_changed = std::abs(m_old_radius - m_radius) > EPSILON;
|
||||
m_old_radius = m_radius;
|
||||
|
||||
ColorRGBA color((m_hover_id != -1) ? m_drag_color : m_highlight_color);
|
||||
render_circle(color, radius_changed);
|
||||
if (m_hover_id != -1) {
|
||||
const bool hover_radius_changed = std::abs(m_old_hover_radius - radius) > EPSILON;
|
||||
m_old_hover_radius = radius;
|
||||
const bool hover_radius_changed = std::abs(m_old_hover_radius - m_radius) > EPSILON;
|
||||
m_old_hover_radius = m_radius;
|
||||
|
||||
render_scale(color, hover_radius_changed);
|
||||
render_snap_radii(color, hover_radius_changed);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "SLAImportJob.hpp"
|
||||
|
||||
#include "libslic3r/SLAPrint.hpp"
|
||||
#include "libslic3r/Format/SL1.hpp"
|
||||
|
||||
#include "slic3r/GUI/GUI.hpp"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "libslic3r/Point.hpp"
|
||||
#include "libslic3r/Geometry.hpp"
|
||||
#include "libslic3r/TriangleMesh.hpp"
|
||||
#include "libslic3r/SLA/IndexedMesh.hpp"
|
||||
#include "admesh/stl.h"
|
||||
|
||||
|
|
|
@ -245,7 +245,7 @@ public:
|
|||
GetBtnsListCtrl()->Rescale();
|
||||
}
|
||||
|
||||
void Notebook::OnNavigationKey(wxNavigationKeyEvent& event)
|
||||
void OnNavigationKey(wxNavigationKeyEvent& event)
|
||||
{
|
||||
if (event.IsWindowChange()) {
|
||||
// change pages
|
||||
|
|
|
@ -233,8 +233,9 @@ OpenGLManager::~OpenGLManager()
|
|||
bool OpenGLManager::init_gl()
|
||||
{
|
||||
if (!m_gl_initialized) {
|
||||
if (glewInit() != GLEW_OK) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Unable to init glew library";
|
||||
GLenum err = glewInit();
|
||||
if (err != GLEW_OK) {
|
||||
BOOST_LOG_TRIVIAL(error) << "Unable to init glew library: " << glewGetErrorString(err);
|
||||
return false;
|
||||
}
|
||||
m_gl_initialized = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue