aabb-calculator
v1.3.0
Published
This library helps to get the aaabb (boundingbox) from a FBX or OBJ file. It works on NodeJs without need of Three.js
Downloads
18
Readme
AABB calculator for JavaScript/TypeScript
This library helps to get the aaabb (boundingbox) from a FBX or OBJ file. It works on NodeJs without need of Three.js
Installation
npm install aabb-calculator
Usage
import {calculateObjAabb, calculateFbxAabb} as FBXParser from 'aabb-calculator'
// With an OBJ file
import * as fs from 'fs'
const objFile = 'file.obj'
aabb = calculateObjAabb(fs.readFileSync(file))
// With an FBX file
import * as fs from 'fs'
const fbxFile = 'file.fbx'
aabb = calculateFbxAabb(fs.readFileSync(file))
The Boundigbox has the form
{
min: { x: -1, y: -1.000001, z: -1 },
max: { x: 1, y: 1, z: 1 }
}