mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Use radians everywhere, including ModelInstance::rotation
This commit is contained in:
@@ -485,7 +485,7 @@ ModelObject::center_around_origin()
|
||||
// apply rotation and scaling to vector as well before translating instance,
|
||||
// in order to leave final position unaltered
|
||||
Vectorf3 v = vector.negative();
|
||||
v.rotate(Slic3r::Geometry::deg2rad((*i)->rotation), (*i)->offset);
|
||||
v.rotate((*i)->rotation, (*i)->offset);
|
||||
v.scale((*i)->scaling_factor);
|
||||
(*i)->offset.translate(v.x, v.y);
|
||||
}
|
||||
@@ -523,9 +523,6 @@ ModelObject::scale(const Pointf3 &versor)
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class ModelInstance
|
||||
{
|
||||
friend class ModelObject;
|
||||
public:
|
||||
double rotation; // around mesh center point
|
||||
double rotation; // in radians around mesh center point
|
||||
double scaling_factor;
|
||||
Pointf offset; // in unscaled coordinates
|
||||
|
||||
|
||||
@@ -202,6 +202,9 @@ void TriangleMesh::translate(float x, float y, float z)
|
||||
|
||||
void TriangleMesh::rotate(float angle, const Axis &axis)
|
||||
{
|
||||
// admesh uses degrees
|
||||
angle = Slic3r::Geometry::rad2deg(angle);
|
||||
|
||||
if (axis == X) {
|
||||
stl_rotate_x(&(this->stl), angle);
|
||||
} else if (axis == Y) {
|
||||
|
||||
Reference in New Issue
Block a user