{"id":22647912,"url":"https://github.com/juliageometry/plyio.jl","last_synced_at":"2025-04-12T02:12:41.975Z","repository":{"id":49514831,"uuid":"70383745","full_name":"JuliaGeometry/PlyIO.jl","owner":"JuliaGeometry","description":"Read and write polygon ply files from julia","archived":false,"fork":false,"pushed_at":"2024-10-14T04:47:22.000Z","size":151,"stargazers_count":20,"open_issues_count":0,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-12T02:12:33.999Z","etag":null,"topics":["graphics","julia","ply-files","polygon"],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaGeometry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2016-10-09T06:59:37.000Z","updated_at":"2024-10-14T04:31:34.000Z","dependencies_parsed_at":"2024-12-09T07:46:02.458Z","dependency_job_id":null,"html_url":"https://github.com/JuliaGeometry/PlyIO.jl","commit_stats":{"total_commits":60,"total_committers":9,"mean_commits":6.666666666666667,"dds":0.35,"last_synced_commit":"7512f7e01f3d61e3ce2a7e898881749e62e2c8cc"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGeometry%2FPlyIO.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGeometry%2FPlyIO.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGeometry%2FPlyIO.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGeometry%2FPlyIO.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaGeometry","download_url":"https://codeload.github.com/JuliaGeometry/PlyIO.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505926,"owners_count":21115354,"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":["graphics","julia","ply-files","polygon"],"created_at":"2024-12-09T07:35:44.763Z","updated_at":"2025-04-12T02:12:41.946Z","avatar_url":"https://github.com/JuliaGeometry.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ply polygon file IO\n\n**PlyIO** is a package for reading and writing data in the\n[Ply](http://paulbourke.net/dataformats/ply/) polygon file format, also called\nthe Stanford triangle format.\n\n[![Build Status](https://github.com/JuliaGeometry/PlyIO.jl/workflows/CI/badge.svg)](https://github.com/JuliaGeometry/PlyIO.jl/actions?query=workflow%3ACI)\n\n## Quick start\n\n### Writing ply\n\nHere's an example of how to write a basic ply file containing random triangles\nand edges:\n\n```julia\nusing PlyIO\n\nply = Ply()\npush!(ply, PlyComment(\"An example ply file\"))\n\nnverts = 1000\n\n# Random vertices with position and color\nvertex = PlyElement(\"vertex\",\n                    ArrayProperty(\"x\", randn(nverts)),\n                    ArrayProperty(\"y\", randn(nverts)),\n                    ArrayProperty(\"z\", randn(nverts)),\n                    ArrayProperty(\"r\", rand(nverts)),\n                    ArrayProperty(\"g\", rand(nverts)),\n                    ArrayProperty(\"b\", rand(nverts)))\npush!(ply, vertex)\n\n# Some triangular faces.\n# The UInt8 is the type used for serializing the number of list elements (equal\n# to 3 for a triangular mesh); the Int32 is the type used to serialize indices\n# into the vertex array.\nvertex_index = ListProperty(\"vertex_index\", UInt8, Int32)\nfor i=1:nverts\n   push!(vertex_index, rand(0:nverts-1,3))\nend\npush!(ply, PlyElement(\"face\", vertex_index))\n\n# Some edges\nvertex_index = ListProperty(\"vertex_index\", Int32, Int32)\nfor i=1:nverts\n   push!(vertex_index, rand(0:nverts-1,2))\nend\npush!(ply, PlyElement(\"edge\", vertex_index))\n\n# For the sake of the example, ascii format is used, the default binary mode is faster.\nsave_ply(ply, \"example1.ply\", ascii=true)\n```\n\nOpening this file using a program like\n[displaz](https://github.com/c42f/displaz), for example using `displaz example1.ply`,\nyou should see something like\n\n![Example one](doc/example1.png)\n\n\n### Reading ply\n\nReading the ply file generated above is quite simple:\n\n```julia\njulia\u003e using PlyIO\n\njulia\u003e ply = load_ply(\"example1.ply\")\nPlyIO.Ply with header:\n ply\n format ascii 1.0\n comment An example ply file\n element vertex 1000\n property float64 x\n property float64 y\n property float64 z\n property float64 r\n property float64 g\n property float64 b\n element face 1000\n property list int32 int32 vertex_index\n element edge 1000\n property list int32 int32 vertex_index\n end_header\n\njulia\u003e ply[\"vertex\"]\nPlyElement \"vertex\" of length 1000 with properties [\"x\", \"y\", \"z\", \"r\", \"g\", \"b\"]\n\njulia\u003e ply[\"vertex\"][\"x\"]\n1000-element PlyIO.ArrayProperty{Float64,String} \"x\":\n -0.472592\n  1.04326\n -0.982202\n ⋮\n -2.55605\n  0.773923\n -2.10675\n```\n\n## API\n\n### The file format\n\nConceptually, the ply format is a container for a set of named tables of numeric\ndata.  Each table, or **element**, has several named columns or **properties**.\nProperties can be either simple numeric arrays (floating point or\nsigned/unsigned integers), or arrays of variable length lists of such numeric\nvalues.\n\nAs described, ply is quite a generic format but it's primarily used for\ngeometric data. For this use there are some loose\n[naming conventions](http://paulbourke.net/dataformats/ply/) which attach\ngeometric meaning to certian combinations of element and property names.\nUnfortunately there's no official standard.\n\n### Document object model\n\nPly elements are represented with the `PlyElement` type which is a list of\nproperties which may be looked up by name.\n\nProperties may be represented by an `AbstractArray` type which has the the\n`plyname` function defined, which should return a name for the property.  The\nbuiltin types `ArrayProperty` and `ListProperty` are used as containers for data\nwhen reading a ply file.\n\nThe `Ply` type is a container for several interleaved `PlyElement` and\n`PlyComment` fields, in the order which would be observed in a standard ply\nheader.\n\n### Reading and writing\n\nTo read and write `Ply` objects from files or `IO` streams, use the functions\n`load_ply()` and `save_ply()`.\n\n\n## Acknowledgements\n\n[![FugroRoames](https://avatars.githubusercontent.com/FugroRoames?s=150)](https://github.com/FugroRoames)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliageometry%2Fplyio.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliageometry%2Fplyio.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliageometry%2Fplyio.jl/lists"}