byuflowlab / VSPGeom.jl

A Julia package to import geometry created using OpenVSP into Julia
https://flow.byu.edu/VSPGeom.jl/
MIT License
4 stars 0 forks source link

Binary STL files #2

Open cibinjoseph opened 6 months ago

cibinjoseph commented 6 months ago

readSTL only handles ASCII format. Add provision to handle binary STL files

ramcdona commented 6 months ago

FYI - OpenVSP can read binary STL files (might be a resource for you to look into here). However, OpenVSP does not write them.

Binary STL files do not support the non-standard multi-part tagging that OpenVSP (and many other tools) use.

Speaking of non-standard STL files, technically, the STL standard only allows positive coordinate values, so everything must be shifted to exist in the +x,+y,+z octant. Many programs ignore this.

cibinjoseph commented 6 months ago

Thanks Rob! That OpenVSP function will definitely come useful. I was using Paraview to convert binary STL files to ASCII as a workaround till now. I did not know about the positive-coordinates-only rule. Thanks for that too!

ramcdona commented 6 months ago

No worries. Almost everyone ignores the positive only on read. Some programs silently obey it on export -- which is a pain if you expect different STL files to import with some sort of known spatial reference.