0

# Calculate volume of Object

**This discussion was imported from CodePlex**

**JustFreak** wrote at 2013-05-09 21:08:

Hello,

First of all wonderful job with the library!! I have been using the ModelImporter class for loading STL files into my program, but I would also like to calculate the Volume of a given GeometryModel with a MeshGeometry or a whole ModelGroup with several geometry models inside. I have already found a method to calculate a volume from here Calculate Volume but since I'm new to this I'm not sure how to re-factor it to fit in my case. Any help is greatly appreciated.

Thanks

First of all wonderful job with the library!! I have been using the ModelImporter class for loading STL files into my program, but I would also like to calculate the Volume of a given GeometryModel with a MeshGeometry or a whole ModelGroup with several geometry models inside. I have already found a method to calculate a volume from here Calculate Volume but since I'm new to this I'm not sure how to re-factor it to fit in my case. Any help is greatly appreciated.

Thanks

**objo** wrote at 2013-05-27 15:23:

You can use the

`Visual3DHelper.TraverseModel`

method to traverse the
`Model3DGroup`

. This method will also give you the transforms that should be applied to each
`MeshGeometry3D`

to calculate the volumes correctly!Customer support service by UserEcho