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 <dpr@ruevs.com>
pull/1201/head
phkahler 2022-01-27 13:20:35 -05:00 committed by GitHub
parent 859df9f43d
commit 61cc28f8b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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;