three-volume
TypeScript icon, indicating that this package has built-in type declarations

2.0.7 • Public • Published

Mesh volume calculator for Three or React Three.

It requires a mesh geometry (object.children[0]) and returns volume in original units. You may use 'precision' arg (optional) to avoid division by 1000 and calculate with greater precision, useful for smaller geometry.

  1. Install: npm i three-volume

  2. Import: import {ThreeVolume} from 'three-volume' // const {ThreeVolume} = require('three-volume');

  3. Use: let volume = ThreeVolume({geometry:mesh.geometry,precision:true/false})

If you are trying to pass a geometry object without standard properties (such as position), you may invoke a new Mesh() object, and type-cast as such:

const mesh = new Mesh(file, new MeshBasicMaterial());

const volume = ThreeVolume(mesh as unknown as BufferGeometry);

Hecho con amor en argentina.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.7284latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.7284
2.0.61
2.0.51
2.0.45
2.0.31
2.0.21
2.0.11
2.0.01
1.5.31
1.5.21
1.5.11
1.5.01
1.4.01
1.3.01
1.2.01
1.1.01
1.0.01

Package Sidebar

Install

npm i three-volume

Weekly Downloads

202

Version

2.0.7

License

ISC

Unpacked Size

2.8 kB

Total Files

5

Last publish

Collaborators

  • isalgadof