Merge branch 'master' of https://github.com/Prusa-Development/PrusaSlicerPrivate into et_transformations
15
resources/icons/dowel.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 27.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="16px" height="16px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
|
||||
<g>
|
||||
<path fill = "#ED6B21" d="M9,12H7c-0.5522847,0-1-0.4477148-1-1V5c0-0.5522847,0.4477153-1,1-1h2c0.5522852,0,1,0.4477153,1,1v6
|
||||
C10,11.5522852,9.5522852,12,9,12z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="none" stroke="#808080" stroke-linecap="round" stroke-miterlimit="10" d="M1.5,6.5h2v-3c0-1.1045694,0.8954306-2,2-2h5c1.1045694,0,2,0.8954306,2,2v3h2"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="none" stroke="#808080" stroke-linecap="round" stroke-miterlimit="10" d="M1.5,9.5h2v3c0,1.1045694,0.8954306,2,2,2h5c1.1045694,0,2-0.8954306,2-2v-3h2"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 899 B |
13
resources/icons/plug.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 27.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="16px" height="16px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
|
||||
<g>
|
||||
<path fill="#ED6B21" d="M9,15H7c-0.5522847,0-1-0.4477148-1-1V5c0-0.5522847,0.4477153-1,1-1h2c0.5522852,0,1,0.4477153,1,1v9
|
||||
C10,14.5522852,9.5522852,15,9,15z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="none" stroke="#808080" stroke-linecap="round" stroke-miterlimit="10" d="M1.5,11.5h2v-8c0-1.1045694,0.8954306-2,2-2h5c1.1045694,0,2,0.8954306,2,2v8h2"/>
|
||||
</g>
|
||||
<line fill="none" stroke="#ED6B21" stroke-linecap="round" stroke-miterlimit="10" x1="1.5" y1="14.5" x2="14.5" y2="14.5"/>
|
||||
</svg>
|
After Width: | Height: | Size: 847 B |
2
resources/profiles/MakerGear.idx
Normal file
@ -0,0 +1,2 @@
|
||||
min_slic3r_version = 2.6.0-alpha1
|
||||
0.1.0 Initial version
|
1754
resources/profiles/MakerGear.ini
Normal file
BIN
resources/profiles/MakerGear/M2_M3.stl
Normal file
1
resources/profiles/MakerGear/M2_M3.svg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
resources/profiles/MakerGear/MAKERGEAR_M2_DUAL_thumbnail.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
resources/profiles/MakerGear/MAKERGEAR_M2_thumbnail.png
Normal file
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 32 KiB |
BIN
resources/profiles/MakerGear/MAKERGEAR_M3_SE_thumbnail.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
resources/profiles/MakerGear/MAKERGEAR_M3_thumbnail.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
resources/profiles/MakerGear/MAKERGEAR_MICRO_thumbnail.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
resources/profiles/MakerGear/MAKERGEAR_U1_thumbnail.png
Normal file
After Width: | Height: | Size: 46 KiB |
@ -150,6 +150,8 @@ namespace ImGui
|
||||
// const wchar_t CustomSupportsMarker = 0x1D;
|
||||
// const wchar_t CustomSeamMarker = 0x1E;
|
||||
// const wchar_t MmuSegmentationMarker = 0x1F;
|
||||
const wchar_t PlugMarker = 0x1C;
|
||||
const wchar_t DowelMarker = 0x1D;
|
||||
// Do not forget use following letters only in wstring
|
||||
const wchar_t DocumentationButton = 0x2600;
|
||||
const wchar_t DocumentationHoverButton = 0x2601;
|
||||
|
@ -1784,9 +1784,7 @@ std::vector<GCode::InstanceToPrint> GCode::sort_print_object_instances(
|
||||
if (ordering == nullptr) {
|
||||
// Sequential print, single object is being printed.
|
||||
assert(object_layers.size() == 1);
|
||||
const Layer *layer = object_layers.front().object_layer;
|
||||
assert(layer != nullptr);
|
||||
out.emplace_back(0, *layer->object(), single_object_instance_idx);
|
||||
out.emplace_back(0, *object_layers.front().object(), single_object_instance_idx);
|
||||
} else {
|
||||
// Create mapping from PrintObject* to ObjectLayerToPrint ID.
|
||||
std::vector<std::pair<const PrintObject*, size_t>> sorted;
|
||||
|
@ -385,7 +385,11 @@ public:
|
||||
bool is_mm_painted() const;
|
||||
// Checks if object contains just one volume and it's a text
|
||||
bool is_text() const;
|
||||
|
||||
// This object may have a varying layer height by painting or by a table.
|
||||
// Even if true is returned, the layer height profile may be "flat" with no difference to default layering.
|
||||
bool has_custom_layering() const
|
||||
{ return ! this->layer_config_ranges.empty() || ! this->layer_height_profile.empty(); }
|
||||
|
||||
ModelInstance* add_instance();
|
||||
ModelInstance* add_instance(const ModelInstance &instance);
|
||||
ModelInstance* add_instance(const Vec3d &offset, const Vec3d &scaling_factor, const Vec3d &rotation, const Vec3d &mirror);
|
||||
|
@ -728,6 +728,7 @@ ExtrusionPaths sort_and_connect_extra_perimeters(const std::vector<ExtrusionPath
|
||||
std::vector<ExtrusionPaths> connected_shells;
|
||||
connected_shells.reserve(extra_perims.size());
|
||||
for (const ExtrusionPaths &ps : extra_perims) {
|
||||
// this will also filter away empty paths
|
||||
connected_shells.push_back(reconnect_extrusion_paths(ps, 1.0 * extrusion_spacing));
|
||||
}
|
||||
|
||||
@ -845,7 +846,18 @@ first_point_found:
|
||||
}
|
||||
}
|
||||
|
||||
ExtrusionPaths reconnected = reconnect_extrusion_paths(sorted_paths, extrusion_spacing * 2.0);
|
||||
ExtrusionPaths reconnected;
|
||||
reconnected.reserve(sorted_paths.size());
|
||||
for (const ExtrusionPath &path : sorted_paths) {
|
||||
if (!reconnected.empty() && (reconnected.back().last_point() - path.first_point()).cast<double>().squaredNorm() <
|
||||
extrusion_spacing * extrusion_spacing * 4.0) {
|
||||
reconnected.back().polyline.points.insert(reconnected.back().polyline.points.end(), path.polyline.points.begin(),
|
||||
path.polyline.points.end());
|
||||
} else {
|
||||
reconnected.push_back(path);
|
||||
}
|
||||
}
|
||||
|
||||
ExtrusionPaths filtered;
|
||||
filtered.reserve(reconnected.size());
|
||||
for (ExtrusionPath &p : reconnected) {
|
||||
@ -1030,12 +1042,6 @@ std::tuple<std::vector<ExtrusionPaths>, Polygons> generate_extra_perimeters_over
|
||||
break;
|
||||
}
|
||||
}
|
||||
Polylines perimeter = intersection_pl(to_polylines(perimeter_polygon), shrinked_overhang_to_cover);
|
||||
if (!perimeter.empty()) {
|
||||
overhang_region.emplace_back();
|
||||
extrusion_paths_append(overhang_region.back(), perimeter, ExtrusionRole::OverhangPerimeter, overhang_flow.mm3_per_mm(),
|
||||
overhang_flow.width(), overhang_flow.height());
|
||||
}
|
||||
|
||||
perimeter_polygon = expand(perimeter_polygon, 0.5 * overhang_flow.scaled_spacing());
|
||||
perimeter_polygon = union_(perimeter_polygon, anchoring);
|
||||
|
@ -474,6 +474,10 @@ std::string Print::validate(std::string* warning) const
|
||||
return L("Some objects are too tall and cannot be printed without extruder collisions.");
|
||||
}
|
||||
|
||||
if (m_config.avoid_crossing_perimeters && m_config.avoid_crossing_curled_overhangs) {
|
||||
return L("Avoid crossing perimeters option and avoid crossing curled overhangs option cannot be both enabled together.");
|
||||
}
|
||||
|
||||
if (m_config.spiral_vase) {
|
||||
size_t total_copies_count = 0;
|
||||
for (const PrintObject *object : m_objects)
|
||||
@ -487,6 +491,47 @@ std::string Print::validate(std::string* warning) const
|
||||
return L("The Spiral Vase option can only be used when printing single material objects.");
|
||||
}
|
||||
|
||||
// Cache of layer height profiles for checking:
|
||||
// 1) Whether all layers are synchronized if printing with wipe tower and / or unsynchronized supports.
|
||||
// 2) Whether layer height is constant for Organic supports.
|
||||
// 3) Whether build volume Z is not violated.
|
||||
std::vector<std::vector<coordf_t>> layer_height_profiles;
|
||||
auto layer_height_profile = [this, &layer_height_profiles](const size_t print_object_idx) -> const std::vector<coordf_t>& {
|
||||
const PrintObject &print_object = *m_objects[print_object_idx];
|
||||
if (layer_height_profiles.empty())
|
||||
layer_height_profiles.assign(m_objects.size(), std::vector<coordf_t>());
|
||||
std::vector<coordf_t> &profile = layer_height_profiles[print_object_idx];
|
||||
if (profile.empty())
|
||||
PrintObject::update_layer_height_profile(*print_object.model_object(), print_object.slicing_parameters(), profile);
|
||||
return profile;
|
||||
};
|
||||
|
||||
// Checks that the print does not exceed the max print height
|
||||
for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx) {
|
||||
const PrintObject &print_object = *m_objects[print_object_idx];
|
||||
//FIXME It is quite expensive to generate object layers just to get the print height!
|
||||
if (auto layers = generate_object_layers(print_object.slicing_parameters(), layer_height_profile(print_object_idx));
|
||||
! layers.empty() && layers.back() > this->config().max_print_height) {
|
||||
return L("The print is taller than the maximum allowed height. You might want to reduce the size of your model"
|
||||
" or change current print settings and retry.");
|
||||
}
|
||||
}
|
||||
|
||||
// Some of the objects has variable layer height applied by painting or by a table.
|
||||
bool has_custom_layering = std::find_if(m_objects.begin(), m_objects.end(),
|
||||
[](const PrintObject *object) { return object->model_object()->has_custom_layering(); })
|
||||
!= m_objects.end();
|
||||
|
||||
// Custom layering is not allowed for tree supports as of now.
|
||||
for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx)
|
||||
if (const PrintObject &print_object = *m_objects[print_object_idx];
|
||||
print_object.has_support_material() && print_object.config().support_material_style.value == smsOrganic &&
|
||||
print_object.model_object()->has_custom_layering()) {
|
||||
if (const std::vector<coordf_t> &layers = layer_height_profile(print_object_idx); ! layers.empty())
|
||||
if (! check_object_layers_fixed(print_object.slicing_parameters(), layers))
|
||||
return L("Variable layer height is not supported with Organic supports.");
|
||||
}
|
||||
|
||||
if (this->has_wipe_tower() && ! m_objects.empty()) {
|
||||
// Make sure all extruders use same diameter filament and have the same nozzle diameter
|
||||
// EPSILON comparison is used for nozzles and 10 % tolerance is used for filaments
|
||||
@ -514,19 +559,8 @@ std::string Print::validate(std::string* warning) const
|
||||
return L("The Wipe Tower is currently not supported for multimaterial sequential prints.");
|
||||
|
||||
if (m_objects.size() > 1) {
|
||||
bool has_custom_layering = false;
|
||||
std::vector<std::vector<coordf_t>> layer_height_profiles;
|
||||
for (const PrintObject *object : m_objects) {
|
||||
has_custom_layering = ! object->model_object()->layer_config_ranges.empty() || ! object->model_object()->layer_height_profile.empty();
|
||||
if (has_custom_layering) {
|
||||
layer_height_profiles.assign(m_objects.size(), std::vector<coordf_t>());
|
||||
break;
|
||||
}
|
||||
}
|
||||
const SlicingParameters &slicing_params0 = m_objects.front()->slicing_parameters();
|
||||
size_t tallest_object_idx = 0;
|
||||
if (has_custom_layering)
|
||||
PrintObject::update_layer_height_profile(*m_objects.front()->model_object(), slicing_params0, layer_height_profiles.front());
|
||||
const SlicingParameters &slicing_params0 = m_objects.front()->slicing_parameters();
|
||||
size_t tallest_object_idx = 0;
|
||||
for (size_t i = 1; i < m_objects.size(); ++ i) {
|
||||
const PrintObject *object = m_objects[i];
|
||||
const SlicingParameters &slicing_params = object->slicing_parameters();
|
||||
@ -541,8 +575,9 @@ std::string Print::validate(std::string* warning) const
|
||||
if (! equal_layering(slicing_params, slicing_params0))
|
||||
return L("The Wipe Tower is only supported for multiple objects if they are sliced equally.");
|
||||
if (has_custom_layering) {
|
||||
PrintObject::update_layer_height_profile(*object->model_object(), slicing_params, layer_height_profiles[i]);
|
||||
if (*(layer_height_profiles[i].end()-2) > *(layer_height_profiles[tallest_object_idx].end()-2))
|
||||
auto &lh = layer_height_profile(i);
|
||||
auto &lh_tallest = layer_height_profile(tallest_object_idx);
|
||||
if (*(lh.end()-2) > *(lh_tallest.end()-2))
|
||||
tallest_object_idx = i;
|
||||
}
|
||||
}
|
||||
|
@ -1792,6 +1792,8 @@ bool PrintObject::update_layer_height_profile(const ModelObject &model_object, c
|
||||
// use the constructor because the assignement is crashing on ASAN OsX
|
||||
layer_height_profile = std::vector<coordf_t>(model_object.layer_height_profile.get());
|
||||
// layer_height_profile = model_object.layer_height_profile;
|
||||
// The layer height returned is sampled with high density for the UI layer height painting
|
||||
// and smoothing tool to work.
|
||||
updated = true;
|
||||
}
|
||||
|
||||
@ -1806,6 +1808,7 @@ bool PrintObject::update_layer_height_profile(const ModelObject &model_object, c
|
||||
if (layer_height_profile.empty()) {
|
||||
//layer_height_profile = layer_height_profile_adaptive(slicing_parameters, model_object.layer_config_ranges, model_object.volumes);
|
||||
layer_height_profile = layer_height_profile_from_ranges(slicing_parameters, model_object.layer_config_ranges);
|
||||
// The layer height profile is already compressed.
|
||||
updated = true;
|
||||
}
|
||||
return updated;
|
||||
|
@ -183,32 +183,47 @@ std::vector<coordf_t> layer_height_profile_from_ranges(
|
||||
// 2) Convert the trimmed ranges to a height profile, fill in the undefined intervals between z=0 and z=slicing_params.object_print_z_max()
|
||||
// with slicing_params.layer_height
|
||||
std::vector<coordf_t> layer_height_profile;
|
||||
for (std::vector<std::pair<t_layer_height_range,coordf_t>>::const_iterator it_range = ranges_non_overlapping.begin(); it_range != ranges_non_overlapping.end(); ++ it_range) {
|
||||
coordf_t lo = it_range->first.first;
|
||||
coordf_t hi = it_range->first.second;
|
||||
coordf_t height = it_range->second;
|
||||
coordf_t last_z = layer_height_profile.empty() ? 0. : layer_height_profile[layer_height_profile.size() - 2];
|
||||
if (lo > last_z + EPSILON) {
|
||||
auto last_z = [&layer_height_profile]() {
|
||||
return layer_height_profile.empty() ? 0. : *(layer_height_profile.end() - 2);
|
||||
};
|
||||
auto lh_append = [&layer_height_profile, last_z](coordf_t z, coordf_t layer_height) {
|
||||
if (! layer_height_profile.empty()) {
|
||||
bool last_z_matches = is_approx(*(layer_height_profile.end() - 2), z);
|
||||
bool last_h_matches = is_approx(layer_height_profile.back(), layer_height);
|
||||
if (last_h_matches) {
|
||||
if (last_z_matches) {
|
||||
// Drop a duplicate.
|
||||
return;
|
||||
}
|
||||
if (layer_height_profile.size() >= 4 && is_approx(*(layer_height_profile.end() - 3), layer_height)) {
|
||||
// Third repetition of the same layer_height. Update z of the last entry.
|
||||
*(layer_height_profile.end() - 2) = z;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
layer_height_profile.push_back(z);
|
||||
layer_height_profile.push_back(layer_height);
|
||||
};
|
||||
|
||||
for (const std::pair<t_layer_height_range,coordf_t> &non_overlapping_range : ranges_non_overlapping) {
|
||||
coordf_t lo = non_overlapping_range.first.first;
|
||||
coordf_t hi = non_overlapping_range.first.second;
|
||||
coordf_t height = non_overlapping_range.second;
|
||||
if (coordf_t z = last_z(); lo > z + EPSILON) {
|
||||
// Insert a step of normal layer height.
|
||||
layer_height_profile.push_back(last_z);
|
||||
layer_height_profile.push_back(slicing_params.layer_height);
|
||||
layer_height_profile.push_back(lo);
|
||||
layer_height_profile.push_back(slicing_params.layer_height);
|
||||
lh_append(z, slicing_params.layer_height);
|
||||
lh_append(lo, slicing_params.layer_height);
|
||||
}
|
||||
// Insert a step of the overriden layer height.
|
||||
layer_height_profile.push_back(lo);
|
||||
layer_height_profile.push_back(height);
|
||||
layer_height_profile.push_back(hi);
|
||||
layer_height_profile.push_back(height);
|
||||
lh_append(lo, height);
|
||||
lh_append(hi, height);
|
||||
}
|
||||
|
||||
coordf_t last_z = layer_height_profile.empty() ? 0. : layer_height_profile[layer_height_profile.size() - 2];
|
||||
if (last_z < slicing_params.object_print_z_height()) {
|
||||
if (coordf_t z = last_z(); z < slicing_params.object_print_z_height()) {
|
||||
// Insert a step of normal layer height up to the object top.
|
||||
layer_height_profile.push_back(last_z);
|
||||
layer_height_profile.push_back(slicing_params.layer_height);
|
||||
layer_height_profile.push_back(slicing_params.object_print_z_height());
|
||||
layer_height_profile.push_back(slicing_params.layer_height);
|
||||
lh_append(z, slicing_params.layer_height);
|
||||
lh_append(slicing_params.object_print_z_height(), slicing_params.layer_height);
|
||||
}
|
||||
|
||||
return layer_height_profile;
|
||||
@ -294,7 +309,7 @@ std::vector<double> layer_height_profile_adaptive(const SlicingParameters& slici
|
||||
print_z += height;
|
||||
}
|
||||
|
||||
double z_gap = slicing_params.object_print_z_height() - layer_height_profile[layer_height_profile.size() - 2];
|
||||
double z_gap = slicing_params.object_print_z_height() - *(layer_height_profile.end() - 2);
|
||||
if (z_gap > 0.0)
|
||||
{
|
||||
layer_height_profile.push_back(slicing_params.object_print_z_height());
|
||||
@ -632,6 +647,40 @@ std::vector<coordf_t> generate_object_layers(
|
||||
return out;
|
||||
}
|
||||
|
||||
// Check whether the layer height profile describes a fixed layer height profile.
|
||||
bool check_object_layers_fixed(
|
||||
const SlicingParameters &slicing_params,
|
||||
const std::vector<coordf_t> &layer_height_profile)
|
||||
{
|
||||
assert(layer_height_profile.size() >= 4);
|
||||
assert(layer_height_profile.size() % 2 == 0);
|
||||
assert(layer_height_profile[0] == 0);
|
||||
|
||||
if (layer_height_profile.size() != 4 && layer_height_profile.size() != 8)
|
||||
return false;
|
||||
|
||||
bool fixed_step1 = is_approx(layer_height_profile[1], layer_height_profile[3]);
|
||||
bool fixed_step2 = layer_height_profile.size() == 4 ||
|
||||
(layer_height_profile[2] == layer_height_profile[4] && is_approx(layer_height_profile[5], layer_height_profile[7]));
|
||||
|
||||
if (! fixed_step1 || ! fixed_step2)
|
||||
return false;
|
||||
|
||||
if (layer_height_profile[2] < 0.5 * slicing_params.first_object_layer_height + EPSILON ||
|
||||
! is_approx(layer_height_profile[3], slicing_params.first_object_layer_height))
|
||||
return false;
|
||||
|
||||
double z_max = layer_height_profile[layer_height_profile.size() - 2];
|
||||
double z_2nd = slicing_params.first_object_layer_height + 0.5 * slicing_params.layer_height;
|
||||
if (z_2nd > z_max)
|
||||
return true;
|
||||
if (z_2nd < *(layer_height_profile.end() - 4) + EPSILON ||
|
||||
! is_approx(layer_height_profile.back(), slicing_params.layer_height))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int generate_layer_height_texture(
|
||||
const SlicingParameters &slicing_params,
|
||||
const std::vector<coordf_t> &layers,
|
||||
|
@ -129,11 +129,11 @@ inline bool equal_layering(const SlicingParameters &sp1, const SlicingParameters
|
||||
typedef std::pair<coordf_t,coordf_t> t_layer_height_range;
|
||||
typedef std::map<t_layer_height_range, ModelConfig> t_layer_config_ranges;
|
||||
|
||||
extern std::vector<coordf_t> layer_height_profile_from_ranges(
|
||||
std::vector<coordf_t> layer_height_profile_from_ranges(
|
||||
const SlicingParameters &slicing_params,
|
||||
const t_layer_config_ranges &layer_config_ranges);
|
||||
|
||||
extern std::vector<double> layer_height_profile_adaptive(
|
||||
std::vector<double> layer_height_profile_adaptive(
|
||||
const SlicingParameters& slicing_params,
|
||||
const ModelObject& object, float quality_factor);
|
||||
|
||||
@ -146,7 +146,7 @@ struct HeightProfileSmoothingParams
|
||||
HeightProfileSmoothingParams(unsigned int radius, bool keep_min) : radius(radius), keep_min(keep_min) {}
|
||||
};
|
||||
|
||||
extern std::vector<double> smooth_height_profile(
|
||||
std::vector<double> smooth_height_profile(
|
||||
const std::vector<double>& profile, const SlicingParameters& slicing_params,
|
||||
const HeightProfileSmoothingParams& smoothing_params);
|
||||
|
||||
@ -157,7 +157,7 @@ enum LayerHeightEditActionType : unsigned int {
|
||||
LAYER_HEIGHT_EDIT_ACTION_SMOOTH = 3
|
||||
};
|
||||
|
||||
extern void adjust_layer_height_profile(
|
||||
void adjust_layer_height_profile(
|
||||
const SlicingParameters &slicing_params,
|
||||
std::vector<coordf_t> &layer_height_profile,
|
||||
coordf_t z,
|
||||
@ -167,14 +167,19 @@ extern void adjust_layer_height_profile(
|
||||
|
||||
// Produce object layers as pairs of low / high layer boundaries, stored into a linear vector.
|
||||
// The object layers are based at z=0, ignoring the raft layers.
|
||||
extern std::vector<coordf_t> generate_object_layers(
|
||||
std::vector<coordf_t> generate_object_layers(
|
||||
const SlicingParameters &slicing_params,
|
||||
const std::vector<coordf_t> &layer_height_profile);
|
||||
|
||||
// Check whether the layer height profile describes a fixed layer height profile.
|
||||
bool check_object_layers_fixed(
|
||||
const SlicingParameters &slicing_params,
|
||||
const std::vector<coordf_t> &layer_height_profile);
|
||||
|
||||
// Produce a 1D texture packed into a 2D texture describing in the RGBA format
|
||||
// the planned object layers.
|
||||
// Returns number of cells used by the texture of the 0th LOD level.
|
||||
extern int generate_layer_height_texture(
|
||||
int generate_layer_height_texture(
|
||||
const SlicingParameters &slicing_params,
|
||||
const std::vector<coordf_t> &layers,
|
||||
void *data, int rows, int cols, bool level_of_detail_2nd_level);
|
||||
|
@ -923,7 +923,9 @@ static void generate_initial_areas(
|
||||
// does not turn valid in double the amount of layers a slope of support angle would take to travel xy_distance, nothing reasonable will come from it.
|
||||
// The 2*z_distance_delta is only a catch for when the support angle is very high.
|
||||
// Used only if not min_xy_dist.
|
||||
const coord_t max_overhang_insert_lag = std::max<coord_t>(round_up_divide(mesh_config.xy_distance, max_overhang_speed / 2), 2 * mesh_config.z_distance_top_layers);
|
||||
const coord_t max_overhang_insert_lag = mesh_config.z_distance_top_layers > 0 ?
|
||||
std::max<coord_t>(round_up_divide(mesh_config.xy_distance, max_overhang_speed / 2), 2 * mesh_config.z_distance_top_layers) :
|
||||
0;
|
||||
|
||||
//FIXME
|
||||
size_t num_support_layers = print_object.layer_count();
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "libslic3r/Format/SL1.hpp"
|
||||
#include "libslic3r/Thread.hpp"
|
||||
#include "libslic3r/libslic3r.h"
|
||||
#include "libslic3r/BuildVolume.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <stdexcept>
|
||||
@ -145,20 +144,6 @@ std::string BackgroundSlicingProcess::output_filepath_for_project(const boost::f
|
||||
void BackgroundSlicingProcess::process_fff()
|
||||
{
|
||||
assert(m_print == m_fff_print);
|
||||
|
||||
// Checks that the print does not exceed the max print height
|
||||
const BuildVolume& build_volume = GUI::wxGetApp().mainframe->m_plater->build_volume();
|
||||
auto objects = m_fff_print->objects();
|
||||
for (auto obj : objects) {
|
||||
std::vector<coordf_t> layer_height_profile;
|
||||
PrintObject::update_layer_height_profile(*obj->model_object(), obj->slicing_parameters(), layer_height_profile);
|
||||
auto layers = generate_object_layers(obj->slicing_parameters(), layer_height_profile);
|
||||
if (!layers.empty() && layers.back() > build_volume.max_print_height()) {
|
||||
throw Slic3r::SlicingError("The print is taller than the maximum allowed height. You might want to reduce the size of your model"
|
||||
" or change current print settings and retry.");
|
||||
}
|
||||
}
|
||||
|
||||
m_print->process();
|
||||
wxCommandEvent evt(m_event_slicing_completed_id);
|
||||
// Post the Slicing Finished message for the G-code viewer to update.
|
||||
|
@ -1445,9 +1445,11 @@ bool PageDownloader::on_finish_downloader() const
|
||||
return downloader->on_finish();
|
||||
}
|
||||
|
||||
bool DownloaderUtils::Worker::perform_register()
|
||||
bool DownloaderUtils::Worker::perform_register(const std::string& path_override/* = {}*/)
|
||||
{
|
||||
boost::filesystem::path aux_dest (GUI::into_u8(path_name()));
|
||||
if (!path_override.empty())
|
||||
aux_dest = boost::filesystem::path(path_override);
|
||||
boost::system::error_code ec;
|
||||
boost::filesystem::path chosen_dest = boost::filesystem::absolute(aux_dest, ec);
|
||||
if(ec)
|
||||
|
@ -430,7 +430,6 @@ class Worker : public wxBoxSizer
|
||||
bool perform_registration_linux { false };
|
||||
#endif // __linux__
|
||||
|
||||
bool perform_register();
|
||||
void deregister();
|
||||
|
||||
public:
|
||||
@ -445,7 +444,7 @@ public:
|
||||
void set_path_name(const std::string& name);
|
||||
|
||||
bool on_finish();
|
||||
|
||||
bool perform_register(const std::string& path_override = {});
|
||||
#ifdef __linux__
|
||||
bool get_perform_registration_linux() { return perform_registration_linux; }
|
||||
#endif // __linux__
|
||||
|
@ -79,6 +79,7 @@
|
||||
#include "DesktopIntegrationDialog.hpp"
|
||||
#include "SendSystemInfoDialog.hpp"
|
||||
#include "Downloader.hpp"
|
||||
#include "ConfigWizard_private.hpp"
|
||||
|
||||
#include "BitmapCache.hpp"
|
||||
#include "Notebook.hpp"
|
||||
@ -1010,7 +1011,6 @@ std::string GUI_App::check_older_app_config(Semver current_version, bool backup)
|
||||
return {};
|
||||
BOOST_LOG_TRIVIAL(info) << "last app config file used: " << older_data_dir_path;
|
||||
// ask about using older data folder
|
||||
|
||||
InfoDialog msg(nullptr
|
||||
, format_wxstr(_L("You are opening %1% version %2%."), SLIC3R_APP_NAME, SLIC3R_VERSION)
|
||||
, backup ?
|
||||
@ -1155,12 +1155,16 @@ bool GUI_App::on_init_inner()
|
||||
|
||||
std::string older_data_dir_path;
|
||||
if (m_app_conf_exists) {
|
||||
if (app_config->orig_version().valid() && app_config->orig_version() < *Semver::parse(SLIC3R_VERSION))
|
||||
if (app_config->orig_version().valid() && app_config->orig_version() < *Semver::parse(SLIC3R_VERSION)) {
|
||||
// Only copying configuration if it was saved with a newer slicer than the one currently running.
|
||||
older_data_dir_path = check_older_app_config(app_config->orig_version(), true);
|
||||
m_last_app_conf_lower_version = true;
|
||||
}
|
||||
} else {
|
||||
// No AppConfig exists, fresh install. Always try to copy from an alternate location, don't make backup of the current configuration.
|
||||
older_data_dir_path = check_older_app_config(Semver(), false);
|
||||
if (!older_data_dir_path.empty())
|
||||
m_last_app_conf_lower_version = true;
|
||||
}
|
||||
|
||||
#ifdef _MSW_DARK_MODE
|
||||
@ -3078,6 +3082,29 @@ void GUI_App::show_desktop_integration_dialog()
|
||||
#endif //__linux__
|
||||
}
|
||||
|
||||
void GUI_App::show_downloader_registration_dialog()
|
||||
{
|
||||
InfoDialog msg(nullptr
|
||||
, format_wxstr(_L("Welcome to %1% version %2%."), SLIC3R_APP_NAME, SLIC3R_VERSION)
|
||||
, format_wxstr(_L(
|
||||
"Do you wish to register downloads from <b>Printables.com</b>"
|
||||
"\nfor this <b>%1% %2%</b> executable?"
|
||||
"\n\nDownloads can be registered for only 1 executable at time."
|
||||
), SLIC3R_APP_NAME, SLIC3R_VERSION)
|
||||
, true, wxYES_NO);
|
||||
if (msg.ShowModal() == wxID_YES) {
|
||||
auto downloader = new DownloaderUtils::Worker(nullptr);
|
||||
downloader->perform_register(app_config->get("url_downloader_dest"));
|
||||
#ifdef __linux__
|
||||
if (downloader->get_perform_registration_linux())
|
||||
DesktopIntegrationDialog::perform_desktop_integration(true);
|
||||
#endif // __linux__
|
||||
} else {
|
||||
app_config->set("downloader_url_registered", "0");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if ENABLE_THUMBNAIL_GENERATOR_DEBUG
|
||||
void GUI_App::gcode_thumbnails_debug()
|
||||
{
|
||||
@ -3225,7 +3252,13 @@ bool GUI_App::config_wizard_startup()
|
||||
|
||||
run_wizard(ConfigWizard::RR_DATA_LEGACY);
|
||||
return true;
|
||||
}
|
||||
#ifndef __APPLE__
|
||||
else if (is_editor() && m_last_app_conf_lower_version && app_config->get("downloader_url_registered") == "1") {
|
||||
show_downloader_registration_dialog();
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -122,6 +122,7 @@ private:
|
||||
bool m_initialized { false };
|
||||
bool m_post_initialized { false };
|
||||
bool m_app_conf_exists{ false };
|
||||
bool m_last_app_conf_lower_version{ false };
|
||||
EAppMode m_app_mode{ EAppMode::Editor };
|
||||
bool m_is_recreating_gui{ false };
|
||||
#ifdef __linux__
|
||||
@ -343,6 +344,7 @@ public:
|
||||
bool may_switch_to_SLA_preset(const wxString& caption);
|
||||
bool run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage start_page = ConfigWizard::SP_WELCOME);
|
||||
void show_desktop_integration_dialog();
|
||||
void show_downloader_registration_dialog();
|
||||
|
||||
#if ENABLE_THUMBNAIL_GENERATOR_DEBUG
|
||||
// temporary and debug only -> extract thumbnails from selected gcode and save them as png files
|
||||
|
@ -206,7 +206,16 @@ GLGizmoCut3D::GLGizmoCut3D(GLCanvas3D& parent, const std::string& icon_filename,
|
||||
};
|
||||
|
||||
m_connector_modes = { _u8L("Auto"), _u8L("Manual") };
|
||||
m_connector_types = { _u8L("Plug"), _u8L("Dowel") };
|
||||
|
||||
std::map<const wchar_t, std::string> connetor_types = {
|
||||
{ImGui::PlugMarker , _u8L("Plug") },
|
||||
{ImGui::DowelMarker, _u8L("Dowel") },
|
||||
};
|
||||
for (auto connector : connetor_types) {
|
||||
std::string type_label = " " + connector.second + " ";
|
||||
type_label += connector.first;
|
||||
m_connector_types.push_back(type_label);
|
||||
}
|
||||
|
||||
m_connector_styles = { _u8L("Prizm"), _u8L("Frustum")
|
||||
// , _u8L("Claw")
|
||||
@ -506,7 +515,7 @@ bool GLGizmoCut3D::render_slider_double_input(const std::string& label, float& v
|
||||
|
||||
const BoundingBoxf3 bbox = bounding_box();
|
||||
float mean_size = float((bbox.size().x() + bbox.size().y() + bbox.size().z()) / 9.0);
|
||||
float min_size = value_in < 0.f ? UndefMinVal : 2.f;
|
||||
float min_size = value_in < 0.f ? UndefMinVal : 1.f;
|
||||
if (m_imperial_units) {
|
||||
mean_size *= float(ObjectManipulation::mm_to_in);
|
||||
min_size *= float(ObjectManipulation::mm_to_in);
|
||||
|
@ -65,6 +65,8 @@ static const std::map<const wchar_t, std::string> font_icons = {
|
||||
{ImGui::RevertButton , "undo" },
|
||||
{ImGui::WarningMarkerSmall , "notification_warning" },
|
||||
{ImGui::InfoMarkerSmall , "notification_info" },
|
||||
{ImGui::PlugMarker , "plug" },
|
||||
{ImGui::DowelMarker , "dowel" },
|
||||
};
|
||||
|
||||
static const std::map<const wchar_t, std::string> font_icons_large = {
|
||||
|
@ -315,12 +315,12 @@ void MeshClipper::recalculate_triangles()
|
||||
|
||||
// To prevent overflow after scaling, downscale the input if needed:
|
||||
double extra_scale = 1.;
|
||||
int32_t limit = int32_t(std::min(std::numeric_limits<coord_t>::max() / (2. * scale_x), std::numeric_limits<coord_t>::max() / (2. * scale_y)));
|
||||
int32_t limit = int32_t(std::min(std::numeric_limits<coord_t>::max() / (2. * std::max(1., scale_x)), std::numeric_limits<coord_t>::max() / (2. * std::max(1., scale_y))));
|
||||
int32_t max_coord = 0;
|
||||
for (const Point& pt : exp.contour)
|
||||
max_coord = std::max(max_coord, std::max(std::abs(pt.x()), std::abs(pt.y())));
|
||||
if (max_coord + m_contour_width >= limit)
|
||||
extra_scale = 0.9 * double(limit) / max_coord;
|
||||
extra_scale = 0.9 * double(limit) / max_coord;
|
||||
|
||||
ExPolygon exp_copy = exp;
|
||||
if (extra_scale != 1.)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
set(SLIC3R_APP_NAME "PrusaSlicer")
|
||||
set(SLIC3R_APP_KEY "PrusaSlicer")
|
||||
set(SLIC3R_VERSION "2.6.0-alpha1")
|
||||
set(SLIC3R_VERSION "2.6.0-alpha3")
|
||||
set(SLIC3R_BUILD_ID "PrusaSlicer-${SLIC3R_VERSION}+UNKNOWN")
|
||||
set(SLIC3R_RC_VERSION "2,6,0,0")
|
||||
set(SLIC3R_RC_VERSION_DOTS "2.6.0.0")
|
||||
|