Code cleanup

This commit is contained in:
Enrico Turri 2018-09-13 16:08:19 +02:00
parent af19713a27
commit 3faaff85d5
14 changed files with 2 additions and 164 deletions

View file

@ -517,17 +517,13 @@ ShapeData2D projectModelFromTop(const Slic3r::Model &model) {
if(item.vertexCount() > 3) {
item.rotation(objinst->rotation);
item.translation( {
//################################################################################################################################
#if ENABLE_MODELINSTANCE_3D_OFFSET
ClipperLib::cInt(objinst->get_offset(X) / SCALING_FACTOR),
ClipperLib::cInt(objinst->get_offset(Y) / SCALING_FACTOR)
#else
//################################################################################################################################
ClipperLib::cInt(objinst->offset(0)/SCALING_FACTOR),
ClipperLib::cInt(objinst->offset(1)/SCALING_FACTOR)
//################################################################################################################################
#endif // ENABLE_MODELINSTANCE_3D_OFFSET
//################################################################################################################################
});
ret.emplace_back(objinst, item);
}
@ -664,27 +660,19 @@ void applyResult(
// appropriately
auto off = item.translation();
Radians rot = item.rotation();
//################################################################################################################################
#if ENABLE_MODELINSTANCE_3D_OFFSET
Vec3d foff(off.X*SCALING_FACTOR + batch_offset, off.Y*SCALING_FACTOR, 0.0);
#else
//################################################################################################################################
Vec2d foff(off.X*SCALING_FACTOR + batch_offset, off.Y*SCALING_FACTOR);
//################################################################################################################################
#endif // ENABLE_MODELINSTANCE_3D_OFFSET
//################################################################################################################################
// write the tranformation data into the model instance
inst_ptr->rotation = rot;
//################################################################################################################################
#if ENABLE_MODELINSTANCE_3D_OFFSET
inst_ptr->set_offset(foff);
#else
//################################################################################################################################
inst_ptr->offset = foff;
//################################################################################################################################
#endif // ENABLE_MODELINSTANCE_3D_OFFSET
//################################################################################################################################
}
}