ENH: optimize speed of exporting gcode

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: I70caed8664a647a98a0434dd62d329977e0feaaa
This commit is contained in:
salt.wei 2022-11-16 20:57:41 +08:00 committed by Lane.Wei
parent 4e43ad8c2a
commit 58bed3e60d

View file

@ -92,6 +92,12 @@ bool ExPolygon::contains(const Line &line) const
bool ExPolygon::contains(const Polyline &polyline) const
{
BoundingBox bbox1 = get_extents(*this);
BoundingBox bbox2 = get_extents(polyline);
bbox2.inflated(1);
if (!bbox1.overlap(bbox2))
return false;
return diff_pl(polyline, *this).empty();
}