mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
ENH: optimize bridge detect to choose short direction
For some corner case, the bridge detect may choose the long distance rathan than the short distance. Calculate the percentage of archored lines and choose the shortest length Signed-off-by: salt.wei <salt.wei@bambulab.com> Change-Id: Ia74842f3135681373f649a014c270a1b9d1755e7
This commit is contained in:
parent
1c02449201
commit
14417bf176
2 changed files with 10 additions and 4 deletions
|
@ -44,15 +44,16 @@ private:
|
|||
void initialize();
|
||||
|
||||
struct BridgeDirection {
|
||||
BridgeDirection(double a = -1.) : angle(a), coverage(0.), max_length(0.) {}
|
||||
BridgeDirection(double a = -1.) : angle(a), coverage(0.), max_length(0.), archored_percent(0.){}
|
||||
// the best direction is the one causing most lines to be bridged (thus most coverage)
|
||||
bool operator<(const BridgeDirection &other) const {
|
||||
// Initial sort by coverage only - comparator must obey strict weak ordering
|
||||
return this->coverage > other.coverage;
|
||||
return this->archored_percent > other.archored_percent;
|
||||
};
|
||||
double angle;
|
||||
double coverage;
|
||||
double max_length;
|
||||
double archored_percent;
|
||||
};
|
||||
|
||||
// Get possible briging direction candidates.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue