{"id":13561716,"url":"https://github.com/ianmackenzie/elm-triangular-mesh","last_synced_at":"2025-04-10T05:40:52.500Z","repository":{"id":57675120,"uuid":"99585450","full_name":"ianmackenzie/elm-triangular-mesh","owner":"ianmackenzie","description":"Generic indexed triangular mesh data structure for Elm","archived":false,"fork":false,"pushed_at":"2023-09-18T09:21:04.000Z","size":42,"stargazers_count":8,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T17:05:27.706Z","etag":null,"topics":["elm","geometry","mesh","triangle"],"latest_commit_sha":null,"homepage":"","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianmackenzie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2017-08-07T14:15:28.000Z","updated_at":"2024-08-29T17:34:04.000Z","dependencies_parsed_at":"2024-08-01T13:17:26.686Z","dependency_job_id":"e22a1768-502e-493b-a300-95ba9a76669d","html_url":"https://github.com/ianmackenzie/elm-triangular-mesh","commit_stats":{"total_commits":54,"total_committers":1,"mean_commits":54.0,"dds":0.0,"last_synced_commit":"90501fe2d08e31b64c9e1d74bd32ae4d5e0688c8"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-triangular-mesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-triangular-mesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-triangular-mesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-triangular-mesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianmackenzie","download_url":"https://codeload.github.com/ianmackenzie/elm-triangular-mesh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166147,"owners_count":21058474,"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":["elm","geometry","mesh","triangle"],"created_at":"2024-08-01T13:01:00.310Z","updated_at":"2025-04-10T05:40:52.470Z","avatar_url":"https://github.com/ianmackenzie.png","language":"Elm","readme":"# elm-triangular-mesh\n\nThis [Elm](http://elm-lang.org) package allows you to create and manipulate\nindexed triangular meshes. A mesh contains an array of vertices which contain\nthe bulk of the mesh data; vertices can be of any type, so you can create meshes\nfrom 2D or 3D points or have complex vertices of your own custom type that\ninclude additional data such as colors, normal vectors, texture coordinates,\nunique IDs, etc.\n\nMesh faces are defined by triples of integer indices specifying which three\nvertices make up the face. This package has functionality for creating meshes in\nvarious ways, extracting faces as index triples or vertex triples, extracting\nedges as index pairs or vertex pairs, and combining multiple meshes.\n\nFor example, you might create a 2D mesh representing a single rectangle as:\n\n```elm\nimport TriangularMesh exposing (TriangularMesh)\nimport Array\n\nmesh : TriangularMesh ( Float, Float )\nmesh =\n    let\n        vertices =\n            Array.fromList\n                [ ( 0, 0 )\n                , ( 4, 0 )\n                , ( 4, 3 )\n                , ( 0, 3 )\n                ]\n\n        faceIndices =\n            [ ( 0, 1, 2 )\n            , ( 2, 3, 0 )\n            ]\n    in\n    TriangularMesh.indexed vertices faceIndices\n```\n\nYou could then do things like get the faces or edges of that mesh as tuples of\nvertices:\n\n```elm\nTriangularMesh.faceVertices mesh\n--\u003e [ ( ( 0, 0 ), ( 4, 0 ), ( 4, 3 ) )\n--\u003e , ( ( 4, 3 ), ( 0, 3 ), ( 0, 0 ) )\n--\u003e ]\n\nTriangularMesh.edgeVertices mesh\n--\u003e [ ( ( 0, 0 ), ( 4, 0 ) )\n--\u003e , ( ( 0, 0 ), ( 4, 3 ) )\n--\u003e , ( ( 0, 0 ), ( 0, 3 ) )\n--\u003e , ( ( 4, 0 ), ( 4, 3 ) )\n--\u003e , ( ( 4, 3 ), ( 0, 3 ) )\n--\u003e ]\n```\n\n## Documentation\n\n[Full API documentation](http://package.elm-lang.org/packages/ianmackenzie/elm-triangular-mesh/1.0.0/TriangularMesh)\nis available.\n\n## Questions? Comments?\n\nPlease [open a new issue](https://github.com/ianmackenzie/elm-triangular-mesh/issues) if you run\ninto a bug, if any documentation is missing/incorrect/confusing, or if there's a\nnew feature that you would find useful. For general questions about using this\npackage, try:\n\n  - Sending me (@ianmackenzie) a message on the [Elm Slack](http://elmlang.herokuapp.com/) -\n    even if you don't have any particular questions right now, just come say\n    hello!\n  - Posting to [Elm Discourse](https://discourse.elm-lang.org/)\n  - Posting to [r/elm](https://reddit.com/r/elm)\n\nYou can also find me on Twitter ([@ianemackenzie](https://twitter.com/ianemackenzie)),\nwhere I occasionally post geometry-related stuff like demos or new package\nreleases. Have fun, and don't be afraid to ask for help!\n","funding_links":[],"categories":["Elm"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmackenzie%2Felm-triangular-mesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianmackenzie%2Felm-triangular-mesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmackenzie%2Felm-triangular-mesh/lists"}