From 249d2550d359f133d1ffca256a2355ec19973593 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 28 Nov 2022 11:12:52 +0100 Subject: [PATCH] Remove pillar grouping as it does not work nicely --- src/libslic3r/BranchingTree/BranchingTree.hpp | 2 - src/libslic3r/SLA/BranchingTreeSLA.cpp | 62 +------------------ 2 files changed, 1 insertion(+), 63 deletions(-) diff --git a/src/libslic3r/BranchingTree/BranchingTree.hpp b/src/libslic3r/BranchingTree/BranchingTree.hpp index 3f7fd7b80..2d372452b 100644 --- a/src/libslic3r/BranchingTree/BranchingTree.hpp +++ b/src/libslic3r/BranchingTree/BranchingTree.hpp @@ -21,8 +21,6 @@ class Properties public: - constexpr bool group_pillars() const noexcept { return false; } - // Maximum slope for bridges of the tree Properties &max_slope(double val) noexcept { diff --git a/src/libslic3r/SLA/BranchingTreeSLA.cpp b/src/libslic3r/SLA/BranchingTreeSLA.cpp index 16236f7cd..7d6f0b95d 100644 --- a/src/libslic3r/SLA/BranchingTreeSLA.cpp +++ b/src/libslic3r/SLA/BranchingTreeSLA.cpp @@ -20,12 +20,6 @@ class BranchingTreeBuilder: public branchingtree::Builder { std::set m_ground_mem; - // Establish an index of - using PointIndexEl = std::pair; - boost::geometry::index:: - rtree /* ? */> - m_pillar_index; - std::vector m_pillars; // to put an index over them // cache succesfull ground connections @@ -112,44 +106,6 @@ class BranchingTreeBuilder: public branchingtree::Builder { }); } - std::optional - search_for_existing_pillar(const branchingtree::Node &from) const - { - namespace bgi = boost::geometry::index; - - struct Output - { - std::optional &res; - - Output &operator*() { return *this; } - Output &operator=(const PointIndexEl &el) { res = el; return *this; } - Output &operator++() { return *this; } - }; - - std::optional result; - - auto filter = bgi::satisfies([this, &from](const PointIndexEl &e) { - assert(e.second < m_pillars.size()); - - auto len = (from.pos - e.first).norm(); - const branchingtree::Node &to = m_pillars[e.second]; - double sd = m_sm.cfg.safety_distance_mm; - - Beam beam{Ball{from.pos.cast(), get_radius(from)}, - Ball{e.first.cast(), get_radius(to)}}; - - return !branchingtree::is_occupied(to) && - len < m_sm.cfg.max_bridge_length_mm && - !m_cloud.is_outside_support_cone(from.pos, e.first) && - beam_mesh_hit(ex_tbb, m_sm.emesh, beam, sd).distance() > len; - }); - - m_pillar_index.query(filter && bgi::nearest(from.pos, 1), - Output{result}); - - return result; - } - public: BranchingTreeBuilder(SupportTreeBuilder &builder, const SupportableMesh &sm, @@ -368,23 +324,7 @@ void create_branching_tree(SupportTreeBuilder &builder, const SupportableMesh &s BranchingTreeBuilder vbuilder{builder, sm, nodes}; branchingtree::build_tree(nodes, vbuilder); - std::cout << "Original pillar count: " << vbuilder.pillars().size() << std::endl; - - if constexpr (props.group_pillars()) { - - std::vector bedleafs; - std::copy(vbuilder.pillars().begin(), vbuilder.pillars().end(), std::back_inserter(bedleafs)); - - branchingtree::PointCloud gndnodes{{}, nodes.get_bedpoints(), bedleafs, props}; - BranchingTreeBuilder gndbuilder{builder, sm, gndnodes}; - branchingtree::build_tree(gndnodes, gndbuilder); - - std::cout << "Grouped pillar count: " << gndbuilder.pillars().size() << std::endl; - build_pillars(builder, gndbuilder, sm); - - } else { - build_pillars(builder, vbuilder, sm); - } + build_pillars(builder, vbuilder, sm); for (size_t id : vbuilder.unroutable_pinheads()) builder.head(id).invalidate();