Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thibauts/parse-3ds
Parses 3D Studio .3DS files
https://github.com/thibauts/parse-3ds
Last synced: 2 months ago
JSON representation
Parses 3D Studio .3DS files
- Host: GitHub
- URL: https://github.com/thibauts/parse-3ds
- Owner: thibauts
- License: mit
- Created: 2015-02-27T23:43:23.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-03-16T12:06:55.000Z (almost 5 years ago)
- Last Synced: 2024-09-23T23:10:56.041Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 7
- Watchers: 5
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
parse-3ds
=========
### Parses 3D Studio .3DS filesParses 3DS files and returns objet data. The full 3DS chunk tree is parsed internally, allowing to easily extend the module and provide parsers for various chunk types.
Install
-------```bash
$ npm install parse-3ds
```Usage
-----### parsed = require('parse-3ds')(buf[, options]) ###
Returns the parsed contents of `buf`. `options`, if present, can contain the following keys:
* `objects`: if `true`, object data will be available. Default is `true`.
* `tree`: if `true`, the full chunks tree will be available. Default is `false`.
* `encoding`: the encoding used to interpret strings stored in parsed file. Defaults to `binary` (latin-1).Note: should you need to explicitly set `encoding`, please consider logging an issue for further investigation.
Example
-------```javascript
var parse3DS = require('parse-3ds');
var fs = require('fs');var buf = fs.readFileSync('test.3ds');
var parsed = parse3DS(buf, { 'objects':true, 'tree':true });/*
{
objects: [
{ name: 'a', vertices: [ ... ], faces: [ ... ] },
{ name: 'b', vertices: [ ... ], faces: [ ... ] },
{ name: 'c', vertices: [ ... ], faces: [ ... ] }
],
tree: [
// Unparsed nodes will have an extra 'data' field
{ id: 42, length: 42, name: 'abc', children: [ ... ] }
]
}
*/
```