1st installment of ModelInstance 3D scale components

This commit is contained in:
Enrico Turri
2018-09-24 15:54:09 +02:00
parent e3d44b07fe
commit 0e1843a871
26 changed files with 558 additions and 9 deletions
+6
View File
@@ -1270,9 +1270,11 @@ namespace Slic3r {
if ((sx == 0.0) || (sy == 0.0) || (sz == 0.0))
return;
#if !ENABLE_MODELINSTANCE_3D_SCALE
// non-uniform scale value, return
if ((std::abs(sx - sy) > 0.00001) || (std::abs(sx - sz) > 0.00001))
return;
#endif // !ENABLE_MODELINSTANCE_3D_SCALE
double inv_sx = 1.0 / sx;
double inv_sy = 1.0 / sy;
@@ -1303,7 +1305,11 @@ namespace Slic3r {
instance.offset(0) = offset_x;
instance.offset(1) = offset_y;
#endif // ENABLE_MODELINSTANCE_3D_OFFSET
#if ENABLE_MODELINSTANCE_3D_SCALE
instance.set_scaling_factor(Vec3d(sx, sy, sz));
#else
instance.scaling_factor = sx;
#endif // ENABLE_MODELINSTANCE_3D_SCALE
#if ENABLE_MODELINSTANCE_3D_ROTATION
instance.set_rotation(rotation);
#else