From afa8501d20c56b9e9466c155423d59b78baabcc4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 22 Sep 2023 07:51:58 -0400 Subject: [PATCH] recognize STL files starting with "solid binary" as binary files --- src/create_atoms.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index cdd290772e..75c30bd0b8 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -1055,6 +1055,9 @@ void CreateAtoms::add_mesh(const char *filename) throw TokenizerException("Invalid STL mesh file format", ""); line += 6; + if (utils::strmatch(line, "^binary")) + throw TokenizerException("Invalid STL mesh file format", ""); + if (comm->me == 0) utils::logmesg(lmp, "Reading STL object {} from text file {}\n", utils::trim(line), filename);