mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
Merge remote-tracking branch 'remotes/origin/master' into vb_wold_object_manipulation
This commit is contained in:
commit
16560f6e27
66 changed files with 6343 additions and 5258 deletions
|
@ -184,7 +184,7 @@ std::string WipeTowerIntegration::append_tcr(GCode &gcodegen, const WipeTower::T
|
|||
|
||||
|
||||
// Disable linear advance for the wipe tower operations.
|
||||
gcode += "M900 K0\n";
|
||||
gcode += (gcodegen.config().gcode_flavor == gcfRepRap ? std::string("M572 D0 S0\n") : std::string("M900 K0\n"));
|
||||
// Move over the wipe tower.
|
||||
// Retract for a tool change, using the toolchange retract value and setting the priming extra length.
|
||||
gcode += gcodegen.retract(true);
|
||||
|
@ -289,7 +289,7 @@ std::string WipeTowerIntegration::prime(GCode &gcodegen)
|
|||
|
||||
if (&m_priming != nullptr && ! m_priming.extrusions.empty()) {
|
||||
// Disable linear advance for the wipe tower operations.
|
||||
gcode += "M900 K0\n";
|
||||
gcode += (gcodegen.config().gcode_flavor == gcfRepRap ? std::string("M572 D0 S0\n") : std::string("M900 K0\n"));
|
||||
// Let the tool change be executed by the wipe tower class.
|
||||
// Inform the G-code writer about the changes done behind its back.
|
||||
gcode += m_priming.gcode;
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace PrusaMultiMaterial {
|
|||
class Writer
|
||||
{
|
||||
public:
|
||||
Writer(float layer_height, float line_width) :
|
||||
Writer(float layer_height, float line_width, GCodeFlavor flavor) :
|
||||
m_current_pos(std::numeric_limits<float>::max(), std::numeric_limits<float>::max()),
|
||||
m_current_z(0.f),
|
||||
m_current_feedrate(0.f),
|
||||
|
@ -48,7 +48,8 @@ public:
|
|||
m_extrusion_flow(0.f),
|
||||
m_preview_suppressed(false),
|
||||
m_elapsed_time(0.f),
|
||||
m_default_analyzer_line_width(line_width)
|
||||
m_default_analyzer_line_width(line_width),
|
||||
m_gcode_flavor(flavor)
|
||||
{
|
||||
// adds tag for analyzer:
|
||||
char buf[64];
|
||||
|
@ -333,7 +334,10 @@ public:
|
|||
Writer& set_extruder_trimpot(int current)
|
||||
{
|
||||
char buf[128];
|
||||
sprintf(buf, "M907 E%d\n", current);
|
||||
if (m_gcode_flavor == gcfRepRap)
|
||||
sprintf(buf, "M906 E%d\n", current);
|
||||
else
|
||||
sprintf(buf, "M907 E%d\n", current);
|
||||
m_gcode += buf;
|
||||
return *this;
|
||||
};
|
||||
|
@ -407,6 +411,7 @@ private:
|
|||
int current_temp = -1;
|
||||
const float m_default_analyzer_line_width;
|
||||
float m_used_filament_length = 0.f;
|
||||
GCodeFlavor m_gcode_flavor;
|
||||
|
||||
std::string set_format_X(float x)
|
||||
{
|
||||
|
@ -510,7 +515,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime(
|
|||
const float prime_section_width = std::min(240.f / tools.size(), 60.f);
|
||||
box_coordinates cleaning_box(xy(5.f, 0.01f + m_perimeter_width/2.f), prime_section_width, 100.f);
|
||||
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width);
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width, m_gcode_flavor);
|
||||
writer.set_extrusion_flow(m_extrusion_flow)
|
||||
.set_z(m_z_pos)
|
||||
.set_initial_tool(m_current_tool)
|
||||
|
@ -612,7 +617,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
|
|||
(tool != (unsigned int)(-1) ? /*m_layer_info->depth*/wipe_area+m_depth_traversed-0.5*m_perimeter_width
|
||||
: m_wipe_tower_depth-m_perimeter_width));
|
||||
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width);
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width, m_gcode_flavor);
|
||||
writer.set_extrusion_flow(m_extrusion_flow)
|
||||
.set_z(m_z_pos)
|
||||
.set_initial_tool(m_current_tool)
|
||||
|
@ -631,7 +636,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
|
|||
|
||||
// Increase the extruder driver current to allow fast ramming.
|
||||
if (m_set_extruder_trimpot)
|
||||
writer.set_extruder_trimpot(550);
|
||||
writer.set_extruder_trimpot(750);
|
||||
|
||||
// Ram the hot material out of the melt zone, retract the filament into the cooling tubes and let it cool.
|
||||
if (tool != (unsigned int)-1){ // This is not the last change.
|
||||
|
@ -693,7 +698,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::toolchange_Brim(bool sideOnly, flo
|
|||
m_wipe_tower_width,
|
||||
m_wipe_tower_depth);
|
||||
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width);
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width, m_gcode_flavor);
|
||||
writer.set_extrusion_flow(m_extrusion_flow * 1.1f)
|
||||
.set_z(m_z_pos) // Let the writer know the current Z position as a base for Z-hop.
|
||||
.set_initial_tool(m_current_tool)
|
||||
|
@ -1022,7 +1027,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::finish_layer()
|
|||
// Otherwise the caller would likely travel to the wipe tower in vain.
|
||||
assert(! this->layer_finished());
|
||||
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width);
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width, m_gcode_flavor);
|
||||
writer.set_extrusion_flow(m_extrusion_flow)
|
||||
.set_z(m_z_pos)
|
||||
.set_initial_tool(m_current_tool)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "WipeTower.hpp"
|
||||
#include "PrintConfig.hpp"
|
||||
|
||||
|
||||
namespace Slic3r
|
||||
|
@ -46,7 +47,7 @@ public:
|
|||
// wipe_area -- space available for one toolchange in mm
|
||||
WipeTowerPrusaMM(float x, float y, float width, float rotation_angle, float cooling_tube_retraction,
|
||||
float cooling_tube_length, float parking_pos_retraction, float extra_loading_move,
|
||||
float bridging, bool set_extruder_trimpot,
|
||||
float bridging, bool set_extruder_trimpot, GCodeFlavor flavor,
|
||||
const std::vector<std::vector<float>>& wiping_matrix, unsigned int initial_tool) :
|
||||
m_wipe_tower_pos(x, y),
|
||||
m_wipe_tower_width(width),
|
||||
|
@ -60,6 +61,7 @@ public:
|
|||
m_extra_loading_move(extra_loading_move),
|
||||
m_bridging(bridging),
|
||||
m_set_extruder_trimpot(set_extruder_trimpot),
|
||||
m_gcode_flavor(flavor),
|
||||
m_current_tool(initial_tool),
|
||||
wipe_volumes(wiping_matrix)
|
||||
{}
|
||||
|
@ -223,6 +225,7 @@ private:
|
|||
bool m_set_extruder_trimpot = false;
|
||||
bool m_retain_speed_override = true;
|
||||
bool m_adhesion = true;
|
||||
GCodeFlavor m_gcode_flavor;
|
||||
|
||||
float m_perimeter_width = 0.4f * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
|
||||
float m_extrusion_flow = 0.038f; //0.029f;// Extrusion flow is derived from m_perimeter_width, layer height and filament diameter.
|
||||
|
|
|
@ -126,7 +126,6 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|
|||
"first_layer_bed_temperature",
|
||||
"first_layer_speed",
|
||||
"gcode_comments",
|
||||
"gcode_flavor",
|
||||
"gcode_label_objects",
|
||||
"infill_acceleration",
|
||||
"layer_gcode",
|
||||
|
@ -1777,7 +1776,7 @@ void Print::_make_wipe_tower()
|
|||
float(m_config.wipe_tower_rotation_angle.value), float(m_config.cooling_tube_retraction.value),
|
||||
float(m_config.cooling_tube_length.value), float(m_config.parking_pos_retraction.value),
|
||||
float(m_config.extra_loading_move.value), float(m_config.wipe_tower_bridging),
|
||||
m_config.high_current_on_filament_swap.value, wipe_volumes,
|
||||
m_config.high_current_on_filament_swap.value, m_config.gcode_flavor, wipe_volumes,
|
||||
m_wipe_tower_data.tool_ordering.first_extruder());
|
||||
|
||||
//wipe_tower.set_retract();
|
||||
|
|
|
@ -131,7 +131,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"as [layer_num] and [layer_z].");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 50;
|
||||
def->height = 5;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -140,7 +140,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("This code is inserted between objects when using sequential printing. By default extruder and bed temperature are reset using non-wait command; however if M104, M109, M140 or M190 are detected in this custom code, Slic3r will not add temperature commands. Note that you can use placeholder variables for all Slic3r settings, so you can put a \"M109 S[first_layer_temperature]\" command wherever you want.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 120;
|
||||
def->height = 12;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -213,7 +213,7 @@ void PrintConfigDef::init_fff_params()
|
|||
|
||||
def = this->add("clip_multipart_objects", coBool);
|
||||
def->label = L("Clip multi-part objects");
|
||||
def->tooltip = L("When printing multi-material objects, this settings will make slic3r "
|
||||
def->tooltip = L("When printing multi-material objects, this settings will make Slic3r "
|
||||
"to clip the overlapping object parts one by the other "
|
||||
"(2nd part will be clipped by the 1st, 3rd part will be clipped by the 1st and 2nd etc).");
|
||||
def->mode = comExpert;
|
||||
|
@ -360,7 +360,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"Note that you can use placeholder variables for all Slic3r settings.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 120;
|
||||
def->height = 12;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("M104 S0 ; turn off temperature\nG28 X0 ; home X axis\nM84 ; disable motors\n");
|
||||
|
||||
|
@ -539,7 +539,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("If layer print time is estimated below this number of seconds, fan will be enabled "
|
||||
"and its speed will be calculated by interpolating the minimum and maximum speeds.");
|
||||
def->sidetext = L("approximate seconds");
|
||||
def->width = 60;
|
||||
def->width = 6;
|
||||
def->min = 0;
|
||||
def->max = 1000;
|
||||
def->mode = comExpert;
|
||||
|
@ -556,7 +556,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("You can put your notes regarding the filament here.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 130;
|
||||
def->height = 13;
|
||||
def->mode = comAdvanced;
|
||||
def->default_value = new ConfigOptionStrings { "" };
|
||||
|
||||
|
@ -1007,7 +1007,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->label = L("Inherits profile");
|
||||
def->tooltip = L("Name of the profile, from which this profile inherits.");
|
||||
def->full_width = true;
|
||||
def->height = 50;
|
||||
def->height = 5;
|
||||
def->default_value = new ConfigOptionString();
|
||||
def->cli = ConfigOptionDef::nocli;
|
||||
|
||||
|
@ -1034,7 +1034,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->cli = "after-layer-gcode|layer-gcode";
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 50;
|
||||
def->height = 5;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -1053,7 +1053,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionBool(true);
|
||||
|
||||
const int machine_limits_opt_width = 70;
|
||||
const int machine_limits_opt_width = 7;
|
||||
{
|
||||
struct AxisDefault {
|
||||
std::string name;
|
||||
|
@ -1252,7 +1252,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"header comments.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 130;
|
||||
def->height = 13;
|
||||
def->mode = comAdvanced;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -1387,7 +1387,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->gui_flags = "serialized";
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 60;
|
||||
def->height = 6;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionStrings();
|
||||
|
||||
|
@ -1402,7 +1402,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("You can put your notes regarding the printer here.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 130;
|
||||
def->height = 13;
|
||||
def->mode = comAdvanced;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -1589,7 +1589,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->label = "";
|
||||
def->full_label = L("Serial port");
|
||||
def->tooltip = L("USB/serial port for printer connection.");
|
||||
def->width = 200;
|
||||
def->width = 20;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
def = this->add("serial_speed", coInt);
|
||||
|
@ -1635,7 +1635,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("If layer print time is estimated below this number of seconds, print moves "
|
||||
"speed will be scaled down to extend duration to this value.");
|
||||
def->sidetext = L("approximate seconds");
|
||||
def->width = 60;
|
||||
def->width = 6;
|
||||
def->min = 0;
|
||||
def->max = 1000;
|
||||
def->mode = comExpert;
|
||||
|
@ -1742,7 +1742,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"a \"M109 S[first_layer_temperature]\" command wherever you want.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 120;
|
||||
def->height = 12;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("G28 ; home all axes\nG1 Z5 F5000 ; lift nozzle\n");
|
||||
|
||||
|
@ -1758,7 +1758,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"in extruder order.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 120;
|
||||
def->height = 12;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionStrings { "; Filament gcode\n" };
|
||||
|
||||
|
@ -2008,7 +2008,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"as [previous_extruder] and [next_extruder].");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 50;
|
||||
def->height = 5;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -2330,7 +2330,7 @@ void PrintConfigDef::init_sla_params()
|
|||
def->tooltip = L("You can put your notes regarding the SLA print material here.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 130;
|
||||
def->height = 13;
|
||||
def->mode = comAdvanced;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
|
|
@ -248,20 +248,21 @@ RawBytes Raster::save(Raster::Compression comp)
|
|||
{
|
||||
assert(m_impl);
|
||||
|
||||
std::uint8_t *ptr = nullptr; size_t s = 0;
|
||||
std::vector<std::uint8_t> data; size_t s = 0;
|
||||
|
||||
switch(comp) {
|
||||
case Compression::PNG: {
|
||||
|
||||
void *rawdata = tdefl_write_image_to_png_file_in_memory(
|
||||
m_impl->buffer().data(),
|
||||
int(resolution().width_px),
|
||||
int(resolution().height_px), 1, &s);
|
||||
|
||||
if(rawdata == nullptr) break;
|
||||
|
||||
ptr = static_cast<std::uint8_t*>(rawdata);
|
||||
|
||||
auto ptr = static_cast<std::uint8_t*>(rawdata);
|
||||
|
||||
data.reserve(s); std::copy(ptr, ptr + s, std::back_inserter(data));
|
||||
|
||||
MZ_FREE(rawdata);
|
||||
break;
|
||||
}
|
||||
case Compression::RAW: {
|
||||
|
@ -270,21 +271,19 @@ RawBytes Raster::save(Raster::Compression comp)
|
|||
std::to_string(m_impl->resolution().height_px) + " " + "255 ";
|
||||
|
||||
auto sz = m_impl->buffer().size()*sizeof(Impl::TBuffer::value_type);
|
||||
|
||||
s = sz + header.size();
|
||||
ptr = static_cast<std::uint8_t*>(MZ_MALLOC(s));
|
||||
|
||||
|
||||
data.reserve(s);
|
||||
|
||||
auto buff = reinterpret_cast<std::uint8_t*>(m_impl->buffer().data());
|
||||
std::copy(buff, buff+sz, ptr + header.size());
|
||||
std::copy(header.begin(), header.end(), std::back_inserter(data));
|
||||
std::copy(buff, buff+sz, std::back_inserter(data));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return {ptr, s};
|
||||
}
|
||||
|
||||
void RawBytes::MinzDeleter::operator()(uint8_t *rawptr)
|
||||
{
|
||||
MZ_FREE(rawptr);
|
||||
return {std::move(data)};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,34 +15,25 @@ class ExPolygon;
|
|||
// Raw byte buffer paired with its size. Suitable for compressed PNG data.
|
||||
class RawBytes {
|
||||
|
||||
class MinzDeleter {
|
||||
public:
|
||||
void operator()(std::uint8_t *rawptr);
|
||||
};
|
||||
|
||||
std::unique_ptr<std::uint8_t, MinzDeleter> m_buffer = nullptr;
|
||||
size_t m_size = 0;
|
||||
|
||||
std::vector<std::uint8_t> m_buffer;
|
||||
public:
|
||||
|
||||
RawBytes() = default;
|
||||
RawBytes(std::uint8_t *rawptr, size_t s): m_buffer(rawptr), m_size(s) {}
|
||||
|
||||
size_t size() const { return m_size; }
|
||||
const uint8_t * data() { return m_buffer.get(); }
|
||||
RawBytes(std::vector<std::uint8_t>&& data): m_buffer(std::move(data)) {}
|
||||
|
||||
size_t size() const { return m_buffer.size(); }
|
||||
const uint8_t * data() { return m_buffer.data(); }
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
// FIXME: the following is needed for MSVC2013 compatibility
|
||||
// /////////////////////////////////////////////////////////////////////////
|
||||
|
||||
RawBytes(const RawBytes&) = delete;
|
||||
RawBytes(RawBytes&& mv):
|
||||
m_buffer(std::move(mv.m_buffer)), m_size(mv.m_size) {}
|
||||
RawBytes(RawBytes&& mv) : m_buffer(std::move(mv.m_buffer)) {}
|
||||
|
||||
RawBytes& operator=(const RawBytes&) = delete;
|
||||
RawBytes& operator=(RawBytes&& mv) {
|
||||
m_buffer.swap(mv.m_buffer);
|
||||
m_size = mv.m_size;
|
||||
m_buffer = std::move(mv.m_buffer);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
@ -846,6 +846,16 @@ public:
|
|||
if(!meshcache_valid) merged_mesh();
|
||||
return model_height;
|
||||
}
|
||||
|
||||
// Intended to be called after the generation is fully complete
|
||||
void clear_support_data() {
|
||||
merged_mesh(); // in case the mesh is not generated, it should be...
|
||||
m_heads.clear();
|
||||
m_pillars.clear();
|
||||
m_junctions.clear();
|
||||
m_bridges.clear();
|
||||
m_compact_bridges.clear();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -2285,6 +2295,7 @@ SLASupportTree::SLASupportTree(const std::vector<SupportPoint> &points,
|
|||
{
|
||||
m_impl->ground_level = emesh.ground_level() - cfg.object_elevation_mm;
|
||||
generate(points, emesh, cfg, ctl);
|
||||
m_impl->clear_support_data();
|
||||
}
|
||||
|
||||
SLASupportTree::SLASupportTree(const SLASupportTree &c):
|
||||
|
|
|
@ -436,6 +436,12 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, const DynamicPrintConf
|
|||
if (new_objects)
|
||||
update_apply_status(false);
|
||||
}
|
||||
|
||||
if(m_objects.empty()) {
|
||||
m_printer.release();
|
||||
m_printer_input.clear();
|
||||
m_print_statistics.clear();
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
check_model_ids_equal(m_model, model);
|
||||
|
@ -668,8 +674,8 @@ void SLAPrint::process()
|
|||
|
||||
// Slicing the model object. This method is oversimplified and needs to
|
||||
// be compared with the fff slicing algorithm for verification
|
||||
auto slice_model = [this, ilhs, ilh](SLAPrintObject& po) {
|
||||
TriangleMesh mesh = po.transformed_mesh();
|
||||
auto slice_model = [this, ilhs, ilh, ilhd](SLAPrintObject& po) {
|
||||
const TriangleMesh& mesh = po.transformed_mesh();
|
||||
|
||||
// We need to prepare the slice index...
|
||||
|
||||
|
@ -685,13 +691,15 @@ void SLAPrint::process()
|
|||
auto maxZs = coord_t(maxZ / SCALING_FACTOR);
|
||||
|
||||
po.m_slice_index.clear();
|
||||
po.m_slice_index.reserve(size_t(maxZs - (minZs + ilhs) / lhs) + 1);
|
||||
po.m_slice_index.emplace_back(minZs + ilhs, float(minZ) + ilh / 2.f, ilh);
|
||||
|
||||
for(coord_t h = minZs + ilhs + lhs; h <= maxZs; h += lhs) {
|
||||
po.m_slice_index.emplace_back(h, float(h*SCALING_FACTOR) - lh / 2.f, lh);
|
||||
}
|
||||
|
||||
size_t cap = size_t(1 + (maxZs - minZs - ilhs) / lhs);
|
||||
po.m_slice_index.reserve(cap);
|
||||
|
||||
po.m_slice_index.emplace_back(minZs + ilhs, minZ + ilhd / 2.0, ilh);
|
||||
|
||||
for(coord_t h = minZs + ilhs + lhs; h <= maxZs; h += lhs)
|
||||
po.m_slice_index.emplace_back(h, h*SCALING_FACTOR - lhd / 2.0, lh);
|
||||
|
||||
// Just get the first record that is form the model:
|
||||
auto slindex_it =
|
||||
po.closest_slice_record(po.m_slice_index, float(bb3d.min(Z)));
|
||||
|
@ -704,11 +712,8 @@ void SLAPrint::process()
|
|||
po.m_model_height_levels.clear();
|
||||
po.m_model_height_levels.reserve(po.m_slice_index.size());
|
||||
for(auto it = slindex_it; it != po.m_slice_index.end(); ++it)
|
||||
{
|
||||
po.m_model_height_levels.emplace_back(it->slice_level());
|
||||
}
|
||||
|
||||
mesh.require_shared_vertices(); // TriangleMeshSlicer needs this
|
||||
TriangleMeshSlicer slicer(&mesh);
|
||||
|
||||
po.m_model_slices.clear();
|
||||
|
@ -1534,7 +1539,7 @@ SLAPrintObject::SLAPrintObject(SLAPrint *print, ModelObject *model_object):
|
|||
Inherited(print, model_object),
|
||||
m_stepmask(slaposCount, true),
|
||||
m_transformed_rmesh( [this](TriangleMesh& obj){
|
||||
obj = m_model_object->raw_mesh(); obj.transform(m_trafo);
|
||||
obj = m_model_object->raw_mesh(); obj.transform(m_trafo); obj.require_shared_vertices();
|
||||
})
|
||||
{
|
||||
}
|
||||
|
@ -1823,7 +1828,7 @@ void SLAPrint::StatusReporter::operator()(
|
|||
SLAPrint &p, double st, const std::string &msg, unsigned flags)
|
||||
{
|
||||
m_st = st;
|
||||
BOOST_LOG_TRIVIAL(info) << st << "% " << msg;
|
||||
BOOST_LOG_TRIVIAL(info) << st << "% " << msg << log_memory_info();
|
||||
p.set_status(int(std::round(st)), msg, flags);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue