diff --git a/include/PrimeTower.h b/include/PrimeTower.h index bdbc36bc0e..9133d3007a 100644 --- a/include/PrimeTower.h +++ b/include/PrimeTower.h @@ -4,6 +4,7 @@ #ifndef PRIME_TOWER_H #define PRIME_TOWER_H +#include "settings/types/LayerIndex.h" #include "utils/polygon.h" // Polygons #include "utils/polygonUtils.h" @@ -42,12 +43,20 @@ class PrimeTower std::vector pattern_per_extruder; //!< For each extruder the pattern to print on all layers of the prime tower. std::vector> pattern_extra_brim_per_layer; //!< For each layer of each extruder with an extra brim, the pattern to be added + Polygons outer_poly; //!< The outline of the outermost prime tower. + + struct BasePolygon + { + Polygons polygons; + size_t extra_rings; + }; + + std::vector outer_poly_base; //!< The outline of the prime tower for layers having a base + public: bool enabled; //!< Whether the prime tower is enabled. bool would_have_actual_tower; //!< Whether there is an actual tower. bool multiple_extruders_on_first_layer; //!< Whether multiple extruders are allowed on the first layer of the prime tower (e.g. when a raft is there) - Polygons outer_poly; //!< The outline of the outermost prime tower. - Polygons footprint; //!< The outline of the prime tower on layer 0 /* * In which order, from outside to inside, will we be printing the prime @@ -101,10 +110,14 @@ class PrimeTower */ void subtractFromSupport(SliceDataStorage& storage); + const Polygons &getOuterPoly(const LayerIndex &layer_nr) const; + + const Polygons &getGroundPoly() const; + private: - ExtrusionMoves generatePaths_base(const Polygons& outer_poly, coord_t extra_radius, coord_t line_width); + static ExtrusionMoves generatePaths_base(const Polygons &inset, size_t rings, coord_t line_width); - ExtrusionMoves generatePaths_inset(const Polygons& outer_poly, coord_t line_width, coord_t initial_inset); + static ExtrusionMoves generatePaths_inset(const Polygons& outer_poly, coord_t line_width, coord_t initial_inset); /*! * \see WipeTower::generatePaths diff --git a/include/sliceDataStorage.h b/include/sliceDataStorage.h index 9b0661ed36..c3313e801a 100644 --- a/include/sliceDataStorage.h +++ b/include/sliceDataStorage.h @@ -333,8 +333,6 @@ class SliceDataStorage : public NoCopy std::vector skirt_brim[MAX_EXTRUDERS]; //!< Skirt/brim polygons per extruder, ordered from inner to outer polygons. Polygons support_brim; //!< brim lines for support, going from the edge of the support inward. \note Not ordered by inset. Polygons raftOutline; // Storage for the outline of the raft. Will be filled with lines when the GCode is generated. - Polygons primeRaftOutline; // ... the raft underneath the prime-tower will have to be printed first, if there is one. (When the raft has top layers with a different extruder - // for example.) int max_print_height_second_to_last_extruder; //!< Used in multi-extrusion: the layer number beyond which all models are printed with the same extruder std::vector max_print_height_per_extruder; //!< For each extruder the highest layer number at which it is used. diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index f8dabab971..0deaaff908 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -621,69 +621,65 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage) const coord_t max_resolution = base_settings.get("meshfix_maximum_resolution"); const coord_t max_deviation = base_settings.get("meshfix_maximum_deviation"); - std::vector raft_outline_paths; - if (storage.primeRaftOutline.area() > 0) + Polygons raft_outline_path = storage.raftOutline; + if (storage.primeTower.enabled) { - raft_outline_paths.emplace_back(storage.primeRaftOutline); + raft_outline_path = raft_outline_path.unionPolygons(storage.primeTower.getOuterPoly(layer_nr)); } - raft_outline_paths.emplace_back(storage.raftOutline); - for (const Polygons& raft_outline_path : raft_outline_paths) + Infill infill_comp( + EFillMethod::LINES, + zig_zaggify_infill, + connect_polygons, + raft_outline_path, + gcode_layer.configs_storage.raft_base_config.getLineWidth(), + line_spacing, + fill_overlap, + infill_multiplier, + fill_angle, + z, + extra_infill_shift, + max_resolution, + max_deviation, + wall_line_count, + small_area_width, + infill_origin, + skip_stitching, + fill_gaps, + connected_zigzags, + use_endpieces, + skip_some_zags, + zag_skip_count, + pocket_size); + std::vector raft_paths; + infill_comp.generate(raft_paths, raft_polygons, raftLines, base_settings, layer_nr, SectionType::ADHESION); + if (! raft_paths.empty()) { - Infill infill_comp( - EFillMethod::LINES, - zig_zaggify_infill, - connect_polygons, - raft_outline_path, - gcode_layer.configs_storage.raft_base_config.getLineWidth(), - line_spacing, - fill_overlap, - infill_multiplier, - fill_angle, - z, - extra_infill_shift, - max_resolution, - max_deviation, - wall_line_count, - small_area_width, - infill_origin, - skip_stitching, - fill_gaps, - connected_zigzags, - use_endpieces, - skip_some_zags, - zag_skip_count, - pocket_size); - std::vector raft_paths; - infill_comp.generate(raft_paths, raft_polygons, raftLines, base_settings, layer_nr, SectionType::ADHESION); - if (! raft_paths.empty()) - { - const GCodePathConfig& config = gcode_layer.configs_storage.raft_base_config; - const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false); - InsetOrderOptimizer wall_orderer( - *this, - storage, - gcode_layer, - base_settings, - base_extruder_nr, - config, - config, - config, - config, - retract_before_outer_wall, - wipe_dist, - wipe_dist, - base_extruder_nr, - base_extruder_nr, - z_seam_config, - raft_paths); - wall_orderer.addToLayer(); - } - gcode_layer.addLinesByOptimizer(raftLines, gcode_layer.configs_storage.raft_base_config, SpaceFillType::Lines); - - raft_polygons.clear(); - raftLines.clear(); + const GCodePathConfig& config = gcode_layer.configs_storage.raft_base_config; + const ZSeamConfig z_seam_config(EZSeamType::SHORTEST, gcode_layer.getLastPlannedPositionOrStartingPosition(), EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE, false); + InsetOrderOptimizer wall_orderer( + *this, + storage, + gcode_layer, + base_settings, + base_extruder_nr, + config, + config, + config, + config, + retract_before_outer_wall, + wipe_dist, + wipe_dist, + base_extruder_nr, + base_extruder_nr, + z_seam_config, + raft_paths); + wall_orderer.addToLayer(); } + gcode_layer.addLinesByOptimizer(raftLines, gcode_layer.configs_storage.raft_base_config, SpaceFillType::Lines); + + raft_polygons.clear(); + raftLines.clear(); layer_plan_buffer.handle(gcode_layer, gcode); last_planned_position = gcode_layer.getLastPlannedPositionOrStartingPosition(); @@ -728,11 +724,11 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage) Application::getInstance().communication->sendLayerComplete(layer_nr, z, interface_layer_height); - std::vector raft_outline_paths; + Polygons raft_outline_path; const coord_t small_offset = gcode_layer.configs_storage.raft_interface_config.getLineWidth() / 2; // Do this manually because of micron-movement created in corners when insetting a polygon that was offset with round joint type. - raft_outline_paths.emplace_back(storage.raftOutline.offset(-small_offset)); - raft_outline_paths.back() = Simplify(interface_settings).polygon(raft_outline_paths.back()); // Remove those micron-movements. + raft_outline_path = storage.raftOutline.offset(-small_offset); + raft_outline_path = Simplify(interface_settings).polygon(raft_outline_path); // Remove those micron-movements. const coord_t infill_outline_width = gcode_layer.configs_storage.raft_interface_config.getLineWidth(); Polygons raft_lines; AngleDegrees fill_angle = (num_surface_layers + num_interface_layers - raft_interface_layer) % 2 ? 45 : 135; // 90 degrees rotated from the first top layer. @@ -749,40 +745,42 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage) constexpr int zag_skip_count = 0; constexpr coord_t pocket_size = 0; - for (const Polygons& raft_outline_path : raft_outline_paths) + if (storage.primeTower.enabled) { - Infill infill_comp( - EFillMethod::ZIG_ZAG, - zig_zaggify_infill, - connect_polygons, - raft_outline_path, - infill_outline_width, - interface_line_spacing, - fill_overlap, - infill_multiplier, - fill_angle, - z, - extra_infill_shift, - interface_max_resolution, - interface_max_deviation, - wall_line_count, - small_area_width, - infill_origin, - skip_stitching, - fill_gaps, - connected_zigzags, - use_endpieces, - skip_some_zags, - zag_skip_count, - pocket_size); - std::vector raft_paths; // Should remain empty, since we have no walls. - infill_comp.generate(raft_paths, raft_polygons, raft_lines, interface_settings, layer_nr, SectionType::ADHESION); - gcode_layer.addLinesByOptimizer(raft_lines, gcode_layer.configs_storage.raft_interface_config, SpaceFillType::Lines, false, 0, 1.0, last_planned_position); - - raft_polygons.clear(); - raft_lines.clear(); + raft_outline_path = raft_outline_path.difference(storage.primeTower.getOuterPoly(layer_nr)); } + Infill infill_comp( + EFillMethod::ZIG_ZAG, + zig_zaggify_infill, + connect_polygons, + raft_outline_path, + infill_outline_width, + interface_line_spacing, + fill_overlap, + infill_multiplier, + fill_angle, + z, + extra_infill_shift, + interface_max_resolution, + interface_max_deviation, + wall_line_count, + small_area_width, + infill_origin, + skip_stitching, + fill_gaps, + connected_zigzags, + use_endpieces, + skip_some_zags, + zag_skip_count, + pocket_size); + std::vector raft_paths; // Should remain empty, since we have no walls. + infill_comp.generate(raft_paths, raft_polygons, raft_lines, interface_settings, layer_nr, SectionType::ADHESION); + gcode_layer.addLinesByOptimizer(raft_lines, gcode_layer.configs_storage.raft_interface_config, SpaceFillType::Lines, false, 0, 1.0, last_planned_position); + + raft_polygons.clear(); + raft_lines.clear(); + setExtruder_addPrime(storage, gcode_layer, storage.primeTower.extruder_order.front()); layer_plan_buffer.handle(gcode_layer, gcode); @@ -829,11 +827,11 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage) Application::getInstance().communication->sendLayerComplete(layer_nr, z, surface_layer_height); - std::vector raft_outline_paths; + Polygons raft_outline_path; const coord_t small_offset = gcode_layer.configs_storage.raft_interface_config.getLineWidth() / 2; // Do this manually because of micron-movement created in corners when insetting a polygon that was offset with round joint type. - raft_outline_paths.emplace_back(storage.raftOutline.offset(-small_offset)); - raft_outline_paths.back() = Simplify(interface_settings).polygon(raft_outline_paths.back()); // Remove those micron-movements. + raft_outline_path = storage.raftOutline.offset(-small_offset); + raft_outline_path = Simplify(interface_settings).polygon(raft_outline_path); // Remove those micron-movements. const coord_t infill_outline_width = gcode_layer.configs_storage.raft_interface_config.getLineWidth(); Polygons raft_lines; AngleDegrees fill_angle @@ -851,40 +849,42 @@ void FffGcodeWriter::processRaft(const SliceDataStorage& storage) constexpr size_t zag_skip_count = 0; constexpr coord_t pocket_size = 0; - for (const Polygons& raft_outline_path : raft_outline_paths) + if (storage.primeTower.enabled) { - Infill infill_comp( - EFillMethod::ZIG_ZAG, - zig_zaggify_infill, - connect_polygons, - raft_outline_path, - infill_outline_width, - surface_line_spacing, - fill_overlap, - infill_multiplier, - fill_angle, - z, - extra_infill_shift, - surface_max_resolution, - surface_max_deviation, - wall_line_count, - small_area_width, - infill_origin, - skip_stitching, - fill_gaps, - connected_zigzags, - use_endpieces, - skip_some_zags, - zag_skip_count, - pocket_size); - std::vector raft_paths; // Should remain empty, since we have no walls. - infill_comp.generate(raft_paths, raft_polygons, raft_lines, surface_settings, layer_nr, SectionType::ADHESION); - gcode_layer.addLinesByOptimizer(raft_lines, gcode_layer.configs_storage.raft_surface_config, SpaceFillType::Lines, false, 0, 1.0, last_planned_position); - - raft_polygons.clear(); - raft_lines.clear(); + raft_outline_path = raft_outline_path.difference(storage.primeTower.getOuterPoly(layer_nr)); } + Infill infill_comp( + EFillMethod::ZIG_ZAG, + zig_zaggify_infill, + connect_polygons, + raft_outline_path, + infill_outline_width, + surface_line_spacing, + fill_overlap, + infill_multiplier, + fill_angle, + z, + extra_infill_shift, + surface_max_resolution, + surface_max_deviation, + wall_line_count, + small_area_width, + infill_origin, + skip_stitching, + fill_gaps, + connected_zigzags, + use_endpieces, + skip_some_zags, + zag_skip_count, + pocket_size); + std::vector raft_paths; // Should remain empty, since we have no walls. + infill_comp.generate(raft_paths, raft_polygons, raft_lines, surface_settings, layer_nr, SectionType::ADHESION); + gcode_layer.addLinesByOptimizer(raft_lines, gcode_layer.configs_storage.raft_surface_config, SpaceFillType::Lines, false, 0, 1.0, last_planned_position); + + raft_polygons.clear(); + raft_lines.clear(); + setExtruder_addPrime(storage, gcode_layer, storage.primeTower.extruder_order.front()); layer_plan_buffer.handle(gcode_layer, gcode); diff --git a/src/FffPolygonGenerator.cpp b/src/FffPolygonGenerator.cpp index daff0196eb..640a563284 100644 --- a/src/FffPolygonGenerator.cpp +++ b/src/FffPolygonGenerator.cpp @@ -985,7 +985,7 @@ void FffPolygonGenerator::processOozeShield(SliceDataStorage& storage) } for (LayerIndex layer_nr = 0; layer_nr <= storage.max_print_height_second_to_last_extruder; layer_nr++) { - storage.oozeShield[layer_nr] = storage.oozeShield[layer_nr].difference(storage.primeTower.outer_poly.offset(max_line_width / 2)); + storage.oozeShield[layer_nr] = storage.oozeShield[layer_nr].difference(storage.primeTower.getOuterPoly(layer_nr).offset(max_line_width / 2)); } } } @@ -1035,7 +1035,7 @@ void FffPolygonGenerator::processDraftShield(SliceDataStorage& storage) max_line_width = std::max(max_line_width, extruders[extruder_nr].settings.get("skirt_brim_line_width")); } } - storage.draft_protection_shield = storage.draft_protection_shield.difference(storage.primeTower.outer_poly.offset(max_line_width / 2)); + storage.draft_protection_shield = storage.draft_protection_shield.difference(storage.primeTower.getGroundPoly().offset(max_line_width / 2)); } } diff --git a/src/PrimeTower.cpp b/src/PrimeTower.cpp index 49de8b3db1..39c6ae3fe2 100644 --- a/src/PrimeTower.cpp +++ b/src/PrimeTower.cpp @@ -87,7 +87,8 @@ void PrimeTower::generateGroundpoly() return; } - const Settings& mesh_group_settings = Application::getInstance().current_slice->scene.current_mesh_group->settings; + const Scene& scene = Application::getInstance().current_slice->scene; + const Settings& mesh_group_settings = scene.current_mesh_group->settings; const coord_t tower_size = mesh_group_settings.get("prime_tower_size"); const coord_t x = mesh_group_settings.get("prime_tower_position_x"); @@ -97,18 +98,6 @@ void PrimeTower::generateGroundpoly() middle = Point(x - tower_size / 2, y + tower_size / 2); post_wipe_point = Point(x - tower_size / 2, y + tower_size / 2); - - const bool base_enabled = mesh_group_settings.get("prime_tower_brim_enable"); - const coord_t base_extra_radius = mesh_group_settings.get("prime_tower_base_size"); - const coord_t base_height = mesh_group_settings.get("prime_tower_base_height"); - if (base_enabled && base_extra_radius > 0 && base_height > 0) - { - footprint = outer_poly.offset(base_extra_radius); - } - else - { - footprint = outer_poly; - } } void PrimeTower::generatePaths(const SliceDataStorage& storage) @@ -122,21 +111,15 @@ void PrimeTower::generatePaths(const SliceDataStorage& storage) } } -PrimeTower::ExtrusionMoves PrimeTower::generatePaths_base(const Polygons& outer_poly, coord_t extra_radius, coord_t line_width) +PrimeTower::ExtrusionMoves PrimeTower::generatePaths_base(const Polygons& inset, size_t rings, coord_t line_width) { - const Scene& scene = Application::getInstance().current_slice->scene; - const Settings& mesh_group_settings = scene.current_mesh_group->settings; - const coord_t tower_size = mesh_group_settings.get("prime_tower_size"); - ExtrusionMoves pattern; - int circles = 0; - Polygons outset = outer_poly.offset(line_width / 2); - while (outset.max() - outset.min() < (tower_size + extra_radius * 2)) + Polygons path = inset.offset(line_width / 2); + for (size_t ring = 0; ring < rings; ++ring) { - pattern.polygons.add(outset); - outset = outset.offset(line_width); - circles++; + pattern.polygons.add(path); + path = path.offset(line_width); } return pattern; @@ -167,7 +150,9 @@ void PrimeTower::generatePaths_denseInfill() const bool base_enabled = mesh_group_settings.get("prime_tower_brim_enable"); const coord_t base_extra_radius = scene.settings.get("prime_tower_base_size"); const coord_t base_height = scene.settings.get("prime_tower_base_height"); - const int magnitude = scene.settings.get("prime_tower_base_curve_magnitude"); + const int base_curve_magnitude = mesh_group_settings.get("prime_tower_base_curve_magnitude"); + const coord_t line_width = scene.extruders[extruder_order.front()].settings.get("prime_tower_line_width"); + pattern_per_extruder.resize(extruder_count); pattern_extra_brim_per_layer.resize(extruder_count); @@ -195,18 +180,21 @@ void PrimeTower::generatePaths_denseInfill() } // The most outside extruder is used for the base - if (base_enabled && extruder_nr == extruder_order.front()) + if (extruder_nr == extruder_order.front() && base_enabled && base_extra_radius > 0 && base_height > 0) { for (coord_t z = 0; z < base_height; z += layer_height) { - double brim_radius_factor = std::pow((1.0 - static_cast(z) / base_height), magnitude); + double brim_radius_factor = std::pow((1.0 - static_cast(z) / base_height), base_curve_magnitude); coord_t extra_radius = base_extra_radius * brim_radius_factor; - ExtrusionMoves pattern = generatePaths_base(outer_poly, extra_radius, line_width); - if (pattern.polygons.empty() && pattern.lines.empty()) + size_t extra_rings = extra_radius / line_width; + if (extra_rings == 0) { break; } - pattern_extra_brim_per_layer[extruder_nr].push_back(pattern); + extra_radius = line_width * extra_rings; + outer_poly_base.push_back(outer_poly.offset(extra_radius)); + + pattern_extra_brim_per_layer[extruder_nr].push_back(generatePaths_base(outer_poly, extra_rings, line_width)); } } @@ -283,14 +271,9 @@ void PrimeTower::addToGcode(const SliceDataStorage& storage, LayerPlan& gcode_la void PrimeTower::addToGcode_denseInfill(LayerPlan& gcode_layer, const size_t extruder_nr) const { - const Settings& mesh_group_settings = Application::getInstance().current_slice->scene.current_mesh_group->settings; - const ExtruderTrain& base_train = mesh_group_settings.get("raft_base_extruder_nr"); - const bool adhesion_raft = base_train.settings.get("adhesion_type") == EPlatformAdhesion::RAFT; - LayerIndex absolute_layer_number = gcode_layer.getLayerNr(); - if (adhesion_raft) - { - absolute_layer_number += Raft::getTotalExtraLayers(); - } + const size_t raft_total_extra_layers = Raft::getTotalExtraLayers(); + const bool adhesion_raft = raft_total_extra_layers > 0; + LayerIndex absolute_layer_number = gcode_layer.getLayerNr() + raft_total_extra_layers; if (! adhesion_raft || absolute_layer_number > 0) { @@ -324,6 +307,24 @@ void PrimeTower::subtractFromSupport(SliceDataStorage& storage) } } +const Polygons& PrimeTower::getOuterPoly(const LayerIndex& layer_nr) const +{ + const LayerIndex absolute_layer_nr = layer_nr + Raft::getTotalExtraLayers(); + if (absolute_layer_nr < outer_poly_base.size()) + { + return outer_poly_base[absolute_layer_nr]; + } + else + { + return outer_poly; + } +} + +const Polygons& PrimeTower::getGroundPoly() const +{ + return getOuterPoly(-Raft::getTotalExtraLayers()); +} + void PrimeTower::gotoStartLocation(LayerPlan& gcode_layer, const int extruder_nr) const { int current_start_location_idx = ((((extruder_nr + 1) * gcode_layer.getLayerNr()) % number_of_prime_tower_start_locations) + number_of_prime_tower_start_locations) diff --git a/src/SkirtBrim.cpp b/src/SkirtBrim.cpp index 2ec4d932c2..522e0994f5 100644 --- a/src/SkirtBrim.cpp +++ b/src/SkirtBrim.cpp @@ -118,6 +118,7 @@ void SkirtBrim::generate() constexpr LayerIndex layer_nr = 0; constexpr bool include_support = true; const bool include_prime_tower = adhesion_type == EPlatformAdhesion::SKIRT; + const bool has_prime_tower = storage.primeTower.enabled; Polygons covered_area = storage.getLayerOutlines(layer_nr, include_support, include_prime_tower, /*external_polys_only*/ false); std::vector allowed_areas_per_extruder(extruder_count); @@ -135,6 +136,11 @@ void SkirtBrim::generate() // so that the brim lines don't overlap with the holes by half the line width allowed_areas_per_extruder[extruder_nr] = allowed_areas_per_extruder[extruder_nr].difference(getInternalHoleExclusionArea(covered_area, extruder_nr)); } + + if (has_prime_tower) + { + allowed_areas_per_extruder[extruder_nr] = allowed_areas_per_extruder[extruder_nr].difference(storage.primeTower.getGroundPoly()); + } } // Apply 'approximate convex hull' if the adhesion is skirt _after_ any skirt but also prime-tower-brim adhesion. @@ -344,12 +350,12 @@ Polygons SkirtBrim::getFirstLayerOutline(const int extruder_nr /* = -1 */) const int primary_line_count = line_count[reference_extruder_nr]; const bool external_only = adhesion_type == EPlatformAdhesion::SKIRT || external_polys_only[reference_extruder_nr]; // Whether to include holes or not. Skirt doesn't have any holes. + const bool has_prime_tower = storage.primeTower.enabled; const LayerIndex layer_nr = 0; if (adhesion_type == EPlatformAdhesion::SKIRT) { constexpr bool include_support = true; - const bool skirt_around_prime_tower_brim = storage.primeTower.enabled && global_settings.get("prime_tower_brim_enable"); - const bool include_prime_tower = ! skirt_around_prime_tower_brim; // include manually otherwise + const bool include_prime_tower = ! has_prime_tower; // include manually otherwise first_layer_outline = Polygons(); int skirt_height = 0; @@ -371,10 +377,9 @@ Polygons SkirtBrim::getFirstLayerOutline(const int extruder_nr /* = -1 */) } } - - if (skirt_around_prime_tower_brim) + if (has_prime_tower) { - first_layer_outline = first_layer_outline.unionPolygons(storage.primeTower.footprint); + first_layer_outline = first_layer_outline.unionPolygons(storage.primeTower.getGroundPoly()); } Polygons shields; diff --git a/src/TreeModelVolumes.cpp b/src/TreeModelVolumes.cpp index 6ddcef2c93..aea31de82c 100644 --- a/src/TreeModelVolumes.cpp +++ b/src/TreeModelVolumes.cpp @@ -150,7 +150,7 @@ TreeModelVolumes::TreeModelVolumes( if (storage.primeTower.enabled) { - anti_overhang_[layer_idx].add(storage.primeTower.outer_poly); + anti_overhang_[layer_idx].add(storage.primeTower.getGroundPoly()); } anti_overhang_[layer_idx] = anti_overhang_[layer_idx].unionPolygons(); }); diff --git a/src/raft.cpp b/src/raft.cpp index bee9cc643b..af8daafde0 100644 --- a/src/raft.cpp +++ b/src/raft.cpp @@ -8,7 +8,6 @@ #include "Slice.h" #include "settings/EnumSettings.h" //For EPlatformAdhesion. #include "sliceDataStorage.h" -#include "support.h" #include "utils/math.h" #include @@ -65,15 +64,6 @@ void Raft::generate(SliceDataStorage& storage) return; } } - - const coord_t prime_tower_distance = settings.get("prime_tower_base_size"); - storage.primeRaftOutline = storage.primeTower.outer_poly.offset(prime_tower_distance, ClipperLib::jtRound); - if (settings.get("raft_remove_inside_corners")) - { - storage.primeRaftOutline = storage.primeRaftOutline.unionPolygons(storage.raftOutline); - storage.primeRaftOutline.makeConvex(); - } - storage.primeRaftOutline = storage.primeRaftOutline.difference(storage.raftOutline); // In case of overlaps. } coord_t Raft::getTotalThickness() diff --git a/src/sliceDataStorage.cpp b/src/sliceDataStorage.cpp index e5ba324ccb..c560a2b675 100644 --- a/src/sliceDataStorage.cpp +++ b/src/sliceDataStorage.cpp @@ -333,14 +333,7 @@ Polygons { if (primeTower.enabled) { - if (layer_nr == 0) - { - total.add(primeTower.footprint); - } - else - { - total.add(primeTower.outer_poly); - } + total.add(primeTower.getOuterPoly(layer_nr)); } } return total;