We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here the min and max are initialized with (0, 0, 0), before searching for the bounding box:
three-dxf/src/index.js
Lines 94 to 97 in 20e14cb
The text was updated successfully, but these errors were encountered:
A solution could be:
var dims = { min: { x: Infinity, y: Infinity, z: Infinity }, max: { x: -Infinity, y: -Infinity, z: -Infinity } };
Sorry, something went wrong.
After adding all the 3d objects to the scene, just calculate the bounding box of the scene. Here's how I did it:
for (let i = 0; i < data.entities.length; i++) { const entity = data.entities[i]; let obj = this.painter.draw(entity, data); if (obj) { this.scene.add(obj); } obj = null; } // …… const dims = new THREE.Box3().setFromObject(this.scene);
@oubenruing indeed your solution is way nicer! Thanks!
No branches or pull requests
Here the min and max are initialized with (0, 0, 0), before searching for the bounding box:
three-dxf/src/index.js
Lines 94 to 97 in 20e14cb
which doesn't work if the whole dxf is not distributed around the origin.
The text was updated successfully, but these errors were encountered: