mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 15:13:58 -06:00
Out of bed detection - 1st installment
This commit is contained in:
parent
83a2d2af4b
commit
bdd2d725c8
15 changed files with 689 additions and 188 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue