FIX: tree support may generate floating circles

Github: #1687
Change-Id: Ib762bd2f43e1a3671404a85e234c51a0f159d919
(cherry picked from commit adf84cb6e618b60eff57c66c9f4d2fc703a87cae)
This commit is contained in:
Arthur 2023-05-05 12:05:24 +08:00 committed by Lane.Wei
parent 8c57d3cc47
commit ef109ca170
2 changed files with 20 additions and 16 deletions

View file

@ -30,6 +30,15 @@ struct LayerHeightData
LayerHeightData(coordf_t z, coordf_t h, size_t next_layer) : print_z(z), height(h), next_layer_nr(next_layer) {}
};
struct TreeNode {
Vec3f pos;
std::vector<int> children; // index of children in the storing vector
std::vector<int> parents; // index of parents in the storing vector
TreeNode(Point pt, float z) {
pos = { float(unscale_(pt.x())),float(unscale_(pt.y())),z };
}
};
/*!
* \brief Lazily generates tree guidance volumes.
*
@ -90,6 +99,8 @@ public:
std::vector<LayerHeightData> layer_heights;
std::vector<TreeNode> tree_nodes;
private:
/*!
* \brief Convenience typedef for the keys to the caches