Detection of curled edges to enhance slowdown for overhangs algorithm (#2056)

* Overhang perimeter handling

Updated code to handle overhang perimeters as an overhang and not as a bridge.

* Preparing to add curled extrusions identification

* Porting curling calculations from Prusa Slier 2.6.1

* Prototype 1 - slowdown extended to detect curled edges and further reduce speed

First prototype of the code submitted.

* Working prototype - 2

Code is now finally working - external perimeters are slowed down as needed when there is likelyhood of curling up.

ToDo:
1. Reslicing the model causes the algorithm not to run - need to find where this fails to trigger the call for this.
2. Slowdown of internal perimeters not working yet.

* Updated to use overhang wall speed instead of bridging speed for this algorithm

* Fixed bug in speed calculation and tweaked parameters for high speed printer

Fixed bug in speed calculation and tweaked parameters for high speed printer

* Attempting to fix "set started" not being set

* Parameter tweak after print tests

* Fixed estimation not running when model is re-sliced.

* Removing debug printf statements and fixed threading flag.

* Fixed threading

* Parameter tweaks following print tests

* Made this as an option in the GUI

* Reintroduced handling of bridges as per original design

* UI line toggling when option makes sense to be visible.

* Fixed bug in field visibility & made it default to off

* Code optimisation

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
igiannakas 2023-09-16 15:24:18 +01:00 committed by GitHub
parent bcedb431ab
commit 61437b2c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 322 additions and 143 deletions

View file

@ -1,6 +1,6 @@
#ifndef SRC_LIBSLIC3R_SUPPORTABLEISSUESSEARCH_HPP_
#define SRC_LIBSLIC3R_SUPPORTABLEISSUESSEARCH_HPP_
/*
#include "Layer.hpp"
#include "Line.hpp"
#include "PrintBase.hpp"
@ -9,6 +9,7 @@
#include <cstddef>
#include <vector>
namespace Slic3r {
namespace SupportSpotsGenerator {
@ -42,8 +43,9 @@ struct Params
BrimType brim_type;
const float brim_width;
const std::pair<float,float> malformation_distance_factors = std::pair<float, float> { 0.5, 1.1 };
const std::pair<float,float> malformation_distance_factors = std::pair<float, float> { 0.33, 0.7 };
const float max_curled_height_factor = 10.0f;
const float curling_tolerance_limit = 0.1f;
const float min_distance_between_support_points = 3.0f; //mm
const float support_points_interface_radius = 1.5f; // mm
@ -77,6 +79,9 @@ struct Params
}
};
void estimate_malformations(std::vector<Layer *> &layers, const Params &params);
enum class SupportPointCause {
LongBridge, // point generated on bridge and straight perimeter extrusion longer than the allowed length
FloatingBridgeAnchor, // point generated on unsupported bridge endpoint
@ -97,7 +102,7 @@ enum class SupportPointCause {
// between forces that destabilize the object (extruder conflicts with curled filament, weight if instable center of mass, bed movements etc)
// and forces that stabilize the object (bed adhesion, other support spots adhesion, weight if stable center of mass).
// Note that the force is only the difference - the amount needed to stabilize the object again.
struct SupportPoint
/*struct SupportPoint
{
SupportPoint(SupportPointCause cause, const Vec3f &position, float force, float spot_radius, const Vec2f &direction)
: cause(cause), position(position), force(force), spot_radius(spot_radius), direction(direction)
@ -147,13 +152,12 @@ using PartialObjects = std::vector<PartialObject>;
std::tuple<SupportPoints, PartialObjects> full_search(const PrintObject *po, const PrintTryCancel& cancel_func, const Params &params);
void estimate_supports_malformations(std::vector<SupportLayer *> &layers, float supports_flow_width, const Params &params);
void estimate_malformations(std::vector<Layer *> &layers, const Params &params);
// NOTE: the boolean marks if the issue is critical or not for now.
std::vector<std::pair<SupportPointCause, bool>> gather_issues(const SupportPoints &support_points,
PartialObjects &partial_objects);
}} // namespace Slic3r::SupportSpotsGenerator
*/
}} // namespace Slic3r::SupportSpotsGenerator
#endif /* SRC_LIBSLIC3R_SUPPORTABLEISSUESSEARCH_HPP_ */