Last active
December 23, 2015 10:19
-
-
Save jlewin/6620401 to your computer and use it in GitHub Desktop.
Get bounding box for STL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="../build/three.min.js"></script> | |
| <script src="js/loaders/STLLoader.js"></script> | |
| <script> | |
| var loader = new THREE.STLLoader(); | |
| loader.addEventListener('load', function (event) { | |
| var geometry = event.content; | |
| if (geometry.boundingBox === null) { | |
| geometry.computeBoundingBox(); | |
| } | |
| // Dumps something like the following to the console: {x: -0.4995945, y: -0.5, z: -0.18 } | |
| console.log(geometry.boundingBox.min); | |
| console.log(geometry.boundingBox.max); | |
| }); | |
| loader.load('models/stl/ascii/slotted_disk.stl'); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment