Question

VolumeCalculator

  • 30 September 2019
  • 2 replies
  • 12 views

Userlevel 4
Badge +26

Hi people,

 

 

I'm hoping someone from Safe can provide some insight into how the volume calculator works. I've been tasked with calculating the volumes of a few things which may potentially contain solids with invalid geometries (not closed etc).

 

I was thinking that the VolumeCalculator would need a proper closed solid in order to calculate the volume, however, to my delight, I found that it worked on invalid solids as well.

 

 

My question though, is how does it figure out the volume. I've attached an example where I have removed a couple of surfaces from a box and then Coerced it back into a solid.

 

 

The VolumeCalculator returns a volume of 0.6667 m3 when two sides of the cube are removed.

 

 

Any inside knowledge on this would be great. @mark2atsafe @danatsafe?

 

 


2 replies

Userlevel 4
Badge +25

Hi Matt. Yes, it's true that the VolumeCalculator doesn't validate the features it is calculating the volumes of. It assumes the user will have already done that (the GeometryValidator would help there).

So, whether the calculation results make sense with invalid geometry is debatable. It won't return a negative volume, but you might find it returns -1.=#IND in certain bad cases.

As to the technique used, I believe it's based on this one here: https://en.wikipedia.org/wiki/Polyhedron#Volume

It seems to relate to the faces of an object, so I can imagine that when the object is missing faces or has some other convoluted (and invalid) geometry, that the results are not going to be that great.

I hope that's useful. In short, if the faces of the polyhedron aren't correct, then I very much doubt that the volume will be.

Userlevel 4
Badge +26

Hi Matt. Yes, it's true that the VolumeCalculator doesn't validate the features it is calculating the volumes of. It assumes the user will have already done that (the GeometryValidator would help there).

So, whether the calculation results make sense with invalid geometry is debatable. It won't return a negative volume, but you might find it returns -1.=#IND in certain bad cases.

As to the technique used, I believe it's based on this one here: https://en.wikipedia.org/wiki/Polyhedron#Volume

It seems to relate to the faces of an object, so I can imagine that when the object is missing faces or has some other convoluted (and invalid) geometry, that the results are not going to be that great.

I hope that's useful. In short, if the faces of the polyhedron aren't correct, then I very much doubt that the volume will be.

Awesome, thanks for your input Mark. This is just the answer I was looking for. Thanks for the wiki link. The Volume calculations I'm getting seem responsable which I think is good enough for the application I'm using it for. For what it's worth I'm very happy that it works even when the solid isn't perfect.

Reply