From 99a08efc9c983f1e9ac5efe2375c3a0045cad1a8 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Tue, 27 Feb 2024 13:51:16 +0100 Subject: [PATCH] Disallow import of 3mf without mesh, which are not produced by PrusaSlic3r --- src/libslic3r/Format/3mf.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index 0f9c3858ad..e84ee5b4d5 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -1000,8 +1000,12 @@ namespace Slic3r { } } -// // fixes the min z of the model if negative -// model.adjust_min_z(); + // We support our 3mf contains only configuration without mesh, + // others MUST contain mesh (triangles and vertices). + if (!m_prusaslicer_generator_version.has_value() && model.objects.empty()) { + const std::string msg = (boost::format(_u8L("3mf File (\"%1%\") do not contain valid mesh.")) % filename).str(); + throw Slic3r::RuntimeError(msg); + } return true; }