Organic Supports improvements:
Added support_tree_branch_distance parameter to UI Fixed error in calculation of placeable areas, which made some trees to cut through an object. Locked the tree tips against smoothing of their centerline path. Reduced density of tips with zero interface layers (see continuous_tips). Reduced default support_tree_top_rate to 15% Refactored placement of interfaces for readability.
This commit is contained in:
parent
ca0b218a56
commit
9ce81d6d12
10 changed files with 666 additions and 474 deletions
|
@ -328,6 +328,26 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
// Caching polygons for a range of layers.
|
||||
struct LayerPolygonCache {
|
||||
std::vector<Polygons> polygons;
|
||||
LayerIndex idx_begin;
|
||||
LayerIndex idx_end;
|
||||
|
||||
void allocate(LayerIndex aidx_begin, LayerIndex aidx_end) {
|
||||
this->idx_begin = aidx_begin;
|
||||
this->idx_end = aidx_end;
|
||||
this->polygons.assign(aidx_end - aidx_begin, {});
|
||||
}
|
||||
|
||||
LayerIndex begin() const { return idx_begin; }
|
||||
LayerIndex end() const { return idx_end; }
|
||||
size_t size() const { return polygons.size(); }
|
||||
|
||||
bool has(LayerIndex idx) const { return idx >= idx_begin && idx < idx_end; }
|
||||
Polygons& operator[](LayerIndex idx) { return polygons[idx + idx_begin]; }
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief Convenience typedef for the keys to the caches
|
||||
*/
|
||||
|
@ -363,6 +383,13 @@ private:
|
|||
for (auto &d : in)
|
||||
m_data[first_layer_idx ++].emplace(radius, std::move(d));
|
||||
}
|
||||
void insert(LayerPolygonCache &&in, coord_t radius) {
|
||||
std::lock_guard<std::mutex> guard(m_mutex);
|
||||
LayerIndex i = in.idx_begin;
|
||||
allocate_layers(i + LayerIndex(in.size()));
|
||||
for (auto &d : in.polygons)
|
||||
m_data[i ++].emplace(radius, std::move(d));
|
||||
}
|
||||
/*!
|
||||
* \brief Checks a cache for a given RadiusLayerPair and returns it if it is found
|
||||
* \param key RadiusLayerPair of the requested areas. The radius will be calculated up to the provided layer.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue