Avoid cross perimeter improvements ported from BBS (#10220)

* FIX: fix avoid crossing perimeters not work[github issue #6597]

jira: STUDIO-11682

github: #6597

Change-Id: Ib86fac93280504e0040f1cce44dad4d02f709c01
(cherry picked from commit 35afceb9a7f4e5a3baba97f054d0e6768e4f59cf)

* FIX: optimize avoid crossing wall

jira: STUDIO-11682

Change-Id: I49b6756a5d3aeb482c019813074d8f6f9cc3c6ef
(cherry picked from commit e9b7006db994d78b9153dedfd0f89447c941cb76)

* Sync with latest BBS code

---------

Co-authored-by: huicong.li <huicong.li@bambulab.com>
This commit is contained in:
Noisyfox
2025-07-30 21:42:39 +08:00
committed by GitHub
parent c86eb27675
commit 282cdd111a
3 changed files with 195 additions and 108 deletions

View File

@@ -17,6 +17,7 @@ class AvoidCrossingPerimeters
public:
// Routing around the objects vs. inside a single object.
void use_external_mp(bool use = true) { m_use_external_mp = use; };
bool used_external_mp() { return m_use_external_mp; }
void use_external_mp_once() { m_use_external_mp_once = true; }
bool used_external_mp_once() { return m_use_external_mp_once; }
void disable_once() { m_disabled_once = true; }
@@ -62,7 +63,7 @@ private:
ExPolygons m_lslices_offset;
std::vector<BoundingBox> m_lslices_offset_bboxes;
// Used for detection of line or polyline is inside of any polygon.
EdgeGrid::Grid m_grid_lslices_offset;
EdgeGrid::Grid m_grid_lslice;
// Store all needed data for travels inside object
Boundary m_internal;
// Store all needed data for travels outside object