
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
wavefront-obj-parser
Advanced tools
An
apiandclifor parsing wavefront .obj files into JSON
$ npm install --save wavefront-obj-parser
# Changes to the `src` and `demo` directories will live reload in your browser
$ npm run demo
The CLI will output stringified JSON to stdout
# parse from stdin
cat my-3d-model.obj | obj2json > my-3d-model.json
# parse from file
obj2json my-3d-model.obj > my-3d-model.json
var parseWFObj = require('wavefront-obj-parser')
var wavefrontString = fs.readFileSync('./my-3d-model.obj').toString('utf8')
var parsedJSON = parseWFObj(wavefrontString)
parseWFObj(wavefrontString) -> objectRequired
Type: string
A wavefront .obj in string format
The returned JSON object has the following one dimensional array properties:
var returnedObject = {
// Parsed from `vn` lines
vertexNormals: [...],
// Parsed from `vt` lines
vertexUVs: [...],
// Parsed from `v` lines
vertexPositions: [...],
// These come from the `f` face lines
vertexNormalIndices: [...],
vertexUVIndices: [...],
vertexPositionIndices: [...]
}
If you plan to use normals or UVs you'll want to run the data through something like expand-vertex-data.
This unwraps your data from being indexed across multiple properties (vertices, normals, uvs) to only being indexed based on vertices. You can only have one
ELEMENT_ARRAY_BUFFER in WebGL so you can't make use of multiple indices.
\nMIT
FAQs
Parse wavefront .obj files into json
The npm package wavefront-obj-parser receives a total of 26 weekly downloads. As such, wavefront-obj-parser popularity was classified as not popular.
We found that wavefront-obj-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.