mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 06:55:56 +08:00
Merge branch 'master' into fs_dir_per_glyph_SPE-1597
This commit is contained in:
commit
a56ac11d77
3
deps/OpenEXR/OpenEXR.cmake
vendored
3
deps/OpenEXR/OpenEXR.cmake
vendored
@ -4,6 +4,7 @@ prusaslicer_add_cmake_project(OpenEXR
|
|||||||
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
|
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
|
||||||
DEPENDS ${ZLIB_PKG}
|
DEPENDS ${ZLIB_PKG}
|
||||||
GIT_TAG v2.5.5
|
GIT_TAG v2.5.5
|
||||||
|
PATCH_COMMAND COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/OpenEXR.patch
|
||||||
CMAKE_ARGS
|
CMAKE_ARGS
|
||||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||||
-DBUILD_TESTING=OFF
|
-DBUILD_TESTING=OFF
|
||||||
@ -14,4 +15,4 @@ prusaslicer_add_cmake_project(OpenEXR
|
|||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
add_debug_dep(dep_OpenEXR)
|
add_debug_dep(dep_OpenEXR)
|
||||||
endif ()
|
endif ()
|
||||||
|
30
deps/OpenEXR/OpenEXR.patch
vendored
Normal file
30
deps/OpenEXR/OpenEXR.patch
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
--- ../OpenEXR-orig/OpenEXR/IlmImf/ImfDwaCompressor.cpp 2021-02-12 17:56:19.000000000 +0100
|
||||||
|
+++ ./OpenEXR/IlmImf/ImfDwaCompressor.cpp 2023-06-01 13:21:32.666695400 +0200
|
||||||
|
@@ -159,6 +159,7 @@
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
+#include <cstdint>
|
||||||
|
|
||||||
|
|
||||||
|
// Windows specific addition to prevent the indirect import of the redefined min/max macros
|
||||||
|
--- ../OpenEXR-orig/OpenEXR/IlmImf/ImfHuf.cpp 2021-02-12 17:56:19.000000000 +0100
|
||||||
|
+++ ./OpenEXR/IlmImf/ImfHuf.cpp 2023-06-01 13:21:53.018583400 +0200
|
||||||
|
@@ -53,6 +53,7 @@
|
||||||
|
#include <cstring>
|
||||||
|
#include <cassert>
|
||||||
|
#include <algorithm>
|
||||||
|
+#include <cstdint>
|
||||||
|
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
--- ../OpenEXR-orig/OpenEXR/IlmImf/ImfMisc.cpp 2021-02-12 17:56:19.000000000 +0100
|
||||||
|
+++ ./OpenEXR/IlmImf/ImfMisc.cpp 2023-06-01 13:22:15.777480000 +0200
|
||||||
|
@@ -40,6 +40,7 @@
|
||||||
|
//
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
+#include <cstdint>
|
||||||
|
#include <ImfMisc.h>
|
||||||
|
#include <ImfHeader.h>
|
||||||
|
#include <ImfAttribute.h>
|
Binary file not shown.
@ -1,4 +1,5 @@
|
|||||||
min_slic3r_version = 2.6.0-alpha4
|
min_slic3r_version = 2.6.0-beta1
|
||||||
|
0.2.5 Fixed output file format for MONO SE.
|
||||||
0.2.4 Enable pad for Anycubic SLA profiles
|
0.2.4 Enable pad for Anycubic SLA profiles
|
||||||
0.2.3 Added Photon Mono printer.
|
0.2.3 Added Photon Mono printer.
|
||||||
0.2.2 Added Photon Mono SE printer.
|
0.2.2 Added Photon Mono SE printer.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
name = Anycubic
|
name = Anycubic
|
||||||
# Configuration version of this file. Config file will only be installed, if the config_version differs.
|
# Configuration version of this file. Config file will only be installed, if the config_version differs.
|
||||||
# This means, the server may force the PrusaSlicer configuration to be downgraded.
|
# This means, the server may force the PrusaSlicer configuration to be downgraded.
|
||||||
config_version = 0.2.1
|
config_version = 0.2.5
|
||||||
# Where to get the updates from?
|
# Where to get the updates from?
|
||||||
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/Anycubic/
|
config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/Anycubic/
|
||||||
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
|
# changelog_url = https://files.prusa3d.com/?latest=slicer-profiles&lng=%1%
|
||||||
@ -2386,7 +2386,7 @@ output_filename_format = [input_filename_base].pwmx
|
|||||||
[sla_print:0.05 Normal @ANYCUBIC MONO SE]
|
[sla_print:0.05 Normal @ANYCUBIC MONO SE]
|
||||||
inherits = 0.05 Normal @ANYCUBIC ABSTRACT
|
inherits = 0.05 Normal @ANYCUBIC ABSTRACT
|
||||||
compatible_printers_condition = printer_notes=~/.*PHOTONMONOSE\n.*/
|
compatible_printers_condition = printer_notes=~/.*PHOTONMONOSE\n.*/
|
||||||
output_filename_format = [input_filename_base].pwma
|
output_filename_format = [input_filename_base].pwms
|
||||||
|
|
||||||
|
|
||||||
## SLA materials
|
## SLA materials
|
||||||
@ -2497,4 +2497,5 @@ max_initial_exposure_time = 300
|
|||||||
printer_correction = 1,1,1
|
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\nPRINTER_TECHNOLOGY_SLA\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\nPRINTER_TECHNOLOGY_SLA\n
|
||||||
|
|
||||||
|
@ -480,10 +480,8 @@ std::vector<Polygons> expand_expolygons(const ExPolygons &src, const ExPolygons
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ExPolygon> expand_merge_expolygons(ExPolygons &&src, const ExPolygons &boundary, const RegionExpansionParameters ¶ms)
|
std::vector<ExPolygon> merge_expansions_into_expolygons(ExPolygons &&src, std::vector<RegionExpansion> &&expanded)
|
||||||
{
|
{
|
||||||
// expanded regions are sorted by boundary id and source id
|
|
||||||
std::vector<RegionExpansion> expanded = propagate_waves(src, boundary, params);
|
|
||||||
// expanded regions will be merged into source regions, thus they will be re-sorted by source id.
|
// expanded regions will be merged into source regions, thus they will be re-sorted by source id.
|
||||||
std::sort(expanded.begin(), expanded.end(), [](const auto &l, const auto &r) { return l.src_id < r.src_id; });
|
std::sort(expanded.begin(), expanded.end(), [](const auto &l, const auto &r) { return l.src_id < r.src_id; });
|
||||||
uint32_t last = 0;
|
uint32_t last = 0;
|
||||||
@ -535,5 +533,12 @@ std::vector<ExPolygon> expand_merge_expolygons(ExPolygons &&src, const ExPolygon
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<ExPolygon> expand_merge_expolygons(ExPolygons &&src, const ExPolygons &boundary, const RegionExpansionParameters ¶ms)
|
||||||
|
{
|
||||||
|
// expanded regions are sorted by boundary id and source id
|
||||||
|
std::vector<RegionExpansion> expanded = propagate_waves(src, boundary, params);
|
||||||
|
return merge_expansions_into_expolygons(std::move(src), std::move(expanded));
|
||||||
|
}
|
||||||
|
|
||||||
} // Algorithm
|
} // Algorithm
|
||||||
} // Slic3r
|
} // Slic3r
|
||||||
|
@ -72,6 +72,7 @@ struct RegionExpansion
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::vector<RegionExpansion> propagate_waves(const WaveSeeds &seeds, const ExPolygons &boundary, const RegionExpansionParameters ¶ms);
|
std::vector<RegionExpansion> propagate_waves(const WaveSeeds &seeds, const ExPolygons &boundary, const RegionExpansionParameters ¶ms);
|
||||||
|
std::vector<RegionExpansion> propagate_waves(const ExPolygons &src, const ExPolygons &boundary, const RegionExpansionParameters ¶ms);
|
||||||
|
|
||||||
std::vector<RegionExpansion> propagate_waves(const ExPolygons &src, const ExPolygons &boundary,
|
std::vector<RegionExpansion> propagate_waves(const ExPolygons &src, const ExPolygons &boundary,
|
||||||
// Scaled expansion value
|
// Scaled expansion value
|
||||||
@ -106,6 +107,9 @@ std::vector<Polygons> expand_expolygons(const ExPolygons &src, const ExPolygons
|
|||||||
// Don't take more than max_nr_steps for small expansion_step.
|
// Don't take more than max_nr_steps for small expansion_step.
|
||||||
size_t max_nr_steps);
|
size_t max_nr_steps);
|
||||||
|
|
||||||
|
// Merge src with expansions, return the merged expolygons.
|
||||||
|
std::vector<ExPolygon> merge_expansions_into_expolygons(ExPolygons &&src, std::vector<RegionExpansion> &&expanded);
|
||||||
|
|
||||||
std::vector<ExPolygon> expand_merge_expolygons(ExPolygons &&src, const ExPolygons &boundary, const RegionExpansionParameters ¶ms);
|
std::vector<ExPolygon> expand_merge_expolygons(ExPolygons &&src, const ExPolygons &boundary, const RegionExpansionParameters ¶ms);
|
||||||
|
|
||||||
} // Algorithm
|
} // Algorithm
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
|
@ -170,7 +170,9 @@ static ExPolygons fill_surfaces_extract_expolygons(Surfaces &surfaces, std::init
|
|||||||
Surfaces expand_bridges_detect_orientations(
|
Surfaces expand_bridges_detect_orientations(
|
||||||
Surfaces &surfaces,
|
Surfaces &surfaces,
|
||||||
ExPolygons &shells,
|
ExPolygons &shells,
|
||||||
const Algorithm::RegionExpansionParameters &expansion_params,
|
const Algorithm::RegionExpansionParameters &expansion_params_into_solid_infill,
|
||||||
|
ExPolygons &sparse,
|
||||||
|
const Algorithm::RegionExpansionParameters &expansion_params_into_sparse_infill,
|
||||||
const float closing_radius)
|
const float closing_radius)
|
||||||
{
|
{
|
||||||
using namespace Slic3r::Algorithm;
|
using namespace Slic3r::Algorithm;
|
||||||
@ -181,8 +183,23 @@ Surfaces expand_bridges_detect_orientations(
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
// Calculate bridge anchors and their expansions in their respective shell region.
|
// Calculate bridge anchors and their expansions in their respective shell region.
|
||||||
WaveSeeds bridge_anchors = wave_seeds(bridges_ex, shells, expansion_params.tiny_expansion, true);
|
WaveSeeds bridge_anchors = wave_seeds(bridges_ex, shells, expansion_params_into_solid_infill.tiny_expansion, true);
|
||||||
std::vector<RegionExpansionEx> bridge_expansions = propagate_waves_ex(bridge_anchors, shells, expansion_params);
|
std::vector<RegionExpansionEx> bridge_expansions = propagate_waves_ex(bridge_anchors, shells, expansion_params_into_solid_infill);
|
||||||
|
bool expanded_into_shells = ! bridge_expansions.empty();
|
||||||
|
bool expanded_into_sparse = false;
|
||||||
|
{
|
||||||
|
WaveSeeds bridge_anchors_sparse = wave_seeds(bridges_ex, sparse, expansion_params_into_sparse_infill.tiny_expansion, true);
|
||||||
|
std::vector<RegionExpansionEx> bridge_expansions_sparse = propagate_waves_ex(bridge_anchors_sparse, sparse, expansion_params_into_sparse_infill);
|
||||||
|
if (! bridge_expansions_sparse.empty()) {
|
||||||
|
expanded_into_sparse = true;
|
||||||
|
for (WaveSeed &seed : bridge_anchors_sparse)
|
||||||
|
seed.boundary += uint32_t(shells.size());
|
||||||
|
for (RegionExpansionEx &expansion : bridge_expansions_sparse)
|
||||||
|
expansion.boundary_id += uint32_t(shells.size());
|
||||||
|
append(bridge_anchors, std::move(bridge_anchors_sparse));
|
||||||
|
append(bridge_expansions, std::move(bridge_expansions_sparse));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Cache for detecting bridge orientation and merging regions with overlapping expansions.
|
// Cache for detecting bridge orientation and merging regions with overlapping expansions.
|
||||||
struct Bridge {
|
struct Bridge {
|
||||||
@ -259,7 +276,7 @@ Surfaces expand_bridges_detect_orientations(
|
|||||||
for (; it_bridge_anchor != bridge_anchors.end() && it_bridge_anchor->src == bridge_id; ++ it_bridge_anchor) {
|
for (; it_bridge_anchor != bridge_anchors.end() && it_bridge_anchor->src == bridge_id; ++ it_bridge_anchor) {
|
||||||
if (last_anchor_id != int(it_bridge_anchor->boundary)) {
|
if (last_anchor_id != int(it_bridge_anchor->boundary)) {
|
||||||
last_anchor_id = int(it_bridge_anchor->boundary);
|
last_anchor_id = int(it_bridge_anchor->boundary);
|
||||||
append(anchor_areas, to_polygons(shells[last_anchor_id]));
|
append(anchor_areas, to_polygons(last_anchor_id < int32_t(shells.size()) ? shells[last_anchor_id] : sparse[last_anchor_id]));
|
||||||
}
|
}
|
||||||
// if (Points &polyline = it_bridge_anchor->path; polyline.size() >= 2) {
|
// if (Points &polyline = it_bridge_anchor->path; polyline.size() >= 2) {
|
||||||
// reserve_more_power_of_2(lines, polyline.size() - 1);
|
// reserve_more_power_of_2(lines, polyline.size() - 1);
|
||||||
@ -270,17 +287,18 @@ Surfaces expand_bridges_detect_orientations(
|
|||||||
lines = to_lines(diff_pl(to_polylines(bridge.expolygon), expand(anchor_areas, float(SCALED_EPSILON))));
|
lines = to_lines(diff_pl(to_polylines(bridge.expolygon), expand(anchor_areas, float(SCALED_EPSILON))));
|
||||||
auto [bridging_dir, unsupported_dist] = detect_bridging_direction(lines, to_polygons(bridge.expolygon));
|
auto [bridging_dir, unsupported_dist] = detect_bridging_direction(lines, to_polygons(bridge.expolygon));
|
||||||
bridge.angle = M_PI + std::atan2(bridging_dir.y(), bridging_dir.x());
|
bridge.angle = M_PI + std::atan2(bridging_dir.y(), bridging_dir.x());
|
||||||
// #if 1
|
#if 0
|
||||||
// coordf_t stroke_width = scale_(0.06);
|
coordf_t stroke_width = scale_(0.06);
|
||||||
// BoundingBox bbox = get_extents(initial);
|
BoundingBox bbox = get_extents(anchor_areas);
|
||||||
// bbox.offset(scale_(1.));
|
bbox.merge(get_extents(bridge.expolygon));
|
||||||
// ::Slic3r::SVG
|
bbox.offset(scale_(1.));
|
||||||
// svg(debug_out_path(("bridge"+std::to_string(bridges[idx_last].bridge_angle)+"_"+std::to_string(this->layer()->bottom_z())).c_str()),
|
::Slic3r::SVG
|
||||||
// bbox);
|
svg(debug_out_path(("bridge" + std::to_string(bridge.angle) + "_" /* + std::to_string(this->layer()->bottom_z())*/).c_str()),
|
||||||
|
bbox);
|
||||||
// svg.draw(initial, "cyan");
|
svg.draw(bridge.expolygon, "cyan");
|
||||||
// svg.draw(to_lines(lower_layer->lslices), "green", stroke_width);
|
svg.draw(lines, "green", stroke_width);
|
||||||
// #endif
|
svg.draw(anchor_areas, "red");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,8 +340,11 @@ Surfaces expand_bridges_detect_orientations(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clip the shells by the expanded bridges.
|
// Clip by the expanded bridges.
|
||||||
shells = diff_ex(shells, out);
|
if (expanded_into_shells)
|
||||||
|
shells = diff_ex(shells, out);
|
||||||
|
if (expanded_into_sparse)
|
||||||
|
sparse = diff_ex(sparse, out);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,23 +353,43 @@ Surfaces expand_bridges_detect_orientations(
|
|||||||
static Surfaces expand_merge_surfaces(
|
static Surfaces expand_merge_surfaces(
|
||||||
Surfaces &surfaces,
|
Surfaces &surfaces,
|
||||||
SurfaceType surface_type,
|
SurfaceType surface_type,
|
||||||
ExPolygons &shells,
|
ExPolygons &shells,
|
||||||
const Algorithm::RegionExpansionParameters ¶ms,
|
const Algorithm::RegionExpansionParameters &expansion_params_into_solid_infill,
|
||||||
|
ExPolygons &sparse,
|
||||||
|
const Algorithm::RegionExpansionParameters &expansion_params_into_sparse_infill,
|
||||||
const float closing_radius,
|
const float closing_radius,
|
||||||
const double bridge_angle = -1.)
|
const double bridge_angle = -1.)
|
||||||
{
|
{
|
||||||
|
using namespace Slic3r::Algorithm;
|
||||||
|
|
||||||
double thickness;
|
double thickness;
|
||||||
ExPolygons src = fill_surfaces_extract_expolygons(surfaces, {surface_type}, thickness);
|
ExPolygons src = fill_surfaces_extract_expolygons(surfaces, {surface_type}, thickness);
|
||||||
if (src.empty())
|
if (src.empty())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
std::vector<ExPolygon> expanded = expand_merge_expolygons(std::move(src), shells, params);
|
std::vector<RegionExpansion> expansions = propagate_waves(src, shells, expansion_params_into_solid_infill);
|
||||||
|
bool expanded_into_shells = !expansions.empty();
|
||||||
|
bool expanded_into_sparse = false;
|
||||||
|
{
|
||||||
|
std::vector<RegionExpansion> expansions2 = propagate_waves(src, sparse, expansion_params_into_sparse_infill);
|
||||||
|
if (! expansions2.empty()) {
|
||||||
|
expanded_into_sparse = true;
|
||||||
|
for (RegionExpansion &expansion : expansions2)
|
||||||
|
expansion.boundary_id += uint32_t(shells.size());
|
||||||
|
append(expansions, std::move(expansions2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<ExPolygon> expanded = merge_expansions_into_expolygons(std::move(src), std::move(expansions));
|
||||||
//NOTE: The current regularization of the shells can create small unasigned regions in the object (E.G. benchy)
|
//NOTE: The current regularization of the shells can create small unasigned regions in the object (E.G. benchy)
|
||||||
// without the following closing operation, those regions will stay unfilled and cause small holes in the expanded surface.
|
// without the following closing operation, those regions will stay unfilled and cause small holes in the expanded surface.
|
||||||
// look for narrow_ensure_vertical_wall_thickness_region_radius filter.
|
// look for narrow_ensure_vertical_wall_thickness_region_radius filter.
|
||||||
expanded = closing_ex(expanded, closing_radius);
|
expanded = closing_ex(expanded, closing_radius);
|
||||||
// Trim the shells by the expanded expolygons.
|
// Trim the shells by the expanded expolygons.
|
||||||
shells = diff_ex(shells, expanded);
|
if (expanded_into_shells)
|
||||||
|
shells = diff_ex(shells, expanded);
|
||||||
|
if (expanded_into_sparse)
|
||||||
|
sparse = diff_ex(sparse, expanded);
|
||||||
|
|
||||||
Surface templ{ surface_type, {} };
|
Surface templ{ surface_type, {} };
|
||||||
templ.bridge_angle = bridge_angle;
|
templ.bridge_angle = bridge_angle;
|
||||||
@ -361,20 +402,25 @@ static Surfaces expand_merge_surfaces(
|
|||||||
|
|
||||||
void LayerRegion::process_external_surfaces(const Layer *lower_layer, const Polygons *lower_layer_covered)
|
void LayerRegion::process_external_surfaces(const Layer *lower_layer, const Polygons *lower_layer_covered)
|
||||||
{
|
{
|
||||||
|
using namespace Slic3r::Algorithm;
|
||||||
|
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
export_region_fill_surfaces_to_svg_debug("4_process_external_surfaces-initial");
|
export_region_fill_surfaces_to_svg_debug("4_process_external_surfaces-initial");
|
||||||
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
|
|
||||||
// Width of the perimeters.
|
// Width of the perimeters.
|
||||||
float shell_width = 0;
|
float shell_width = 0;
|
||||||
|
float expansion_min = 0;
|
||||||
if (int num_perimeters = this->region().config().perimeters; num_perimeters > 0) {
|
if (int num_perimeters = this->region().config().perimeters; num_perimeters > 0) {
|
||||||
Flow external_perimeter_flow = this->flow(frExternalPerimeter);
|
Flow external_perimeter_flow = this->flow(frExternalPerimeter);
|
||||||
Flow perimeter_flow = this->flow(frPerimeter);
|
Flow perimeter_flow = this->flow(frPerimeter);
|
||||||
shell_width += 0.5f * external_perimeter_flow.scaled_width() + external_perimeter_flow.scaled_spacing();
|
shell_width = 0.5f * external_perimeter_flow.scaled_width() + external_perimeter_flow.scaled_spacing();
|
||||||
shell_width += perimeter_flow.scaled_spacing() * (num_perimeters - 1);
|
shell_width += perimeter_flow.scaled_spacing() * (num_perimeters - 1);
|
||||||
|
expansion_min = perimeter_flow.scaled_spacing();
|
||||||
} else {
|
} else {
|
||||||
// TODO: Maybe there is better solution when printing with zero perimeters, but this works reasonably well, given the situation
|
// TODO: Maybe there is better solution when printing with zero perimeters, but this works reasonably well, given the situation
|
||||||
shell_width = float(SCALED_EPSILON);
|
shell_width = float(SCALED_EPSILON);
|
||||||
|
expansion_min = float(SCALED_EPSILON);;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scaled expansions of the respective external surfaces.
|
// Scaled expansions of the respective external surfaces.
|
||||||
@ -390,16 +436,18 @@ void LayerRegion::process_external_surfaces(const Layer *lower_layer, const Poly
|
|||||||
|
|
||||||
// Expand the top / bottom / bridge surfaces into the shell thickness solid infills.
|
// Expand the top / bottom / bridge surfaces into the shell thickness solid infills.
|
||||||
double layer_thickness;
|
double layer_thickness;
|
||||||
ExPolygons shells = union_ex(fill_surfaces_extract_expolygons(m_fill_surfaces.surfaces, {stInternalSolid}, layer_thickness));
|
ExPolygons shells = union_ex(fill_surfaces_extract_expolygons(m_fill_surfaces.surfaces, { stInternalSolid }, layer_thickness));
|
||||||
|
ExPolygons sparse = union_ex(fill_surfaces_extract_expolygons(m_fill_surfaces.surfaces, { stInternal }, layer_thickness));
|
||||||
|
|
||||||
SurfaceCollection bridges;
|
SurfaceCollection bridges;
|
||||||
|
const auto expansion_params_into_sparse_infill = RegionExpansionParameters::build(expansion_min, expansion_step, max_nr_expansion_steps);
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(trace) << "Processing external surface, detecting bridges. layer" << this->layer()->print_z;
|
BOOST_LOG_TRIVIAL(trace) << "Processing external surface, detecting bridges. layer" << this->layer()->print_z;
|
||||||
const double custom_angle = this->region().config().bridge_angle.value;
|
const double custom_angle = this->region().config().bridge_angle.value;
|
||||||
const auto params = Algorithm::RegionExpansionParameters::build(expansion_bottom_bridge, expansion_step, max_nr_expansion_steps);
|
const auto expansion_params_into_solid_infill = RegionExpansionParameters::build(expansion_bottom_bridge, expansion_step, max_nr_expansion_steps);
|
||||||
bridges.surfaces = custom_angle > 0 ?
|
bridges.surfaces = custom_angle > 0 ?
|
||||||
expand_merge_surfaces(m_fill_surfaces.surfaces, stBottomBridge, shells, params, closing_radius, Geometry::deg2rad(custom_angle)) :
|
expand_merge_surfaces(m_fill_surfaces.surfaces, stBottomBridge, shells, expansion_params_into_solid_infill, sparse, expansion_params_into_sparse_infill, closing_radius, Geometry::deg2rad(custom_angle)) :
|
||||||
expand_bridges_detect_orientations(m_fill_surfaces.surfaces, shells, params, closing_radius);
|
expand_bridges_detect_orientations(m_fill_surfaces.surfaces, shells, expansion_params_into_solid_infill, sparse, expansion_params_into_sparse_infill, closing_radius);
|
||||||
BOOST_LOG_TRIVIAL(trace) << "Processing external surface, detecting bridges - done";
|
BOOST_LOG_TRIVIAL(trace) << "Processing external surface, detecting bridges - done";
|
||||||
#if 0
|
#if 0
|
||||||
{
|
{
|
||||||
@ -410,15 +458,25 @@ void LayerRegion::process_external_surfaces(const Layer *lower_layer, const Poly
|
|||||||
}
|
}
|
||||||
|
|
||||||
Surfaces bottoms = expand_merge_surfaces(m_fill_surfaces.surfaces, stBottom, shells,
|
Surfaces bottoms = expand_merge_surfaces(m_fill_surfaces.surfaces, stBottom, shells,
|
||||||
Algorithm::RegionExpansionParameters::build(expansion_bottom, expansion_step, max_nr_expansion_steps), closing_radius);
|
RegionExpansionParameters::build(expansion_bottom, expansion_step, max_nr_expansion_steps),
|
||||||
|
sparse, expansion_params_into_sparse_infill, closing_radius);
|
||||||
Surfaces tops = expand_merge_surfaces(m_fill_surfaces.surfaces, stTop, shells,
|
Surfaces tops = expand_merge_surfaces(m_fill_surfaces.surfaces, stTop, shells,
|
||||||
Algorithm::RegionExpansionParameters::build(expansion_top, expansion_step, max_nr_expansion_steps), closing_radius);
|
RegionExpansionParameters::build(expansion_top, expansion_step, max_nr_expansion_steps),
|
||||||
|
sparse, expansion_params_into_sparse_infill, closing_radius);
|
||||||
|
|
||||||
m_fill_surfaces.remove_types({ stBottomBridge, stBottom, stTop, stInternalSolid });
|
// m_fill_surfaces.remove_types({ stBottomBridge, stBottom, stTop, stInternal, stInternalSolid });
|
||||||
reserve_more(m_fill_surfaces.surfaces, shells.size() + bridges.size() + bottoms.size() + tops.size());
|
m_fill_surfaces.clear();
|
||||||
Surface solid_templ(stInternalSolid, {});
|
reserve_more(m_fill_surfaces.surfaces, shells.size() + sparse.size() + bridges.size() + bottoms.size() + tops.size());
|
||||||
solid_templ.thickness = layer_thickness;
|
{
|
||||||
m_fill_surfaces.append(std::move(shells), solid_templ);
|
Surface solid_templ(stInternalSolid, {});
|
||||||
|
solid_templ.thickness = layer_thickness;
|
||||||
|
m_fill_surfaces.append(std::move(shells), solid_templ);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
Surface sparse_templ(stInternal, {});
|
||||||
|
sparse_templ.thickness = layer_thickness;
|
||||||
|
m_fill_surfaces.append(std::move(sparse), sparse_templ);
|
||||||
|
}
|
||||||
m_fill_surfaces.append(std::move(bridges.surfaces));
|
m_fill_surfaces.append(std::move(bridges.surfaces));
|
||||||
m_fill_surfaces.append(std::move(bottoms));
|
m_fill_surfaces.append(std::move(bottoms));
|
||||||
m_fill_surfaces.append(std::move(tops));
|
m_fill_surfaces.append(std::move(tops));
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <istream>
|
#include <istream>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
namespace Slic3r { namespace png {
|
namespace Slic3r { namespace png {
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ static const t_config_enum_values s_keys_map_PrintHostType {
|
|||||||
{ "prusalink", htPrusaLink },
|
{ "prusalink", htPrusaLink },
|
||||||
{ "prusaconnect", htPrusaConnect },
|
{ "prusaconnect", htPrusaConnect },
|
||||||
{ "octoprint", htOctoPrint },
|
{ "octoprint", htOctoPrint },
|
||||||
{ "mainsail", htMainSail },
|
{ "moonraker", htMoonraker },
|
||||||
{ "duet", htDuet },
|
{ "duet", htDuet },
|
||||||
{ "flashair", htFlashAir },
|
{ "flashair", htFlashAir },
|
||||||
{ "astrobox", htAstroBox },
|
{ "astrobox", htAstroBox },
|
||||||
@ -1953,7 +1953,7 @@ void PrintConfigDef::init_fff_params()
|
|||||||
{ "prusalink", "PrusaLink" },
|
{ "prusalink", "PrusaLink" },
|
||||||
{ "prusaconnect", "PrusaConnect" },
|
{ "prusaconnect", "PrusaConnect" },
|
||||||
{ "octoprint", "OctoPrint" },
|
{ "octoprint", "OctoPrint" },
|
||||||
{ "mainsail", "Mainsail/Fluidd" },
|
{ "moonraker", "Klipper (via Moonraker)" },
|
||||||
{ "duet", "Duet" },
|
{ "duet", "Duet" },
|
||||||
{ "flashair", "FlashAir" },
|
{ "flashair", "FlashAir" },
|
||||||
{ "astrobox", "AstroBox" },
|
{ "astrobox", "AstroBox" },
|
||||||
@ -4214,6 +4214,9 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
|
|||||||
else if (value == "marlinfirmware")
|
else if (value == "marlinfirmware")
|
||||||
// the "new" marlin firmware flavor used to be called "marlinfirmware" for some time during PrusaSlicer 2.4.0-alpha development.
|
// the "new" marlin firmware flavor used to be called "marlinfirmware" for some time during PrusaSlicer 2.4.0-alpha development.
|
||||||
value = "marlin2";
|
value = "marlin2";
|
||||||
|
} else if (opt_key == "host_type" && value == "mainsail") {
|
||||||
|
// the "mainsail" key (introduced in 2.6.0-alpha6) was renamed to "moonraker" (in 2.6.0-rc1).
|
||||||
|
value = "moonraker";
|
||||||
} else if (opt_key == "fill_density" && value.find("%") == std::string::npos) {
|
} else if (opt_key == "fill_density" && value.find("%") == std::string::npos) {
|
||||||
try {
|
try {
|
||||||
// fill_density was turned into a percent value
|
// fill_density was turned into a percent value
|
||||||
|
@ -44,7 +44,7 @@ enum class MachineLimitsUsage {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum PrintHostType {
|
enum PrintHostType {
|
||||||
htPrusaLink, htPrusaConnect, htOctoPrint, htMainSail, htDuet, htFlashAir, htAstroBox, htRepetier, htMKS
|
htPrusaLink, htPrusaConnect, htOctoPrint, htMoonraker, htDuet, htFlashAir, htAstroBox, htRepetier, htMKS
|
||||||
};
|
};
|
||||||
|
|
||||||
enum AuthorizationType {
|
enum AuthorizationType {
|
||||||
|
@ -981,11 +981,12 @@ void PrintObject::detect_surfaces_type()
|
|||||||
surface_type_bottom_other);
|
surface_type_bottom_other);
|
||||||
#else
|
#else
|
||||||
// Any surface lying on the void is a true bottom bridge (an overhang)
|
// Any surface lying on the void is a true bottom bridge (an overhang)
|
||||||
ExPolygons true_bridge = diff_ex(layerm->slices().surfaces, lower_layer->lslices, ApplySafetyOffset::Yes);
|
surfaces_append(
|
||||||
// expand the bridges by one extrusion width, to ensure reasonable anchoring whenever possible
|
bottom,
|
||||||
true_bridge = intersection_ex(layerm->slices().surfaces,
|
opening_ex(
|
||||||
offset_ex(true_bridge, layerm->bridging_flow(frSolidInfill).scaled_spacing()));
|
diff_ex(layerm->slices().surfaces, lower_layer->lslices, ApplySafetyOffset::Yes),
|
||||||
surfaces_append(bottom, true_bridge, surface_type_bottom_other);
|
offset),
|
||||||
|
surface_type_bottom_other);
|
||||||
// if user requested internal shells, we need to identify surfaces
|
// if user requested internal shells, we need to identify surfaces
|
||||||
// lying on other slices not belonging to this region
|
// lying on other slices not belonging to this region
|
||||||
if (interface_shells) {
|
if (interface_shells) {
|
||||||
|
@ -253,8 +253,8 @@ set(SLIC3R_GUI_SOURCES
|
|||||||
Utils/Http.hpp
|
Utils/Http.hpp
|
||||||
Utils/FixModelByWin10.cpp
|
Utils/FixModelByWin10.cpp
|
||||||
Utils/FixModelByWin10.hpp
|
Utils/FixModelByWin10.hpp
|
||||||
Utils/Mainsail.cpp
|
Utils/Moonraker.cpp
|
||||||
Utils/Mainsail.hpp
|
Utils/Moonraker.hpp
|
||||||
Utils/OctoPrint.cpp
|
Utils/OctoPrint.cpp
|
||||||
Utils/OctoPrint.hpp
|
Utils/OctoPrint.hpp
|
||||||
Utils/Duet.cpp
|
Utils/Duet.cpp
|
||||||
|
@ -116,7 +116,7 @@ void PresetForPrinter::update_full_printer_name()
|
|||||||
wxString printer_name = m_parent->get_printer_name();
|
wxString printer_name = m_parent->get_printer_name();
|
||||||
wxString preset_name = m_presets_list->GetString(m_presets_list->GetSelection());
|
wxString preset_name = m_presets_list->GetString(m_presets_list->GetSelection());
|
||||||
|
|
||||||
m_full_printer_name->SetLabelText(printer_name + " * " + preset_name);
|
m_full_printer_name->SetLabelText(printer_name + from_u8(PhysicalPrinter::separator()) + preset_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string PresetForPrinter::get_preset_name()
|
std::string PresetForPrinter::get_preset_name()
|
||||||
@ -654,6 +654,24 @@ wxString PhysicalPrinterDialog::get_printer_name()
|
|||||||
|
|
||||||
void PhysicalPrinterDialog::update_full_printer_names()
|
void PhysicalPrinterDialog::update_full_printer_names()
|
||||||
{
|
{
|
||||||
|
// check input symbols for usability
|
||||||
|
|
||||||
|
const char* unusable_symbols = "<>[]:/\\|?*\"";
|
||||||
|
|
||||||
|
wxString printer_name = m_printer_name->GetValue();
|
||||||
|
for (size_t i = 0; i < std::strlen(unusable_symbols); i++) {
|
||||||
|
size_t pos = printer_name.find_first_of(unusable_symbols[i]);
|
||||||
|
if (pos != std::string::npos) {
|
||||||
|
wxString str = printer_name.SubString(pos, 1);
|
||||||
|
printer_name.Remove(pos, 1);
|
||||||
|
InfoDialog(this, format_wxstr("%1%: \"%2%\" ", _L("Unexpected character"), str),
|
||||||
|
_L("The following characters are not allowed in the name") + ": " + unusable_symbols).ShowModal();
|
||||||
|
m_printer_name->SetValue(printer_name);
|
||||||
|
m_printer_name->SetInsertionPointEnd();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (PresetForPrinter* preset : m_presets)
|
for (PresetForPrinter* preset : m_presets)
|
||||||
preset->update_full_printer_name();
|
preset->update_full_printer_name();
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "Mainsail.hpp"
|
#include "Moonraker.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -63,28 +63,28 @@ std::string substitute_host(const std::string& orig_addr, std::string sub_addr)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
Mainsail::Mainsail(DynamicPrintConfig *config) :
|
Moonraker::Moonraker(DynamicPrintConfig *config) :
|
||||||
m_host(config->opt_string("print_host")),
|
m_host(config->opt_string("print_host")),
|
||||||
m_apikey(config->opt_string("printhost_apikey")),
|
m_apikey(config->opt_string("printhost_apikey")),
|
||||||
m_cafile(config->opt_string("printhost_cafile")),
|
m_cafile(config->opt_string("printhost_cafile")),
|
||||||
m_ssl_revoke_best_effort(config->opt_bool("printhost_ssl_ignore_revoke"))
|
m_ssl_revoke_best_effort(config->opt_bool("printhost_ssl_ignore_revoke"))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
const char* Mainsail::get_name() const { return "Mainsail"; }
|
const char* Moonraker::get_name() const { return "Moonraker"; }
|
||||||
|
|
||||||
wxString Mainsail::get_test_ok_msg () const
|
wxString Moonraker::get_test_ok_msg () const
|
||||||
{
|
{
|
||||||
return _(L("Connection to Mainsail works correctly."));
|
return _(L("Connection to Moonraker works correctly."));
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString Mainsail::get_test_failed_msg (wxString &msg) const
|
wxString Moonraker::get_test_failed_msg (wxString &msg) const
|
||||||
{
|
{
|
||||||
return GUI::format_wxstr("%s: %s"
|
return GUI::format_wxstr("%s: %s"
|
||||||
, _L("Could not connect to Mainsail")
|
, _L("Could not connect to Moonraker")
|
||||||
, msg);
|
, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mainsail::test(wxString& msg) const
|
bool Moonraker::test(wxString& msg) const
|
||||||
{
|
{
|
||||||
// GET /server/info
|
// GET /server/info
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ bool Mainsail::test(wxString& msg) const
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mainsail::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const
|
bool Moonraker::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn, InfoFn info_fn) const
|
||||||
{
|
{
|
||||||
// POST /server/files/upload
|
// POST /server/files/upload
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ bool Mainsail::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, Error
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mainsail::set_auth(Http &http) const
|
void Moonraker::set_auth(Http &http) const
|
||||||
{
|
{
|
||||||
if (!m_apikey.empty())
|
if (!m_apikey.empty())
|
||||||
http.header("X-Api-Key", m_apikey);
|
http.header("X-Api-Key", m_apikey);
|
||||||
@ -240,7 +240,7 @@ void Mainsail::set_auth(Http &http) const
|
|||||||
http.ca_file(m_cafile);
|
http.ca_file(m_cafile);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Mainsail::make_url(const std::string &path) const
|
std::string Moonraker::make_url(const std::string &path) const
|
||||||
{
|
{
|
||||||
if (m_host.find("http://") == 0 || m_host.find("https://") == 0) {
|
if (m_host.find("http://") == 0 || m_host.find("https://") == 0) {
|
||||||
if (m_host.back() == '/') {
|
if (m_host.back() == '/') {
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef slic3r_Mainsail_hpp_
|
#ifndef slic3r_Moonraker_hpp_
|
||||||
#define slic3r_Mainsail_hpp_
|
#define slic3r_Moonraker_hpp_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
@ -16,11 +16,11 @@ class DynamicPrintConfig;
|
|||||||
class Http;
|
class Http;
|
||||||
|
|
||||||
// https://moonraker.readthedocs.io/en/latest/web_api
|
// https://moonraker.readthedocs.io/en/latest/web_api
|
||||||
class Mainsail : public PrintHost
|
class Moonraker : public PrintHost
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Mainsail(DynamicPrintConfig *config);
|
Moonraker(DynamicPrintConfig *config);
|
||||||
~Mainsail() override = default;
|
~Moonraker() override = default;
|
||||||
|
|
||||||
const char* get_name() const override;
|
const char* get_name() const override;
|
||||||
|
|
@ -19,7 +19,7 @@
|
|||||||
#include "AstroBox.hpp"
|
#include "AstroBox.hpp"
|
||||||
#include "Repetier.hpp"
|
#include "Repetier.hpp"
|
||||||
#include "MKS.hpp"
|
#include "MKS.hpp"
|
||||||
#include "Mainsail.hpp"
|
#include "Moonraker.hpp"
|
||||||
#include "../GUI/PrintHostDialogs.hpp"
|
#include "../GUI/PrintHostDialogs.hpp"
|
||||||
|
|
||||||
namespace fs = boost::filesystem;
|
namespace fs = boost::filesystem;
|
||||||
@ -55,7 +55,7 @@ PrintHost* PrintHost::get_print_host(DynamicPrintConfig *config)
|
|||||||
case htPrusaLink: return new PrusaLink(config);
|
case htPrusaLink: return new PrusaLink(config);
|
||||||
case htPrusaConnect: return new PrusaConnect(config);
|
case htPrusaConnect: return new PrusaConnect(config);
|
||||||
case htMKS: return new MKS(config);
|
case htMKS: return new MKS(config);
|
||||||
case htMainSail: return new Mainsail(config);
|
case htMoonraker: return new Moonraker(config);
|
||||||
default: return nullptr;
|
default: return nullptr;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user