Calculating Volume of 3D Objects with Rhino3dm.js

Hello,

I’m currently developing a web application where I need to calculate the volume of 3D objects contained in 3DM files. I’m using the Rhino3dm.js library to read the 3DM files and access the structure and properties of the 3D models.

However, I’ve noticed that the Rhino3dm.js library doesn’t seem to support volume calculations directly. I’m aware that more advanced geometric operations, such as volume calculations, are provided by the separate Rhino Compute service.

I wanted to confirm if this is still the case. Is there a way to calculate the volume of 3D objects directly using Rhino3dm.js, or do I need to use Rhino Compute for this? If Rhino3dm.js does not support volume calculations, are there any plans to add this feature in the future?

If there is no other solution than using RhinoCompute then I will go for it, however I wanted to conferm there are no free solutions

@dale

Hi Farouk,

This might be a solution:

-Willem

1 Like

Idk whether this library is even necessary haha and this is not much code tbh.

It’s basically calculating volume by dividing the mesh into small tetrahedrons. While this works for normal shapes (where the CG is within the volume) , I have often seen that it calculates incorrectly for convex shapes (where the CG lies outside the volume)

I’m also looking for something more reliable than this logic.

1 Like

Hi @farouk.serragedine,

Rhino.js is based on openNURBS. And openNURBS does not include mass property calculations.

Rhino.Compute would be a solution for this.

– Dale

1 Like

Thank you all for your quick replies, I will check if three-volume produces accurate results, if not I will go for RhinoCompute.
-Farouk