apparentlymart / python-stl

Python library for parsing and producing STL files, in both ASCII and binary formats. No longer maintained.
MIT License
9 stars 13 forks source link

Surface area #6

Closed zachwick closed 9 years ago

zachwick commented 9 years ago

This set of commits adds a Facet.area property and a Solid.surface_area property.

apparentlymart commented 9 years ago

Thanks for this!

I merged a slightly-simplified version of this as ea1090fd2d5da1f432892173817e8d9617973d8f. The main change I made was to make Solid.surface_area a property that gets calculated on the fly, rather than a value that gets updated when facets change. I did this for two reasons:

Otherwise the logic here is what was in your patch, with some simple tests I added.