Skip to content

Commit 61cc28f

Browse files
phkahlerruevs
andauthored
Check for text STL when linking (solvespace#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 <[email protected]>
1 parent 859df9f commit 61cc28f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/importmesh.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ bool LinkStl(const Platform::Path &filename, EntityList *el, SMesh *m, SShell *s
130130
char str[80] = {};
131131
f.read(str, 80);
132132

133+
if(0==memcmp("solid", str, 5)) {
134+
// just returning false will trigger the warning that linked file is not present
135+
// best solution is to add an importer for text STL.
136+
Message(_("Text-formated STL files are not currently supported"));
137+
return false;
138+
}
139+
133140
uint32_t n;
134141
uint32_t color;
135142

0 commit comments

Comments
 (0)