diff --git a/EgtExchange.rc b/EgtExchange.rc index a49b26f..8453f7f 100644 Binary files a/EgtExchange.rc and b/EgtExchange.rc differ diff --git a/ImportStl.cpp b/ImportStl.cpp index 6555720..61243a9 100644 --- a/ImportStl.cpp +++ b/ImportStl.cpp @@ -55,18 +55,22 @@ ImportStl::StlType( const std::string& sFile) if ( InFile.fail()) return STL_ERROR ; - // lettura dei primi ottanta byte - char cBuff[81] ; - InFile.read( cBuff, 80) ; + // lettura dei primi 256 byte + char cBuff[256] ; + InFile.read( cBuff, 255) ; cBuff[InFile.gcount()] = '\0' ; // chiusura del file InFile.close() ; - // verifico se iniziano con "solid" + // verifico se iniziano con "solid" e poi "facet" e "normal" string sBuff = cBuff ; - size_t nPos = sBuff.find( "solid") ; - if ( nPos != string::npos && nPos < 10) + size_t nPosS = sBuff.find( "solid") ; + size_t nPosF = sBuff.find( "facet") ; + size_t nPosN = sBuff.find( "normal") ; + if ( nPosS != string::npos && nPosS < 10 && + nPosF != string::npos && + nPosN != string::npos) return STL_ASCII ; else return STL_BINARY ;