mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-07-03 17:05:43 +02:00
Out of bed detection - 1st installment
This commit is contained in:
@@ -94,6 +94,38 @@ public:
|
||||
void translate(const Pointf3 &pos) { this->translate(pos.x, pos.y, pos.z); }
|
||||
void offset(coordf_t delta);
|
||||
PointClass center() const;
|
||||
|
||||
bool contains(const PointClass &point) const {
|
||||
return BoundingBoxBase<PointClass>::contains(point) && point.z >= this->min.z && point.z <= this->max.z;
|
||||
}
|
||||
|
||||
bool contains(const BoundingBox3Base<PointClass>& other) const {
|
||||
if (!contains(other.min))
|
||||
return false;
|
||||
|
||||
if (!contains(PointClass(other.max.x, other.min.y, other.min.z)))
|
||||
return false;
|
||||
|
||||
if (!contains(PointClass(other.max.x, other.max.y, other.min.z)))
|
||||
return false;
|
||||
|
||||
if (!contains(PointClass(other.min.x, other.max.y, other.min.z)))
|
||||
return false;
|
||||
|
||||
if (!contains(PointClass(other.min.x, other.min.y, other.max.z)))
|
||||
return false;
|
||||
|
||||
if (!contains(PointClass(other.max.x, other.min.y, other.max.z)))
|
||||
return false;
|
||||
|
||||
if (!contains(other.max))
|
||||
return false;
|
||||
|
||||
if (!contains(PointClass(other.min.x, other.max.y, other.max.z)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BoundingBox : public BoundingBoxBase<Point>
|
||||
|
||||
Reference in New Issue
Block a user