mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
Use radians everywhere, including ModelInstance::rotation
This commit is contained in:
parent
79ce094e3a
commit
0d01348acc
4 changed files with 10 additions and 10 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue