Comments (4)
You file is an "edge case", because according to the description of the STL format, binary files cannot begin with the word "solid" in their header:
Reading the file we can see that its header starts with the word "solid":
julia> io = open("3DBenchy.stl");
julia> String(read(io, 80))
"solid Shape0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
julia> close(io)
I think we can support this edge case in future versions of GeoIO.jl. However, for now, you can run this code to generate a new, valid version of your file:
open("3DBenchyFIXED.stl", write=true) do io_new
foreach(_ -> write(io_new, 0x00), 1:80) # empty header
open("3DBenchy.stl") do io_old
skip(io_old, 80) # skip header
write(io_new, read(io_old))
end
end
julia> GeoIO.load("3DBenchyFIXED.stl")
225706×2 GeoTable over 225706 SimpleMesh
┌────────────────────────────────────────────┬──────────────────────────────────
│ NORMAL │ ⋯
│ Unknown │ ⋯
│ [NoUnits] │ ⋯
├────────────────────────────────────────────┼──────────────────────────────────
│ (-0.996917 m, 0.0 m, 0.0784591 m) │ Triangle((x: 6.622 m, y: -1.25 ⋯
│ (-0.996917 m, 0.0 m, 0.0784591 m) │ Triangle((x: 6.622 m, y: -1.25 ⋯
│ (-0.996917 m, 1.34498f-15 m, 0.0784591 m) │ Triangle((x: 6.597 m, y: -1.20 ⋯
│ (-0.996917 m, -1.1773f-15 m, 0.0784591 m) │ Triangle((x: 6.605 m, y: -1.23 ⋯
│ (-0.996917 m, 2.22926f-16 m, 0.0784591 m) │ Triangle((x: 6.622 m, y: 0.0 m ⋯
│ (-0.996917 m, -1.61398f-15 m, 0.0784591 m) │ Triangle((x: 6.575 m, y: -1.099 ⋯
│ (-0.996917 m, -1.75022f-15 m, 0.0784591 m) │ Triangle((x: 6.582 m, y: -1.143 ⋯
│ (-0.996917 m, 1.87249f-15 m, 0.0784591 m) │ Triangle((x: 6.622 m, y: 0.0 m ⋯
│ (-0.996917 m, -4.26202f-15 m, 0.0784591 m) │ Triangle((x: 6.556 m, y: -0.927 ⋯
│ (-0.996917 m, -2.16594f-16 m, 0.0784591 m) │ Triangle((x: 6.562 m, y: -0.99 ⋯
│ (-0.996917 m, 2.3476f-15 m, 0.0784591 m) │ Triangle((x: 6.622 m, y: 0.0 m, ⋯
│ (-0.996917 m, -2.44542f-16 m, 0.0784591 m) │ Triangle((x: 6.541 m, y: -0.702 ⋯
│ (-0.996917 m, 1.18079f-15 m, 0.0784591 m) │ Triangle((x: 6.546 m, y: -0.782 ⋯
│ (-0.996917 m, 4.91879f-15 m, 0.0784591 m) │ Triangle((x: 6.622 m, y: 0.0 m, ⋯
│ (-0.996917 m, -6.60613f-15 m, 0.0784591 m) │ Triangle((x: 6.53 m, y: -0.438 ⋯
│ (-0.996917 m, -1.04105f-15 m, 0.0784591 m) │ Triangle((x: 6.533 m, y: -0.53 ⋯
│ ⋮ │ ⋱
└────────────────────────────────────────────┴──────────────────────────────────
1 column and 225690 rows omitted
from geoio.jl.
@roflmaostc, in v1.13.4, you can load the original file without modifications.
from geoio.jl.
Cool, great :)!
from geoio.jl.
The file I used in the standard Benchy, so nothing very fancy:
https://www.3dbenchy.com/download/
from geoio.jl.
Related Issues (20)
- Review load/save of jpg, png,... images
- Missing file formats
- Reduce pre-compilation time
- Allow saving subdomain in VTK formats HOT 1
- Add CSV format with centroid coordinates HOT 1
- Read GeoTiff with adequate projection and numeric values HOT 4
- Loading CSV with missing coordinates
- Improve STL tests
- Add support for Feather format HOT 1
- Cannot save geotable with empty `values` HOT 2
- Missing file formats
- Split runtests.jl in multiple files
- Load/save CRS information
- move GeoInterface conversions to a separate lightweight package HOT 5
- GeoTable from NaturalEarth has wrong unit HOT 3
- Get rid of GDAL
- Add `lenunit` option to `GeoIO.load` HOT 4
- Use `clamp` to load invalid `LatLon` coordinates from files
- Consider coercing the variables of GeoTIFF to Continuous HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geoio.jl.