Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
*.jl.mem
Manifest.toml
*.db
.vscode/
.DS_Store
*.md
13 changes: 12 additions & 1 deletion src/MeshIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ include("io/2dm.jl")
include("io/msh.jl")
include("io/gts.jl")
include("io/ifs.jl")
include("io/nas.jl")

# Register NAS format with FileIO for automatic detection by extension
# Since NAS has no magic header, we use empty magic bytes
FileIO.add_format(:NAS, UInt8[], ".nas")


# Add a convenience function for loading NAS files with the same interface as other formats

"""
load(fn::File{MeshFormat}; pointtype=Point3f, uvtype=Vec2f,
Expand All @@ -25,7 +33,10 @@ include("io/ifs.jl")
"""
function load(fn::File{format}; element_types...) where {format}
open(fn) do s
skipmagic(s)
# NAS format has no magic header, so skip skipmagic for it
if format != format"NAS"
skipmagic(s)
end
load(s; element_types...)
end
end
Expand Down
Loading
Loading