Skip to content

Commit

Permalink
Merge branch 'CURA-10854_tree_xyz_override_fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
rburema committed Aug 29, 2023
2 parents e237408 + a56ffc6 commit aee655b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/TreeSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ constexpr auto TREE_PROGRESS_GENERATE_BRANCH_AREAS = TREE_PROGRESS_DRAW_AREAS /
constexpr auto TREE_PROGRESS_SMOOTH_BRANCH_AREAS = TREE_PROGRESS_DRAW_AREAS / 3;
constexpr auto TREE_PROGRESS_FINALIZE_BRANCH_AREAS = TREE_PROGRESS_DRAW_AREAS / 3;

constexpr auto SUPPORT_TREE_MINIMUM_FAKE_ROOF_AREA = 100;
constexpr auto SUPPORT_TREE_MINIMUM_FAKE_ROOF_AREA = 100.0;
constexpr auto SUPPORT_TREE_MINIMUM_FAKE_ROOF_LAYERS = 1;
constexpr auto SUPPORT_TREE_MINIMUM_ROOF_AREA_HARD_LIMIT = false;
constexpr auto SUPPORT_TREE_ONLY_GRACIOUS_TO_MODEL = false;
Expand Down
8 changes: 4 additions & 4 deletions include/TreeSupportTipGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ class TreeSupportTipGenerator


/*!
* \brief Minimum area an overhang has to have to become a roof.
* \brief Minimum area an overhang has to have to be supported.
*/
const double minimum_roof_area;
const double minimum_support_area;

/*!
* \brief Minimum area an overhang has to have to be supported.
* \brief Minimum area an overhang has to have to become a roof.
*/
const double minimum_support_area;
const double minimum_roof_area;

/*!
* \brief Amount of layers of roof. Zero if roof is disabled
Expand Down
7 changes: 6 additions & 1 deletion src/TreeSupportTipGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace cura
TreeSupportTipGenerator::TreeSupportTipGenerator(const SliceDataStorage& storage, const SliceMeshStorage& mesh, TreeModelVolumes& volumes_s)
: config(mesh.settings)
, use_fake_roof(! mesh.settings.get<bool>("support_roof_enable"))
, minimum_roof_area(! use_fake_roof ? mesh.settings.get<double>("minimum_roof_area") : SUPPORT_TREE_MINIMUM_FAKE_ROOF_AREA)
, minimum_support_area(mesh.settings.get<double>("minimum_support_area"))
, minimum_roof_area(! use_fake_roof ? mesh.settings.get<double>("minimum_roof_area") : std::max(SUPPORT_TREE_MINIMUM_FAKE_ROOF_AREA, minimum_support_area))
, support_roof_layers(
mesh.settings.get<bool>("support_roof_enable") ? round_divide(mesh.settings.get<coord_t>("support_roof_height"), config.layer_height)
: use_fake_roof ? SUPPORT_TREE_MINIMUM_FAKE_ROOF_LAYERS
Expand Down Expand Up @@ -976,6 +976,11 @@ void TreeSupportTipGenerator::generateTips(
{
for (Polygons& remaining_overhang_part : remaining_overhang.splitIntoParts(false))
{
if (remaining_overhang_part.area() <= MM2_2INT(minimum_support_area))
{
continue;
}

std::vector<LineInformation> overhang_lines;
Polygons polylines = ensureMaximumDistancePolyline(generateLines(remaining_overhang_part, false, layer_idx), config.min_radius, 1, false);
// ^^^ Support_line_width to form a line here as otherwise most will be unsupported.
Expand Down

0 comments on commit aee655b

Please sign in to comment.