sreiter / stl_reader

One header C++ library to load ascii and binary stl ('stereolithography') geometry files
BSD 2-Clause "Simplified" License
122 stars 28 forks source link

How about reading from memory? #11

Open msnh2012 opened 1 year ago

msnh2012 commented 1 year ago

Nice work bro. How about reading from memory?

sreiter commented 1 year ago

Thanks for the nice words :). With a rather small refactoring, this should very well be possible, e.g., by providing an overload of ReadStlFile_... which takes an std::istream. The current file based overloads could then simply handle file loading and forward their streams to those new overloads.

However, personally I didn't encounter the use case yet... would you mind sharing yours?

msnh2012 commented 1 year ago

Yep, here is my case. I want to encode the STL file with a key, which needs to be read from memory when decoding.