mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-01 17:42:44 +00:00
3D object positioning
This commit is contained in:
@@ -184,4 +184,18 @@ Line::to_SV_pureperl() const {
|
||||
}
|
||||
#endif
|
||||
|
||||
Pointf3
|
||||
Linef3::intersect_plane(double z) const
|
||||
{
|
||||
return Pointf3(
|
||||
this->a.x + (this->b.x - this->a.x) * (z - this->a.z) / (this->b.z - this->a.z),
|
||||
this->a.y + (this->b.y - this->a.y) * (z - this->a.z) / (this->b.z - this->a.z),
|
||||
z
|
||||
);
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
REGISTER_CLASS(Linef3, "Linef3");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
namespace Slic3r {
|
||||
|
||||
class Line;
|
||||
class Linef3;
|
||||
class Polyline;
|
||||
|
||||
class Line
|
||||
@@ -46,6 +47,22 @@ class Line
|
||||
|
||||
typedef std::vector<Line> Lines;
|
||||
|
||||
class Linef3
|
||||
{
|
||||
public:
|
||||
Pointf3 a;
|
||||
Pointf3 b;
|
||||
Linef3() {};
|
||||
explicit Linef3(Pointf3 _a, Pointf3 _b): a(_a), b(_b) {};
|
||||
Pointf3 intersect_plane(double z) const;
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
void from_SV(SV* line_sv);
|
||||
void from_SV_check(SV* line_sv);
|
||||
SV* to_SV_pureperl() const;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// start Boost
|
||||
|
||||
Reference in New Issue
Block a user