3D object positioning

This commit is contained in:
Alessandro Ranellucci 2014-12-16 01:12:37 +01:00
parent a82f95e903
commit fcfb3b98bc
16 changed files with 217 additions and 91 deletions

View file

@ -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
}