Working small-to-normal support merging

Fixed fatal bug with anchors for mini supports

Make the optimization cleaner in support generatior

Much better widening behaviour

Add an optimizer interface and the NLopt implementation into libslic3r

New optimizer based only on nlopt C interfase
Fix build and tests
This commit is contained in:
tamasmeszaros 2020-07-16 11:49:30 +02:00
parent 8cb115a035
commit 927b81ea97
9 changed files with 831 additions and 395 deletions

View file

@ -45,6 +45,11 @@ inline Vec3d spheric_to_dir(const std::pair<double, double> &v)
return spheric_to_dir(v.first, v.second);
}
inline Vec3d spheric_to_dir(const std::array<double, 2> &v)
{
return spheric_to_dir(v[0], v[1]);
}
// Give points on a 3D ring with given center, radius and orientation
// method based on:
// https://math.stackexchange.com/questions/73237/parametric-equation-of-a-circle-in-3d-space
@ -249,7 +254,8 @@ class SupportTreeBuildsteps {
double width)
{
return pinhead_mesh_intersect(s, dir, r_pin, r_back, width,
m_cfg.safety_distance_mm);
r_back * m_cfg.safety_distance_mm /
m_cfg.head_back_radius_mm);
}
// Checking bridge (pillar and stick as well) intersection with the model.
@ -271,7 +277,9 @@ class SupportTreeBuildsteps {
const Vec3d& dir,
double r)
{
return bridge_mesh_intersect(s, dir, r, m_cfg.safety_distance_mm);
return bridge_mesh_intersect(s, dir, r,
r * m_cfg.safety_distance_mm /
m_cfg.head_back_radius_mm);
}
template<class...Args>
@ -311,6 +319,11 @@ class SupportTreeBuildsteps {
m_builder.add_pillar_base(pid, m_cfg.base_height_mm, m_cfg.base_radius_mm);
}
std::optional<DiffBridge> search_widening_path(const Vec3d &jp,
const Vec3d &dir,
double radius,
double new_radius);
public:
SupportTreeBuildsteps(SupportTreeBuilder & builder, const SupportableMesh &sm);