mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Ported ModelObject::rotate() and ModelObject::flip() to XS, as well as axes constants
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "Model.hpp"
|
||||
#include "Geometry.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
@@ -514,6 +515,29 @@ ModelObject::scale(const Pointf3 &versor)
|
||||
this->invalidate_bounding_box();
|
||||
}
|
||||
|
||||
void
|
||||
ModelObject::rotate(float angle, const Axis &axis)
|
||||
{
|
||||
// we accept angle in radians but mesh currently uses degrees
|
||||
angle = Slic3r::Geometry::rad2deg(angle);
|
||||
|
||||
for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) {
|
||||
(*v)->mesh.rotate(angle, axis);
|
||||
}
|
||||
this->origin_translation = Pointf3(0,0,0);
|
||||
this->invalidate_bounding_box();
|
||||
}
|
||||
|
||||
void
|
||||
ModelObject::flip(const Axis &axis)
|
||||
{
|
||||
for (ModelVolumePtrs::const_iterator v = this->volumes.begin(); v != this->volumes.end(); ++v) {
|
||||
(*v)->mesh.flip(axis);
|
||||
}
|
||||
this->origin_translation = Pointf3(0,0,0);
|
||||
this->invalidate_bounding_box();
|
||||
}
|
||||
|
||||
size_t
|
||||
ModelObject::materials_count() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user