mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
CalibUtils: Center mesh models (#13252)
This commit is contained in:
@@ -458,8 +458,14 @@ static void read_model_from_file(const std::string& input_file, Model& model)
|
|||||||
&is_bbl_3mf, &file_version, nullptr, nullptr, nullptr, plate_to_slice);
|
&is_bbl_3mf, &file_version, nullptr, nullptr, nullptr, plate_to_slice);
|
||||||
|
|
||||||
model.add_default_instances();
|
model.add_default_instances();
|
||||||
for (auto object : model.objects)
|
|
||||||
object->ensure_on_bed();
|
const std::string extension = fs::path(input_file).extension().string();
|
||||||
|
const bool is_project_file = extension == ".3mf" || extension == ".3MF" || extension == ".amf" || extension == ".AMF";
|
||||||
|
for (auto object : model.objects) {
|
||||||
|
if (!is_project_file)
|
||||||
|
object->center_around_origin(false);
|
||||||
|
object->ensure_on_bed(is_project_file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<Vec3d, 4> get_cut_plane_points(const BoundingBoxf3 &bbox, const double &cut_height)
|
std::array<Vec3d, 4> get_cut_plane_points(const BoundingBoxf3 &bbox, const double &cut_height)
|
||||||
|
|||||||
Reference in New Issue
Block a user