mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-10 10:47:16 +00:00
Fix tree support interfaces and edge filling (#14040)
Fix tree support interfaces Fix: - non-organic tree support interfaces printing in air - organic tree interface missing
This commit is contained in:
@@ -1687,13 +1687,6 @@ void TreeSupport::generate_toolpaths()
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void deleteDirectoryContents(const std::filesystem::path& dir)
|
|
||||||
{
|
|
||||||
for (const auto& entry : std::filesystem::directory_iterator(dir))
|
|
||||||
std::filesystem::remove_all(entry.path());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void TreeSupport::move_bounds_to_contact_nodes(std::vector<TreeSupport3D::SupportElements> &move_bounds,
|
void TreeSupport::move_bounds_to_contact_nodes(std::vector<TreeSupport3D::SupportElements> &move_bounds,
|
||||||
PrintObject &print_object,
|
PrintObject &print_object,
|
||||||
const TreeSupport3D::TreeSupportSettings &config)
|
const TreeSupport3D::TreeSupportSettings &config)
|
||||||
@@ -2146,13 +2139,9 @@ void TreeSupport::draw_circles()
|
|||||||
if (!area.empty()) has_circle_node = true;
|
if (!area.empty()) has_circle_node = true;
|
||||||
if (node.need_extra_wall) need_extra_wall = true;
|
if (node.need_extra_wall) need_extra_wall = true;
|
||||||
|
|
||||||
// Merge the overhang into the roof area so tree tips can still produce
|
// merge overhang to get a smoother interface surface
|
||||||
// a continuous support interface. Suppressing this for build-plate-only
|
// Do not merge when buildplate_only is on, because some underneath nodes may have been deleted.
|
||||||
// support drops the roof polygons entirely in valid tree branches.
|
if (top_interface_layers > 0 && node.support_roof_layers_below > 0 && !on_buildplate_only && !node.is_sharp_tail) {
|
||||||
// ORCA: Only keep top interface polygons that fully fit in the mm height cap.
|
|
||||||
if (top_interface_layers > 0 && node.support_roof_layers_below > 0 &&
|
|
||||||
(node.dist_mm_to_top - this->top_z_distance) < top_interface_height + EPSILON &&
|
|
||||||
!node.is_sharp_tail) {
|
|
||||||
ExPolygons overhang_expanded;
|
ExPolygons overhang_expanded;
|
||||||
if (node.overhang.contour.size() > 100 || node.overhang.holes.size()>1)
|
if (node.overhang.contour.size() > 100 || node.overhang.holes.size()>1)
|
||||||
overhang_expanded.emplace_back(node.overhang);
|
overhang_expanded.emplace_back(node.overhang);
|
||||||
@@ -2198,16 +2187,6 @@ void TreeSupport::draw_circles()
|
|||||||
roof_1st_layer = diff_ex(roof_1st_layer, ClipperUtils::clip_clipper_polygons_with_subject_bbox(roof_areas,get_extents(roof_1st_layer)));
|
roof_1st_layer = diff_ex(roof_1st_layer, ClipperUtils::clip_clipper_polygons_with_subject_bbox(roof_areas,get_extents(roof_1st_layer)));
|
||||||
roof_1st_layer = intersection_ex(roof_1st_layer, m_machine_border);
|
roof_1st_layer = intersection_ex(roof_1st_layer, m_machine_border);
|
||||||
|
|
||||||
// Build-plate-only pruning can collapse the roof stack down to a single
|
|
||||||
// printable layer. In that case we still need to emit an interface layer
|
|
||||||
// instead of downgrading the last roof-adjacent layer to base support.
|
|
||||||
if (on_buildplate_only && top_interface_layers > 0 && roof_areas.empty() && !roof_1st_layer.empty()) {
|
|
||||||
append(roof_areas, roof_1st_layer);
|
|
||||||
roof_1st_layer.clear();
|
|
||||||
max_layers_above_roof = std::max(max_layers_above_roof, max_layers_above_roof1);
|
|
||||||
max_layers_above_roof1 = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ExPolygons roofs; append(roofs, roof_1st_layer); append(roofs, roof_areas);append(roofs, roof_gap_areas);
|
ExPolygons roofs; append(roofs, roof_1st_layer); append(roofs, roof_areas);append(roofs, roof_gap_areas);
|
||||||
base_areas = diff_ex(base_areas, ClipperUtils::clip_clipper_polygons_with_subject_bbox(roofs, get_extents(base_areas)));
|
base_areas = diff_ex(base_areas, ClipperUtils::clip_clipper_polygons_with_subject_bbox(roofs, get_extents(base_areas)));
|
||||||
base_areas = intersection_ex(base_areas, m_machine_border);
|
base_areas = intersection_ex(base_areas, m_machine_border);
|
||||||
@@ -3567,7 +3546,14 @@ void TreeSupport::generate_contact_points()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add supports along contours
|
// add supports along contours
|
||||||
libnest2d::placers::EdgeCache<ExPolygon> edge_cache(overhang);
|
ExPolygon closed_overhang = overhang; // make a copy to add closing point for edge cache
|
||||||
|
if (closed_overhang.contour.points.size() > 1)
|
||||||
|
closed_overhang.contour.points.emplace_back(closed_overhang.contour.points.front());
|
||||||
|
for (Polygon &hole : closed_overhang.holes)
|
||||||
|
if (hole.points.size() > 1)
|
||||||
|
hole.points.emplace_back(hole.points.front());
|
||||||
|
|
||||||
|
libnest2d::placers::EdgeCache<ExPolygon> edge_cache(closed_overhang);
|
||||||
for (size_t i = 0; i < edge_cache.holeCount() + 1; i++) {
|
for (size_t i = 0; i < edge_cache.holeCount() + 1; i++) {
|
||||||
double step = point_spread / (i == 0 ? edge_cache.circumference() : edge_cache.circumference(i - 1));
|
double step = point_spread / (i == 0 ? edge_cache.circumference() : edge_cache.circumference(i - 1));
|
||||||
double distance = 0;
|
double distance = 0;
|
||||||
|
|||||||
@@ -1603,6 +1603,7 @@ static Point move_inside_if_outside(const Polygons &polygons, Point from, int di
|
|||||||
if (settings.increase_radius)
|
if (settings.increase_radius)
|
||||||
current_elem.effective_radius_height += 1;
|
current_elem.effective_radius_height += 1;
|
||||||
coord_t radius = support_element_collision_radius(config, current_elem);
|
coord_t radius = support_element_collision_radius(config, current_elem);
|
||||||
|
|
||||||
const auto _tiny_area_threshold = tiny_area_threshold();
|
const auto _tiny_area_threshold = tiny_area_threshold();
|
||||||
if (settings.move) {
|
if (settings.move) {
|
||||||
increased = relevant_offset;
|
increased = relevant_offset;
|
||||||
@@ -3468,6 +3469,7 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons
|
|||||||
|
|
||||||
// value is the area where support may be placed. As this is calculated in CreateLayerPathing it is saved and reused in draw_areas
|
// value is the area where support may be placed. As this is calculated in CreateLayerPathing it is saved and reused in draw_areas
|
||||||
std::vector<SupportElements> move_bounds(num_support_layers);
|
std::vector<SupportElements> move_bounds(num_support_layers);
|
||||||
|
|
||||||
// ### Place tips of the support tree
|
// ### Place tips of the support tree
|
||||||
for (size_t mesh_idx : processing.second)
|
for (size_t mesh_idx : processing.second)
|
||||||
generate_initial_areas(*print.get_object(mesh_idx), volumes, config, overhangs,
|
generate_initial_areas(*print.get_object(mesh_idx), volumes, config, overhangs,
|
||||||
@@ -3778,6 +3780,7 @@ void organic_draw_branches(
|
|||||||
// ++ ielement;
|
// ++ ielement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const SlicingParameters &slicing_params = print_object.slicing_parameters();
|
const SlicingParameters &slicing_params = print_object.slicing_parameters();
|
||||||
MeshSlicingParams mesh_slicing_params;
|
MeshSlicingParams mesh_slicing_params;
|
||||||
mesh_slicing_params.mode = MeshSlicingParams::SlicingMode::Positive;
|
mesh_slicing_params.mode = MeshSlicingParams::SlicingMode::Positive;
|
||||||
@@ -3959,19 +3962,7 @@ void organic_draw_branches(
|
|||||||
}
|
}
|
||||||
// ORCA: bottom contacts provide the footprint; interface layers are built later.
|
// ORCA: bottom contacts provide the footprint; interface layers are built later.
|
||||||
|
|
||||||
#if 0
|
recover_pending_branch_roofs(interface_placer, branch.path, layer_begin, slices);
|
||||||
//FIXME branch.has_tip seems to not be reliable.
|
|
||||||
if (branch.has_tip && interface_placer.support_parameters.has_top_contacts)
|
|
||||||
// Add top slices to top contacts / interfaces / base interfaces.
|
|
||||||
for (int i = int(branch.path.size()) - 1; i >= 0; -- i) {
|
|
||||||
const SupportElement &el = *branch.path[i];
|
|
||||||
if (el.state.missing_roof_layers == 0)
|
|
||||||
break;
|
|
||||||
//FIXME Move or not?
|
|
||||||
interface_placer.add_roof(std::move(slices[int(slices.size()) - i - 1]), el.state.layer_idx,
|
|
||||||
interface_placer.support_parameters.num_top_interface_layers + 1 - el.state.missing_roof_layers);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (! slices.empty() && slices.back().empty()) {
|
while (! slices.empty() && slices.back().empty()) {
|
||||||
slices.pop_back();
|
slices.pop_back();
|
||||||
|
|||||||
Reference in New Issue
Block a user