mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 00:31:11 -06:00
3D object positioning
This commit is contained in:
parent
a82f95e903
commit
fcfb3b98bc
16 changed files with 217 additions and 91 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue