Add size calculation example.
This commit is contained in:
parent
93a6f988f8
commit
6b6422de7e
@ -23,9 +23,15 @@
|
||||
function OnModelLoaded (model)
|
||||
{
|
||||
let calculationDiv = document.getElementById ('calculation_result');
|
||||
let boundingBox = OV.GetBoundingBox (model);
|
||||
calculationDiv.innerHTML =
|
||||
'Surface area: ' + OV.CalculateSurfaceArea (model).toFixed (2) + '<br>' +
|
||||
'Volume: ' + OV.CalculateVolume (model).toFixed (2) + '<br>';
|
||||
'Volume: ' + OV.CalculateVolume (model).toFixed (2) + '<br>' +
|
||||
'Size: (' +
|
||||
(boundingBox.max.x - boundingBox.min.x) + ', ' +
|
||||
(boundingBox.max.y - boundingBox.min.y) + ', ' +
|
||||
(boundingBox.max.z - boundingBox.min.z) +
|
||||
')<br>';
|
||||
}
|
||||
|
||||
window.addEventListener ('load', () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user