OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::sla::SupportTreeBuilder Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/SLA/SupportTreeBuilder.hpp>

Inheritance diagram for Slic3r::sla::SupportTreeBuilder:
Collaboration diagram for Slic3r::sla::SupportTreeBuilder:

Public Types

using UPtr = std::unique_ptr<SupportTree>

Public Member Functions

 SupportTreeBuilder ()=default
 SupportTreeBuilder (SupportTreeBuilder &&o)
 SupportTreeBuilder (const SupportTreeBuilder &o)
SupportTreeBuilder & operator= (SupportTreeBuilder &&o)
SupportTreeBuilder & operator= (const SupportTreeBuilder &o)
template<class... Args>
Head & add_head (unsigned id, Args &&... args)
template<class... Args>
long add_pillar (long headid, double length)
void add_pillar_base (long pid, double baseheight=3, double radius=2)
template<class... Args>
const Anchor & add_anchor (Args &&...args)
void increment_bridges (const Pillar &pillar)
void increment_links (const Pillar &pillar)
unsigned bridgecount (const Pillar &pillar) const
template<class... Args>
long add_pillar (Args &&...args)
template<class... Args>
const Junction & add_junction (Args &&... args)
const Bridge & add_bridge (const Vec3d &s, const Vec3d &e, double r)
const Bridge & add_bridge (long headid, const Vec3d &endp)
template<class... Args>
const Bridge & add_crossbridge (Args &&... args)
template<class... Args>
const DiffBridge & add_diffbridge (Args &&... args)
Head & head (unsigned id)
size_t pillarcount () const
const std::vector< Pillar > & pillars () const
const std::vector< Head > & heads () const
const std::vector< Bridge > & bridges () const
const std::vector< Bridge > & crossbridges () const
template<class T>
IntegerOnly< T, const Pillar & > pillar (T id) const
template<class T>
IntegerOnly< T, Pillar & > pillar (T id)
const Pad & pad () const
const indexed_triangle_set & merged_mesh (size_t steps=45) const
double full_height () const
double mesh_height () const
const indexed_triangle_set & merge_and_cleanup ()
const indexed_triangle_set & add_pad (const ExPolygons &modelbase, const PadConfig &pcfg) override
 Adding the "pad" under the supports. modelbase will be used according to the embed_object flag in PoolConfig. If set, the plate will be interpreted as the model's intrinsic pad. Otherwise, the modelbase will be unified with the base plate calculated from the supports.
void remove_pad () override
virtual const indexed_triangle_set & retrieve_mesh (MeshType meshtype=MeshType::Support) const override
std::vector< ExPolygons > slice (const std::vector< float > &, float closing_radius) const
void retrieve_full_mesh (indexed_triangle_set &outmesh) const
const JobController & ctl () const

Static Public Member Functions

static UPtr create (const SupportableMesh &input, const JobController &ctl={})

Public Attributes

double ground_level = 0

Private Types

using Mutex = ccr::SpinningMutex

Private Member Functions

template<class BridgeT, class... Args>
const BridgeT & _add_bridge (std::vector< BridgeT > &br, Args &&... args)

Private Attributes

std::vector< Head > m_heads
std::vector< size_t > m_head_indices
std::vector< Pillar > m_pillars
std::vector< Junction > m_junctions
std::vector< Bridge > m_bridges
std::vector< Bridge > m_crossbridges
std::vector< DiffBridge > m_diffbridges
std::vector< Pedestal > m_pedestals
std::vector< Anchor > m_anchors
Pad m_pad
indexed_triangle_set m_meshcache
Mutex m_mutex
bool m_meshcache_valid = false
double m_model_height = 0
JobController m_ctl

Detailed Description

Member Typedef Documentation

◆ Mutex

using Slic3r::sla::SupportTreeBuilder::Mutex = ccr::SpinningMutex
private

◆ UPtr

using Slic3r::sla::SupportTree::UPtr = std::unique_ptr<SupportTree>
inherited

Constructor & Destructor Documentation

◆ SupportTreeBuilder() [1/3]

Slic3r::sla::SupportTreeBuilder::SupportTreeBuilder ( )
default

References SupportTreeBuilder().

Referenced by SupportTreeBuilder(), SupportTreeBuilder(), SupportTreeBuilder(), operator=(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SupportTreeBuilder() [2/3]

Slic3r::sla::SupportTreeBuilder::SupportTreeBuilder ( SupportTreeBuilder && o)
76 : m_heads(std::move(o.m_heads))
77 , m_head_indices{std::move(o.m_head_indices)}
78 , m_pillars{std::move(o.m_pillars)}
79 , m_bridges{std::move(o.m_bridges)}
80 , m_crossbridges{std::move(o.m_crossbridges)}
81 , m_pad{std::move(o.m_pad)}
82 , m_meshcache{std::move(o.m_meshcache)}
83 , m_meshcache_valid{o.m_meshcache_valid}
84 , m_model_height{o.m_model_height}
85 , ground_level{o.ground_level}
86{}
std::vector< Bridge > m_crossbridges
Definition SupportTreeBuilder.hpp:233
double m_model_height
Definition SupportTreeBuilder.hpp:245
indexed_triangle_set m_meshcache
Definition SupportTreeBuilder.hpp:242
std::vector< Bridge > m_bridges
Definition SupportTreeBuilder.hpp:232
double ground_level
Definition SupportTreeBuilder.hpp:258
std::vector< Head > m_heads
Definition SupportTreeBuilder.hpp:228
std::vector< Pillar > m_pillars
Definition SupportTreeBuilder.hpp:230
Pad m_pad
Definition SupportTreeBuilder.hpp:238
std::vector< size_t > m_head_indices
Definition SupportTreeBuilder.hpp:229
bool m_meshcache_valid
Definition SupportTreeBuilder.hpp:244

References SupportTreeBuilder(), ground_level, m_bridges, m_crossbridges, m_head_indices, m_heads, m_meshcache, m_meshcache_valid, m_model_height, m_pad, and m_pillars.

Here is the call graph for this function:

◆ SupportTreeBuilder() [3/3]

Slic3r::sla::SupportTreeBuilder::SupportTreeBuilder ( const SupportTreeBuilder & o)
89 : m_heads(o.m_heads)
90 , m_head_indices{o.m_head_indices}
91 , m_pillars{o.m_pillars}
92 , m_bridges{o.m_bridges}
93 , m_crossbridges{o.m_crossbridges}
94 , m_pad{o.m_pad}
95 , m_meshcache{o.m_meshcache}
96 , m_meshcache_valid{o.m_meshcache_valid}
97 , m_model_height{o.m_model_height}
98 , ground_level{o.ground_level}
99{}

References SupportTreeBuilder(), m_bridges, m_crossbridges, m_head_indices, m_heads, m_meshcache, m_pad, and m_pillars.

Here is the call graph for this function:

Member Function Documentation

◆ _add_bridge()

template<class BridgeT, class... Args>
const BridgeT & Slic3r::sla::SupportTreeBuilder::_add_bridge ( std::vector< BridgeT > & br,
Args &&... args )
inlineprivate
249 {
250 std::lock_guard<Mutex> lk(m_mutex);
251 br.emplace_back(std::forward<Args>(args)...);
252 br.back().id = long(br.size() - 1);
253 m_meshcache_valid = false;
254 return br.back();
255 }
Mutex m_mutex
Definition SupportTreeBuilder.hpp:243

References m_meshcache_valid, and m_mutex.

Referenced by add_bridge(), add_crossbridge(), and add_diffbridge().

Here is the caller graph for this function:

◆ add_anchor()

template<class... Args>
const Anchor & Slic3r::sla::SupportTreeBuilder::add_anchor ( Args &&... args)
inline
304 {
305 std::lock_guard<Mutex> lk(m_mutex);
306 m_anchors.emplace_back(std::forward<Args>(args)...);
307 m_anchors.back().id = long(m_junctions.size() - 1);
308 m_meshcache_valid = false;
309 return m_anchors.back();
310 }
std::vector< Junction > m_junctions
Definition SupportTreeBuilder.hpp:231
std::vector< Anchor > m_anchors
Definition SupportTreeBuilder.hpp:236

References m_anchors, m_junctions, m_meshcache_valid, and m_mutex.

◆ add_bridge() [1/2]

const Bridge & Slic3r::sla::SupportTreeBuilder::add_bridge ( const Vec3d & s,
const Vec3d & e,
double r )
inline
360 {
361 return _add_bridge(m_bridges, s, e, r);
362 }
const BridgeT & _add_bridge(std::vector< BridgeT > &br, Args &&... args)
Definition SupportTreeBuilder.hpp:248

References _add_bridge(), and m_bridges.

Here is the call graph for this function:

◆ add_bridge() [2/2]

const Bridge & Slic3r::sla::SupportTreeBuilder::add_bridge ( long headid,
const Vec3d & endp )
inline
365 {
366 std::lock_guard<Mutex> lk(m_mutex);
367 assert(headid >= 0 && size_t(headid) < m_head_indices.size());
368
369 Head &h = m_heads[m_head_indices[size_t(headid)]];
370 m_bridges.emplace_back(h.junction_point(), endp, h.r_back_mm);
371 m_bridges.back().id = long(m_bridges.size() - 1);
372
373 h.bridge_id = m_bridges.back().id;
374 m_meshcache_valid = false;
375 return m_bridges.back();
376 }

References Slic3r::sla::Head::bridge_id, Slic3r::sla::Head::junction_point(), m_bridges, m_head_indices, m_heads, m_meshcache_valid, m_mutex, and Slic3r::sla::Head::r_back_mm.

Here is the call graph for this function:

◆ add_crossbridge()

template<class... Args>
const Bridge & Slic3r::sla::SupportTreeBuilder::add_crossbridge ( Args &&... args)
inline
379 {
380 return _add_bridge(m_crossbridges, std::forward<Args>(args)...);
381 }

References _add_bridge(), and m_crossbridges.

Here is the call graph for this function:

◆ add_diffbridge()

template<class... Args>
const DiffBridge & Slic3r::sla::SupportTreeBuilder::add_diffbridge ( Args &&... args)
inline
384 {
385 return _add_bridge(m_diffbridges, std::forward<Args>(args)...);
386 }
std::vector< DiffBridge > m_diffbridges
Definition SupportTreeBuilder.hpp:234

References _add_bridge(), and m_diffbridges.

Here is the call graph for this function:

◆ add_head()

template<class... Args>
Head & Slic3r::sla::SupportTreeBuilder::add_head ( unsigned id,
Args &&... args )
inline
267 {
268 std::lock_guard<Mutex> lk(m_mutex);
269 m_heads.emplace_back(std::forward<Args>(args)...);
270 m_heads.back().id = id;
271
272 if (id >= m_head_indices.size()) m_head_indices.resize(id + 1);
273 m_head_indices[id] = m_heads.size() - 1;
274
275 m_meshcache_valid = false;
276 return m_heads.back();
277 }

References m_head_indices, m_heads, m_meshcache_valid, and m_mutex.

◆ add_junction()

template<class... Args>
const Junction & Slic3r::sla::SupportTreeBuilder::add_junction ( Args &&... args)
inline
351 {
352 std::lock_guard<Mutex> lk(m_mutex);
353 m_junctions.emplace_back(std::forward<Args>(args)...);
354 m_junctions.back().id = long(m_junctions.size() - 1);
355 m_meshcache_valid = false;
356 return m_junctions.back();
357 }

References m_junctions, m_meshcache_valid, and m_mutex.

◆ add_pad()

const indexed_triangle_set & Slic3r::sla::SupportTreeBuilder::add_pad ( const ExPolygons & modelbase,
const PadConfig & pcfg )
overridevirtual

Adding the "pad" under the supports. modelbase will be used according to the embed_object flag in PoolConfig. If set, the plate will be interpreted as the model's intrinsic pad. Otherwise, the modelbase will be unified with the base plate calculated from the supports.

Implements Slic3r::sla::SupportTree.

70{
71 m_pad = Pad{merged_mesh(), modelbase, ground_level, cfg, ctl().cancelfn};
72 return m_pad.tmesh;
73}
const indexed_triangle_set & merged_mesh(size_t steps=45) const
Definition SupportTreeBuilder.cpp:143
const JobController & ctl() const
Definition SupportTree.hpp:168
@ Pad
Definition SupportTree.hpp:117
CancelFn cancelfn
Definition JobController.hpp:27

References Slic3r::sla::JobController::cancelfn, Slic3r::sla::SupportTree::ctl(), ground_level, m_pad, and merged_mesh().

Here is the call graph for this function:

◆ add_pillar() [1/2]

template<class... Args>
long Slic3r::sla::SupportTreeBuilder::add_pillar ( Args &&... args)
inline
337 {
338 std::lock_guard<Mutex> lk(m_mutex);
339 if (m_pillars.capacity() < m_heads.size())
340 m_pillars.reserve(m_heads.size() * 10);
341
342 m_pillars.emplace_back(std::forward<Args>(args)...);
343 Pillar& pillar = m_pillars.back();
344 pillar.id = long(m_pillars.size() - 1);
345 pillar.starts_from_head = false;
346 m_meshcache_valid = false;
347 return pillar.id;
348 }
IntegerOnly< T, const Pillar & > pillar(T id) const
Definition SupportTreeBuilder.hpp:407

References m_heads, m_meshcache_valid, m_mutex, m_pillars, and pillar().

Here is the call graph for this function:

◆ add_pillar() [2/2]

template<class... Args>
long Slic3r::sla::SupportTreeBuilder::add_pillar ( long headid,
double length )
inline
280 {
281 std::lock_guard<Mutex> lk(m_mutex);
282 if (m_pillars.capacity() < m_heads.size())
283 m_pillars.reserve(m_heads.size() * 10);
284
285 assert(headid >= 0 && size_t(headid) < m_head_indices.size());
286 Head &head = m_heads[m_head_indices[size_t(headid)]];
287
288 Vec3d hjp = head.junction_point() - Vec3d{0, 0, length};
289 m_pillars.emplace_back(hjp, length, head.r_back_mm);
290
291 Pillar& pillar = m_pillars.back();
292 pillar.id = long(m_pillars.size() - 1);
293 head.pillar_id = pillar.id;
294 pillar.start_junction_id = head.id;
295 pillar.starts_from_head = true;
296
297 m_meshcache_valid = false;
298 return pillar.id;
299 }
Head & head(unsigned id)
Definition SupportTreeBuilder.hpp:388
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition SpatIndex.hpp:18
double length(const Points &pts)
Definition MultiPoint.hpp:181

References head(), Slic3r::length(), m_head_indices, m_heads, m_meshcache_valid, m_mutex, m_pillars, and pillar().

Here is the call graph for this function:

◆ add_pillar_base()

void Slic3r::sla::SupportTreeBuilder::add_pillar_base ( long pid,
double baseheight = 3,
double radius = 2 )
132{
133 std::lock_guard<Mutex> lk(m_mutex);
134 assert(pid >= 0 && size_t(pid) < m_pillars.size());
135 Pillar& pll = m_pillars[size_t(pid)];
136 m_pedestals.emplace_back(pll.endpt, std::min(baseheight, pll.height),
137 std::max(radius, pll.r), pll.r);
138
139 m_pedestals.back().id = m_pedestals.size() - 1;
140 m_meshcache_valid = false;
141}
std::vector< Pedestal > m_pedestals
Definition SupportTreeBuilder.hpp:235

References Slic3r::sla::Pillar::endpt, Slic3r::sla::Pillar::height, m_meshcache_valid, m_mutex, m_pedestals, m_pillars, and Slic3r::sla::Pillar::r.

◆ bridgecount()

unsigned Slic3r::sla::SupportTreeBuilder::bridgecount ( const Pillar & pillar) const
inline
330 {
331 std::lock_guard<Mutex> lk(m_mutex);
332 assert(pillar.id >= 0 && size_t(pillar.id) < m_pillars.size());
333 return pillar.bridges;
334 }

References m_mutex, m_pillars, and pillar().

Here is the call graph for this function:

◆ bridges()

const std::vector< Bridge > & Slic3r::sla::SupportTreeBuilder::bridges ( ) const
inline
404{ return m_bridges; }

References m_bridges.

◆ create()

SupportTree::UPtr Slic3r::sla::SupportTree::create ( const SupportableMesh & input,
const JobController & ctl = {} )
staticinherited
89{
90 auto builder = make_unique<SupportTreeBuilder>();
91 builder->m_ctl = ctl;
92
93 if (sm.cfg.enabled) {
94 // Execute takes care about the ground_level
96 builder->merge_and_cleanup(); // clean metadata, leave only the meshes.
97 } else {
98 // If a pad gets added later, it will be in the right Z level
99 builder->ground_level = sm.emesh.ground_level();
100 }
101
102 return std::move(builder);
103}
static bool execute(SupportTreeBuilder &builder, const SupportableMesh &sm)
Definition SupportTreeBuildsteps.cpp:80
std::unique_ptr< T > make_unique(Args &&... args)
Definition libslic3r.h:239

References Slic3r::sla::SupportableMesh::cfg, ctl(), Slic3r::sla::SupportableMesh::emesh, Slic3r::sla::SupportTreeConfig::enabled, Slic3r::sla::SupportTreeBuildsteps::execute(), Slic3r::sla::IndexedMesh::ground_level(), and Slic3r::make_unique().

Referenced by Slic3r::SLAPrintObject::SupportData::create_support_tree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ crossbridges()

const std::vector< Bridge > & Slic3r::sla::SupportTreeBuilder::crossbridges ( ) const
inline
405{ return m_crossbridges; }

References m_crossbridges.

◆ ctl()

const JobController & Slic3r::sla::SupportTree::ctl ( ) const
inlineinherited
168{ return m_ctl; }
JobController m_ctl
Definition SupportTree.hpp:142

References m_ctl.

Referenced by Slic3r::sla::SupportTreeBuilder::add_pad(), create(), Slic3r::sla::SupportTreeBuildsteps::execute(), Slic3r::sla::SupportTreeBuilder::merged_mesh(), and slice().

Here is the caller graph for this function:

◆ full_height()

double Slic3r::sla::SupportTreeBuilder::full_height ( ) const
209{
210 if (merged_mesh().indices.empty() && !pad().empty())
211 return pad().cfg.full_height();
212
213 double h = mesh_height();
214 if (!pad().empty()) h += pad().cfg.required_elevation();
215 return h;
216}
double mesh_height() const
Definition SupportTreeBuilder.hpp:434
const Pad & pad() const
Definition SupportTreeBuilder.hpp:425
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:273
double full_height() const
Definition Pad.hpp:76
double required_elevation() const
Returns the elevation needed for compensating the pad.
Definition Pad.hpp:82
PadConfig cfg
Definition SupportTreeBuilder.hpp:198

References Slic3r::sla::Pad::cfg, Slic3r::empty(), Slic3r::sla::PadConfig::full_height(), merged_mesh(), mesh_height(), pad(), and Slic3r::sla::PadConfig::required_elevation().

Here is the call graph for this function:

◆ head()

Head & Slic3r::sla::SupportTreeBuilder::head ( unsigned id)
inline
389 {
390 std::lock_guard<Mutex> lk(m_mutex);
391 assert(id < m_head_indices.size());
392
393 m_meshcache_valid = false;
394 return m_heads[m_head_indices[id]];
395 }

References m_head_indices, m_heads, m_meshcache_valid, and m_mutex.

Referenced by add_pillar(), and merged_mesh().

Here is the caller graph for this function:

◆ heads()

const std::vector< Head > & Slic3r::sla::SupportTreeBuilder::heads ( ) const
inline
403{ return m_heads; }

References m_heads.

◆ increment_bridges()

void Slic3r::sla::SupportTreeBuilder::increment_bridges ( const Pillar & pillar)
inline
313 {
314 std::lock_guard<Mutex> lk(m_mutex);
315 assert(pillar.id >= 0 && size_t(pillar.id) < m_pillars.size());
316
317 if(pillar.id >= 0 && size_t(pillar.id) < m_pillars.size())
318 m_pillars[size_t(pillar.id)].bridges++;
319 }

References m_mutex, m_pillars, and pillar().

Here is the call graph for this function:

◆ increment_links()

void Slic3r::sla::SupportTreeBuilder::increment_links ( const Pillar & pillar)
inline
322 {
323 std::lock_guard<Mutex> lk(m_mutex);
324 assert(pillar.id >= 0 && size_t(pillar.id) < m_pillars.size());
325
326 if(pillar.id >= 0 && size_t(pillar.id) < m_pillars.size())
327 m_pillars[size_t(pillar.id)].links++;
328 }

References m_mutex, m_pillars, and pillar().

Here is the call graph for this function:

◆ merge_and_cleanup()

const indexed_triangle_set & Slic3r::sla::SupportTreeBuilder::merge_and_cleanup ( )
219{
220 // in case the mesh is not generated, it should be...
221 auto &ret = merged_mesh();
222
223 // Doing clear() does not garantee to release the memory.
224 m_heads = {};
225 m_head_indices = {};
226 m_pillars = {};
227 m_junctions = {};
228 m_bridges = {};
229
230 return ret;
231}

References m_bridges, m_head_indices, m_heads, m_junctions, m_pillars, and merged_mesh().

Here is the call graph for this function:

◆ merged_mesh()

const indexed_triangle_set & Slic3r::sla::SupportTreeBuilder::merged_mesh ( size_t steps = 45) const
144{
145 if (m_meshcache_valid) return m_meshcache;
146
147 indexed_triangle_set merged;
148
149 for (auto &head : m_heads) {
150 if (ctl().stopcondition()) break;
151 if (head.is_valid()) its_merge(merged, get_mesh(head, steps));
152 }
153
154 for (auto &pill : m_pillars) {
155 if (ctl().stopcondition()) break;
156 its_merge(merged, get_mesh(pill, steps));
157 }
158
159 for (auto &pedest : m_pedestals) {
160 if (ctl().stopcondition()) break;
161 its_merge(merged, get_mesh(pedest, steps));
162 }
163
164 for (auto &j : m_junctions) {
165 if (ctl().stopcondition()) break;
166 its_merge(merged, get_mesh(j, steps));
167 }
168
169 for (auto &bs : m_bridges) {
170 if (ctl().stopcondition()) break;
171 its_merge(merged, get_mesh(bs, steps));
172 }
173
174 for (auto &bs : m_crossbridges) {
175 if (ctl().stopcondition()) break;
176 its_merge(merged, get_mesh(bs, steps));
177 }
178
179 for (auto &bs : m_diffbridges) {
180 if (ctl().stopcondition()) break;
181 its_merge(merged, get_mesh(bs, steps));
182 }
183
184 for (auto &anch : m_anchors) {
185 if (ctl().stopcondition()) break;
186 its_merge(merged, get_mesh(anch, steps));
187 }
188
189 if (ctl().stopcondition()) {
190 // In case of failure we have to return an empty mesh
191 m_meshcache = {};
192 return m_meshcache;
193 }
194
195 m_meshcache = merged;
196
197 // The mesh will be passed by const-pointer to TriangleMeshSlicer,
198 // which will need this.
200
201 BoundingBoxf3 bb = bounding_box(m_meshcache);
202 m_model_height = bb.max(Z) - bb.min(Z);
203
204 m_meshcache_valid = true;
205 return m_meshcache;
206}
@ Z
Definition SupportTreeBuildsteps.hpp:37
indexed_triangle_set & get_mesh(Interior &interior)
Definition Hollowing.cpp:69
int its_merge_vertices(indexed_triangle_set &its, bool shrink_to_fit)
Definition TriangleMesh.cpp:690
BoundingBoxf3 bounding_box(const TriangleMesh &m)
Definition TriangleMesh.hpp:391
void its_merge(indexed_triangle_set &A, const indexed_triangle_set &B)
Definition TriangleMesh.cpp:1448

References Slic3r::bounding_box(), Slic3r::sla::SupportTree::ctl(), Slic3r::sla::get_mesh(), head(), Slic3r::its_merge(), Slic3r::its_merge_vertices(), m_anchors, m_bridges, m_crossbridges, m_diffbridges, m_heads, m_junctions, m_meshcache, m_meshcache_valid, m_model_height, m_pedestals, m_pillars, Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max, Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min, and Slic3r::sla::Z.

Referenced by add_pad(), full_height(), merge_and_cleanup(), mesh_height(), and retrieve_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mesh_height()

double Slic3r::sla::SupportTreeBuilder::mesh_height ( ) const
inline
435 {
437 return m_model_height;
438 }

References m_meshcache_valid, m_model_height, and merged_mesh().

Referenced by full_height().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

SupportTreeBuilder & Slic3r::sla::SupportTreeBuilder::operator= ( const SupportTreeBuilder & o)
117{
118 m_heads = o.m_heads;
119 m_head_indices = o.m_head_indices;
120 m_pillars = o.m_pillars;
121 m_bridges = o.m_bridges;
122 m_crossbridges = o.m_crossbridges;
123 m_pad = o.m_pad;
124 m_meshcache = o.m_meshcache;
125 m_meshcache_valid = o.m_meshcache_valid;
126 m_model_height = o.m_model_height;
127 ground_level = o.ground_level;
128 return *this;
129}

References SupportTreeBuilder(), ground_level, m_bridges, m_crossbridges, m_head_indices, m_heads, m_meshcache, m_meshcache_valid, m_model_height, m_pad, and m_pillars.

Here is the call graph for this function:

◆ operator=() [2/2]

SupportTreeBuilder & Slic3r::sla::SupportTreeBuilder::operator= ( SupportTreeBuilder && o)
102{
103 m_heads = std::move(o.m_heads);
104 m_head_indices = std::move(o.m_head_indices);
105 m_pillars = std::move(o.m_pillars);
106 m_bridges = std::move(o.m_bridges);
107 m_crossbridges = std::move(o.m_crossbridges);
108 m_pad = std::move(o.m_pad);
109 m_meshcache = std::move(o.m_meshcache);
110 m_meshcache_valid = o.m_meshcache_valid;
111 m_model_height = o.m_model_height;
112 ground_level = o.ground_level;
113 return *this;
114}

References SupportTreeBuilder(), ground_level, m_bridges, m_crossbridges, m_head_indices, m_heads, m_meshcache, m_meshcache_valid, m_model_height, m_pad, and m_pillars.

Here is the call graph for this function:

◆ pad()

const Pad & Slic3r::sla::SupportTreeBuilder::pad ( ) const
inline
425{ return m_pad; }

References m_pad.

Referenced by full_height(), and retrieve_mesh().

Here is the caller graph for this function:

◆ pillar() [1/2]

template<class T>
IntegerOnly< T, Pillar & > Slic3r::sla::SupportTreeBuilder::pillar ( T id)
inline
417 {
418 std::lock_guard<Mutex> lk(m_mutex);
419 assert(id >= 0 && size_t(id) < m_pillars.size() &&
420 size_t(id) < std::numeric_limits<size_t>::max());
421
422 return m_pillars[size_t(id)];
423 }

References m_mutex, and m_pillars.

◆ pillar() [2/2]

template<class T>
IntegerOnly< T, const Pillar & > Slic3r::sla::SupportTreeBuilder::pillar ( T id) const
inline
408 {
409 std::lock_guard<Mutex> lk(m_mutex);
410 assert(id >= 0 && size_t(id) < m_pillars.size() &&
411 size_t(id) < std::numeric_limits<size_t>::max());
412
413 return m_pillars[size_t(id)];
414 }

References m_mutex, and m_pillars.

Referenced by add_pillar(), add_pillar(), bridgecount(), increment_bridges(), and increment_links().

Here is the caller graph for this function:

◆ pillarcount()

size_t Slic3r::sla::SupportTreeBuilder::pillarcount ( ) const
inline
397 {
398 std::lock_guard<Mutex> lk(m_mutex);
399 return m_pillars.size();
400 }

References m_mutex, and m_pillars.

◆ pillars()

const std::vector< Pillar > & Slic3r::sla::SupportTreeBuilder::pillars ( ) const
inline
402{ return m_pillars; }

References m_pillars.

◆ remove_pad()

void Slic3r::sla::SupportTreeBuilder::remove_pad ( )
inlineoverridevirtual

Implements Slic3r::sla::SupportTree.

448{ m_pad = Pad(); }

References m_pad, and Slic3r::sla::Pad.

◆ retrieve_full_mesh()

void Slic3r::sla::SupportTree::retrieve_full_mesh ( indexed_triangle_set & outmesh) const
inherited
36 {
39}
virtual const indexed_triangle_set & retrieve_mesh(MeshType meshtype) const =0
@ Support
Definition SupportTree.hpp:117

References Slic3r::its_merge(), Slic3r::sla::Pad, retrieve_mesh(), and Slic3r::sla::Support.

Here is the call graph for this function:

◆ retrieve_mesh()

const indexed_triangle_set & Slic3r::sla::SupportTreeBuilder::retrieve_mesh ( MeshType meshtype = MeshType::Support) const
overridevirtual

Implements Slic3r::sla::SupportTree.

234{
235 switch(meshtype) {
236 case MeshType::Support: return merged_mesh();
237 case MeshType::Pad: return pad().tmesh;
238 }
239
240 return m_meshcache;
241}
indexed_triangle_set tmesh
Definition SupportTreeBuilder.hpp:197

References m_meshcache, merged_mesh(), Slic3r::sla::Pad, pad(), Slic3r::sla::Support, and Slic3r::sla::Pad::tmesh.

Here is the call graph for this function:

◆ slice()

std::vector< ExPolygons > Slic3r::sla::SupportTree::slice ( const std::vector< float > & grid,
float closing_radius ) const
inherited
43{
44 const indexed_triangle_set &sup_mesh = retrieve_mesh(MeshType::Support);
45 const indexed_triangle_set &pad_mesh = retrieve_mesh(MeshType::Pad);
46
47 using Slices = std::vector<ExPolygons>;
48 auto slices = reserve_vector<Slices>(2);
49
50 if (!sup_mesh.empty()) {
51 slices.emplace_back();
52 slices.back() = slice_mesh_ex(sup_mesh, grid, cr, ctl().cancelfn);
53 }
54
55 if (!pad_mesh.empty()) {
56 slices.emplace_back();
57
58 auto bb = bounding_box(pad_mesh);
59 auto maxzit = std::upper_bound(grid.begin(), grid.end(), bb.max.z());
60
61 auto cap = grid.end() - maxzit;
62 auto padgrid = reserve_vector<float>(size_t(cap > 0 ? cap : 0));
63 std::copy(grid.begin(), maxzit, std::back_inserter(padgrid));
64
65 slices.back() = slice_mesh_ex(pad_mesh, padgrid, cr, ctl().cancelfn);
66 }
67
68 size_t len = grid.size();
69 for (const Slices &slv : slices) { len = std::min(len, slv.size()); }
70
71 // Either the support or the pad or both has to be non empty
72 if (slices.empty()) return {};
73
74 Slices &mrg = slices.front();
75
76 for (auto it = std::next(slices.begin()); it != slices.end(); ++it) {
77 for (size_t i = 0; i < len; ++i) {
78 Slices &slv = *it;
79 std::copy(slv[i].begin(), slv[i].end(), std::back_inserter(mrg[i]));
80 slv[i] = {}; // clear and delete
81 }
82 }
83
84 return mrg;
85}
T * begin(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:838
T * end(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:841
IntegerOnly< I, std::vector< T, Args... > > reserve_vector(I capacity)
Definition libslic3r.h:370
std::vector< ArithmeticOnly< T > > grid(const T &start, const T &stop, const T &stride)
A set of equidistant values starting from 'start' (inclusive), ending in the closest multiple of 'str...
Definition MTUtils.hpp:127
std::vector< ExPolygons > slice_mesh_ex(const indexed_triangle_set &mesh, const std::vector< float > &zs, const MeshSlicingParamsEx &params, std::function< void()> throw_on_cancel)
Definition TriangleMeshSlicer.cpp:2142

References Slic3r::bounding_box(), ctl(), Slic3r::grid(), Slic3r::sla::Pad, Slic3r::reserve_vector(), retrieve_mesh(), Slic3r::slice_mesh_ex(), and Slic3r::sla::Support.

Here is the call graph for this function:

Member Data Documentation

◆ ground_level

double Slic3r::sla::SupportTreeBuilder::ground_level = 0

◆ m_anchors

std::vector<Anchor> Slic3r::sla::SupportTreeBuilder::m_anchors
private

Referenced by add_anchor(), and merged_mesh().

◆ m_bridges

std::vector<Bridge> Slic3r::sla::SupportTreeBuilder::m_bridges
private

◆ m_crossbridges

std::vector<Bridge> Slic3r::sla::SupportTreeBuilder::m_crossbridges
private

◆ m_ctl

JobController Slic3r::sla::SupportTree::m_ctl
privateinherited

Referenced by ctl().

◆ m_diffbridges

std::vector<DiffBridge> Slic3r::sla::SupportTreeBuilder::m_diffbridges
private

Referenced by add_diffbridge(), and merged_mesh().

◆ m_head_indices

std::vector<size_t> Slic3r::sla::SupportTreeBuilder::m_head_indices
private

◆ m_heads

std::vector<Head> Slic3r::sla::SupportTreeBuilder::m_heads
private

◆ m_junctions

std::vector<Junction> Slic3r::sla::SupportTreeBuilder::m_junctions
private

◆ m_meshcache

indexed_triangle_set Slic3r::sla::SupportTreeBuilder::m_meshcache
mutableprivate

◆ m_meshcache_valid

bool Slic3r::sla::SupportTreeBuilder::m_meshcache_valid = false
mutableprivate

◆ m_model_height

double Slic3r::sla::SupportTreeBuilder::m_model_height = 0
mutableprivate

◆ m_mutex

◆ m_pad

Pad Slic3r::sla::SupportTreeBuilder::m_pad
private

◆ m_pedestals

std::vector<Pedestal> Slic3r::sla::SupportTreeBuilder::m_pedestals
private

Referenced by add_pillar_base(), and merged_mesh().

◆ m_pillars


The documentation for this class was generated from the following files: