Download node_modules/three-mesh-bvh/src/utils/PrimitivePool.js from SimWorld-AI/industrial-harbor-viewer: direct link, hf CLI and curl.
- Browser
- Download file 397 Bytes
-
https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three-mesh-bvh/src/utils/PrimitivePool.js
- Command line
-
hf download hf://spaces/SimWorld-AI/industrial-harbor-viewer/node_modules/three-mesh-bvh/src/utils/PrimitivePool.js
-
curl -L -o PrimitivePool.js https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three-mesh-bvh/src/utils/PrimitivePool.js
397 Bytes
| export class PrimitivePool { | |
| constructor( getNewPrimitive ) { | |
| this._getNewPrimitive = getNewPrimitive; | |
| this._primitives = []; | |
| } | |
| getPrimitive() { | |
| const primitives = this._primitives; | |
| if ( primitives.length === 0 ) { | |
| return this._getNewPrimitive(); | |
| } else { | |
| return primitives.pop(); | |
| } | |
| } | |
| releasePrimitive( primitive ) { | |
| this._primitives.push( primitive ); | |
| } | |
| } | |