From 61cc28f8b2a80edbf34e832a5b35fdebd449077b Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Thu, 27 Jan 2022 13:20:35 -0500 Subject: [PATCH] Check for text STL when linking (#1197) * Check for text STL when linking * Use memcmp in STL import when checking for ASCII format * Add message box for unsupported STL file type. Co-authored-by: ruevs --- src/importmesh.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/importmesh.cpp b/src/importmesh.cpp index 7b5bf43..f06a8f1 100644 --- a/src/importmesh.cpp +++ b/src/importmesh.cpp @@ -130,6 +130,13 @@ bool LinkStl(const Platform::Path &filename, EntityList *el, SMesh *m, SShell *s char str[80] = {}; f.read(str, 80); + if(0==memcmp("solid", str, 5)) { + // just returning false will trigger the warning that linked file is not present + // best solution is to add an importer for text STL. + Message(_("Text-formated STL files are not currently supported")); + return false; + } + uint32_t n; uint32_t color;