diff --git a/xs/src/slic3r/GUI/3DScene.cpp b/xs/src/slic3r/GUI/3DScene.cpp index 0fa31ee508..d836866e23 100644 --- a/xs/src/slic3r/GUI/3DScene.cpp +++ b/xs/src/slic3r/GUI/3DScene.cpp @@ -293,12 +293,12 @@ void GLVolume::set_convex_hull(const TriangleMesh& convex_hull) m_convex_hull = &convex_hull; } -Transform3d GLVolume::world_matrix() const +Transform3f GLVolume::world_matrix() const { - Transform3d matrix = Transform3d::Identity(); - matrix.translate(m_origin); - matrix.rotate(Eigen::AngleAxisd((double)m_angle_z, Vec3d::UnitZ())); - matrix.scale((double)m_scale_factor); + Transform3f matrix = Transform3f::Identity(); + matrix.translate(Vec3f((float)m_origin(0), (float)m_origin(1), (float)m_origin(2))); + matrix.rotate(Eigen::AngleAxisf(m_angle_z, Vec3f::UnitZ())); + matrix.scale(m_scale_factor); return matrix; } @@ -306,7 +306,7 @@ BoundingBoxf3 GLVolume::transformed_bounding_box() const { if (m_transformed_bounding_box_dirty) { - m_transformed_bounding_box = bounding_box.transformed(world_matrix()); + m_transformed_bounding_box = bounding_box.transformed(world_matrix().cast()); m_transformed_bounding_box_dirty = false; } @@ -318,9 +318,9 @@ BoundingBoxf3 GLVolume::transformed_convex_hull_bounding_box() const if (m_transformed_convex_hull_bounding_box_dirty) { if ((m_convex_hull != nullptr) && (m_convex_hull->stl.stats.number_of_facets > 0)) - m_transformed_convex_hull_bounding_box = m_convex_hull->transformed_bounding_box(world_matrix()); + m_transformed_convex_hull_bounding_box = m_convex_hull->transformed_bounding_box(world_matrix().cast()); else - m_transformed_convex_hull_bounding_box = bounding_box.transformed(world_matrix()); + m_transformed_convex_hull_bounding_box = bounding_box.transformed(world_matrix().cast()); m_transformed_convex_hull_bounding_box_dirty = false; } @@ -818,10 +818,7 @@ bool GLVolumeCollection::check_outside_state(const DynamicPrintConfig* config, M return false; BoundingBox bed_box_2D = get_extents(Polygon::new_scale(opt->values)); -//############################################################################################################################################ - BoundingBoxf3 print_volume(unscale(bed_box_2D.min(0), bed_box_2D.min(1), 0.0), unscale(bed_box_2D.max(0), bed_box_2D.max(1), config->opt_float("max_print_height"))); -// BoundingBoxf3 print_volume(unscale(bed_box_2D.min(0), bed_box_2D.min(1), 0.0), unscale(bed_box_2D.max(0), bed_box_2D.max(1), unscale(config->opt_float("max_print_height")))); -//############################################################################################################################################ + BoundingBoxf3 print_volume(Vec3d(unscale(bed_box_2D.min(0)), unscale(bed_box_2D.min(1)), 0.0), Vec3d(unscale(bed_box_2D.max(0)), unscale(bed_box_2D.max(1)), config->opt_float("max_print_height"))); // Allow the objects to protrude below the print bed print_volume.min(2) = -1e10; diff --git a/xs/src/slic3r/GUI/3DScene.hpp b/xs/src/slic3r/GUI/3DScene.hpp index ac3a53fe3b..1fbd958a84 100644 --- a/xs/src/slic3r/GUI/3DScene.hpp +++ b/xs/src/slic3r/GUI/3DScene.hpp @@ -333,7 +333,7 @@ public: int volume_idx() const { return (this->composite_id / 1000) % 1000; } int instance_idx() const { return this->composite_id % 1000; } - Transform3d world_matrix() const; + Transform3f world_matrix() const; BoundingBoxf3 transformed_bounding_box() const; BoundingBoxf3 transformed_convex_hull_bounding_box() const; diff --git a/xs/src/slic3r/GUI/GLCanvas3D.cpp b/xs/src/slic3r/GUI/GLCanvas3D.cpp index a155769a57..d32c07b66d 100644 --- a/xs/src/slic3r/GUI/GLCanvas3D.cpp +++ b/xs/src/slic3r/GUI/GLCanvas3D.cpp @@ -3625,7 +3625,7 @@ BoundingBoxf3 GLCanvas3D::_selected_volumes_bounding_box() const bb.merge(volume->bounding_box); } - bb = bb.transformed(selected_volumes[0]->world_matrix()); + bb = bb.transformed(selected_volumes[0]->world_matrix().cast()); } else {