Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/parse-ply
Streaming JavaScript PLY parser
https://github.com/mikolalysenko/parse-ply
Last synced: about 2 months ago
JSON representation
Streaming JavaScript PLY parser
- Host: GitHub
- URL: https://github.com/mikolalysenko/parse-ply
- Owner: mikolalysenko
- License: mit
- Created: 2013-02-23T23:18:55.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2019-01-10T10:06:08.000Z (almost 6 years ago)
- Last Synced: 2024-10-20T14:27:11.692Z (2 months ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 16
- Watchers: 6
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
parse-ply
=========
A streaming [PLY](http://www.cc.gatech.edu/projects/large_models/ply.html) parser written in JavaScript.Usages
======
First, install using npm:npm install parse-ply
Then you can create a stream using require. For example, here is some code that parses a PLY file from stdin and dumps the result to stdout:
require("parse-ply")(process.stdin, function(ply) {
console.log(ply);
});The properties within the file are all encoded as appropriate typed arrays.
`require("parse-ply")(stream, cb)`
------------------------
This creates a streaming PLY parser. To use it, pipe in a stream containing your mesh. When it is done, it will emit a `data` event that has the parsed PLY file as the main argument.* `stream` is a stream object
* `cb(err, data)` is callback that is executed once the PLY is fully parsed### Data structure
The returned `data` field contains the contents of the completely parsed PLY file and has the two fields:* `vertex`: An object whose properties are the attributes of each vertex.
* `face`: An object whose properties are the attributes of each face.More Information
================
To learn more about the PLY file format, here are some links:* [Wikipedia](http://en.wikipedia.org/wiki/PLY)
* [Paul Bourke's C code](http://paulbourke.net/dataformats/ply/)You can also view PLY files using standard tools, like MeshLab:
* [MeshLab](http://en.wikipedia.org/wiki/MeshLab)
Credits
=======
(c) 2013 Mikola Lysenko. BSD License