views:

208

answers:

2

Just wondering if anyone had a simple, efficient way of calculating the volume of a stereolithographic file (STL)? And rendering this in a Windows Form Control?

A: 

I would like to know how to do this myself.

Louis
A: 

Well, you can take every triangle and project it to the XY plane, giving you a triangular-prism. Add the volume of this prism to your total if the triangle runs CCW, and subtract that volume if it runs clockwise. That will give you the volume of your solid, assuming it's valid STL.

Or... do the HxWxL of your bounding box: it's really 1) simple and 2) efficient, although it can be slightly inaccurate.

erjiang