Comments (5)
With over 260 million float elements for both the position and normal buffers you're model is over 2GB in memory - that's just about at the memory cap for most desktop browser tabs. There's not a lot this project can do if there's no browser memory left and it crashes on a buffer allocation.
Depending on your use case you can artificially increase the memory cap with command line flags and preprocess the model BVH to save to disk before loading it so it doesn't have to be generated on load.
from three-mesh-bvh.
Hello, how to preprocess the model BVH?
from three-mesh-bvh.
Hello, how to preprocess the model BVH?
There's no prebuilt tool for this so you'll have to implement the file storage and loading yourself. But the basic process would be:
- Generate the BVH offline using something like Node or Puppeteer with a higher memory cap
- Use the serialize to get a minimal, serialized version of the bvh and associated buffers.
- Save the data and buffers in an optimal way (ie don't just JSON stringify because the typed arrays will be expanded to arrays)
- Load the bvh file into the browser, read it into an object shaped the same as the originally serialized version.
- Deserialize the BVH using the deserialize function.
from three-mesh-bvh.
When using Serialization and Deserialization, an error will be reported when intersectsGeometry, indirect is true
This is a demo
demo
from three-mesh-bvh.
Thanks for the easy repro. Just fixed the issue in #664 - it'll be available in the next release.
from three-mesh-bvh.
Related Issues (20)
- Check the methods that use 'arrayToBox'.
- Add near and far check in intersectRay HOT 2
- Import error with NextJS HOT 3
- InstancedMesh example HOT 1
- Compute bounds tree after adding mesh to group/scene? HOT 4
- Add it to the tampermonkey
- Does the three-mesh-bvh library have any methods to distinguish between the cases where two meshes are just touching and when they are embedded within each other? HOT 3
- a syntex error in index.js when import from 'three-mesh-bvh' HOT 1
- ./node_modules/three-mesh-bvh/src/index.js Module parse failed: Unexpected token (12:9) HOT 1
- Error when calculating bounding box of group which includes `MeshBVHHelper` as child
- InstancedMesh regression in 0.7.5 HOT 7
- Not able to find any *.generated and *_indirect js files in your repository HOT 2
- Update ESLint, typescript dependencies
- [Question] Collision effect using BVH Shapecast HOT 2
- getBoundingBox box very slightly bigger than threejs bounding box HOT 3
- please update you clippedEdges example, it doesn't work HOT 1
- TS type augmentations don't work w/ "moduleResolution": "node16" HOT 3
- [Question] Make collision smoother HOT 1
- Raycast missing the bottom edge of a face randomly, likely based on floating point rounding HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from three-mesh-bvh.