Enable ground facing only option for branching tree

Essentially discards mesh nodes
This commit is contained in:
tamasmeszaros 2022-05-18 10:15:51 +02:00
parent 5d6d1f5234
commit 6523bfdf99
3 changed files with 6 additions and 15 deletions

View File

@ -171,8 +171,9 @@ bool BranchingTreeBuilder::add_mesh_bridge(const branchingtree::Node &from,
{ {
sla::Junction fromj = {from.pos.cast<double>(), get_radius(from)}; sla::Junction fromj = {from.pos.cast<double>(), get_radius(from)};
auto anchor = calculate_anchor_placement(ex_tbb, m_sm, auto anchor = m_sm.cfg.ground_facing_only ?
fromj, std::optional<Anchor>{} : // If no mesh connections are allowed
calculate_anchor_placement(ex_tbb, m_sm, fromj,
to.pos.cast<double>()); to.pos.cast<double>());
if (anchor) { if (anchor) {
@ -183,10 +184,7 @@ bool BranchingTreeBuilder::add_mesh_bridge(const branchingtree::Node &from,
if (hit.distance() > distance(fromj.pos, toj.pos)) { if (hit.distance() > distance(fromj.pos, toj.pos)) {
m_builder.add_diffbridge(fromj.pos, toj.pos, fromj.r, toj.r); m_builder.add_diffbridge(fromj.pos, toj.pos, fromj.r, toj.r);
if (!m_sm.cfg.ground_facing_only) { // Easter egg, to omit the anchors
m_builder.add_anchor(*anchor); m_builder.add_anchor(*anchor);
}
build_subtree(from.id); build_subtree(from.id);
} else { } else {

View File

@ -57,11 +57,7 @@ sla::SupportTreeConfig make_support_cfg(const SLAPrintObjectConfig& c)
scfg.max_bridge_length_mm = c.support_max_bridge_length.getFloat(); scfg.max_bridge_length_mm = c.support_max_bridge_length.getFloat();
scfg.max_pillar_link_distance_mm = c.support_max_pillar_link_distance.getFloat(); scfg.max_pillar_link_distance_mm = c.support_max_pillar_link_distance.getFloat();
scfg.pillar_connection_mode = c.support_pillar_connection_mode.value; scfg.pillar_connection_mode = c.support_pillar_connection_mode.value;
if (scfg.tree_type != sla::SupportTreeType::Branching) {
// Branching tree is all about routing to model body, it doesn't support
// this option.
scfg.ground_facing_only = c.support_buildplate_only.getBool(); scfg.ground_facing_only = c.support_buildplate_only.getBool();
}
scfg.pillar_widening_factor = c.support_pillar_widening_factor.getFloat(); scfg.pillar_widening_factor = c.support_pillar_widening_factor.getFloat();
scfg.base_radius_mm = 0.5*c.support_base_diameter.getFloat(); scfg.base_radius_mm = 0.5*c.support_base_diameter.getFloat();
scfg.base_height_mm = c.support_base_height.getFloat(); scfg.base_height_mm = c.support_base_height.getFloat();

View File

@ -16,9 +16,6 @@ void test_support_model_collision(
sla::SupportTreeConfig supportcfg = input_supportcfg; sla::SupportTreeConfig supportcfg = input_supportcfg;
// Ensure that there are no anchors which would pierce the model.
supportcfg.ground_facing_only = true;
// Set head penetration to a small negative value which should ensure that // Set head penetration to a small negative value which should ensure that
// the supports will not touch the model body. // the supports will not touch the model body.
supportcfg.head_penetration_mm = -0.2; supportcfg.head_penetration_mm = -0.2;