{"id":16711087,"url":"https://github.com/w0rm/elm-obj-file","last_synced_at":"2025-10-07T12:41:12.868Z","repository":{"id":49999100,"uuid":"280945518","full_name":"w0rm/elm-obj-file","owner":"w0rm","description":"Encode and decode 3D geometry in the OBJ file format","archived":false,"fork":false,"pushed_at":"2024-03-30T11:59:56.000Z","size":3382,"stargazers_count":26,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T20:13:08.497Z","etag":null,"topics":["3d","elm","wavefront-obj"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/w0rm/elm-obj-file/latest","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/w0rm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"w0rm"}},"created_at":"2020-07-19T20:32:01.000Z","updated_at":"2024-12-20T08:12:48.000Z","dependencies_parsed_at":"2024-03-30T12:46:32.774Z","dependency_job_id":null,"html_url":"https://github.com/w0rm/elm-obj-file","commit_stats":{"total_commits":103,"total_committers":2,"mean_commits":51.5,"dds":0.3203883495145631,"last_synced_commit":"2d44d72bc81ea328ff4540619d8fc0273844dcac"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w0rm%2Felm-obj-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w0rm%2Felm-obj-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w0rm%2Felm-obj-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w0rm%2Felm-obj-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w0rm","download_url":"https://codeload.github.com/w0rm/elm-obj-file/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244866231,"owners_count":20523484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","elm","wavefront-obj"],"created_at":"2024-10-12T20:10:43.970Z","updated_at":"2025-10-07T12:41:07.848Z","avatar_url":"https://github.com/w0rm.png","language":"Elm","funding_links":["https://github.com/sponsors/w0rm"],"categories":[],"sub_categories":[],"readme":"# elm-obj-file\n\nAn Elm package to encode and decode 3D geometry in the [OBJ file format](https://en.wikipedia.org/wiki/Wavefront_.obj_file). Meshes are returned as [`TriangularMesh`](https://package.elm-lang.org/packages/ianmackenzie/elm-triangular-mesh/latest) values, which makes them easy to render with [elm-3d-scene](https://package.elm-lang.org/packages/ianmackenzie/elm-3d-scene/latest) but can also be used with any other 3D graphics system. You could even take the geometric data and use it for 3D printing, [physics simulations](https://package.elm-lang.org/packages/w0rm/elm-physics/latest/), [finite element analysis](https://en.wikipedia.org/wiki/Finite_element_method) or whatever other crazy thing you want to do =)\n\n![The “Pod” model by Kolja Wilcke](https://unsoundscapes.com/elm-obj-file/examples/pod.png)\n\n_The “Pod” model by [@01k](https://mobile.twitter.com/01k) rendered with `elm-3d-scene`. [See it live here](https://unsoundscapes.com/elm-obj-file/examples/pod/)._\n\nMake sure to check [the viewer example](https://unsoundscapes.com/elm-obj-file/examples/viewer/) that lets you preview OBJ files.\n\nThe examples source code [can be found here](https://github.com/w0rm/elm-obj-file/tree/main/examples).\n\n```elm\n{-| Load a mesh from an HTTP request. -}\ngetMesh : Cmd Msg\ngetMesh =\n    Http.get\n        { url = \"Pod.obj.txt\"\n        , expect =\n            Obj.Decode.expectObj GotMesh\n                Length.centimeters\n                Obj.Decode.texturedFaces\n        }\n```\n\n_Note the .txt extension: this is currently required to serve files from `elm reactor`._\n\n## Blender Workflow\n\nTo export an OBJ file from Blender choose `File - Export - Wavefront (.obj)`. We recommend the following settings:\n\n- **Include:** only check “Objects as OBJ Objects”;\n- **Transform:** use scale `1.00`, “Y Forward” and “Z Up” to match the Blender coordinate system;\n- **Geometry:** only check “Apply Modifiers”, check “Write Normals” for `Obj.Decode.faces` and `Obj.Decode.texturedFaces`, “Include UVs” for `Obj.Decode.texturedTriangles` and `Obj.Decode.texturedFaces`, optionally check “Write Materials” if you want to decode material names.\n\nBlender collections are not preserved in OBJ groups. To decode individual meshes from the same file, you should rely on the `object` filter. The object name, that Blender produces, is a concatenation of the corresponding object and geometry. For example, the “Pod Body” object that contains “Mesh.001” can be decoded with `Obj.Decode.object \"Pod_Body_Mesh.001\"`.\n\nIf you want to use the shadow generation functionality from `elm-3d-scene`, your mesh needs to be watertight. Blender has the 3D Print Toolbox add-on, that lets you detect non manifold edges and fix them by clicking the “Make Manifold” button.\n\n## OBJ Format Support\n\n- [x] different combinations of positions, normal vectors and UV (texture coordinates);\n- [x] face elements `f`;\n- [x] line elements `l`;\n- [x] points elements `p`;\n- [x] object names `o`;\n- [x] group names `g`;\n- [x] material names `usemtl`;\n- [ ] smoothing groups `s`;\n- [ ] free-form curves and surfaces and related data;\n- [ ] miscellaneous display and rendering data attributes, e.g. `mtllib`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw0rm%2Felm-obj-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw0rm%2Felm-obj-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw0rm%2Felm-obj-file/lists"}