MCPcopy Create free account
hub / github.com/cogentcore/core / DecodeFile

Function DecodeFile

xyz/io.go:64–70  ·  view source on GitHub ↗

DecodeFile decodes the given file using a decoder based on the file extension. Returns decoder instance with full decoded state. Supported formats include: .obj = Wavefront OBJ format, including associated materials (.mtl) which must have same name as .obj, or a default material is used.

(fname string)

Source from the content-addressed store, hash-verified

62//
63// must have same name as .obj, or a default material is used.
64func DecodeFile(fname string) (Decoder, error) {
65 dfs, fnm, err := fsx.DirFS(fname)
66 if err != nil {
67 return nil, err
68 }
69 return DecodeFileFS(dfs, fnm)
70}
71
72// DecodeFileFS decodes the given file from the given filesystem using a decoder based on the file
73// extension. Returns decoder instance with full decoded state.

Callers

nothing calls this directly

Calls 2

DirFSFunction · 0.92
DecodeFileFSFunction · 0.85

Tested by

no test coverage detected