2

I have a STL files that contains 3d model of basic ball and another 3d model of some weird block. I was given the task of finding out volume of model and the possible supported Material? This is how I calculate.

BoundingBox Volume = lenght x width x depth (values are got from stl file)

Volume of Model is based on

        var v321 = (v3.x) * (v2.y) * (v1.z),
        v231 = (v2.x) * (v3.y) * (v1.z),
        v312 = (v3.x) * (v1.y) * (v2.z),
        v132 = (v1.x) * (v3.y) * (v2.z),
        v213 = (v2.x) * (v1.y) * (v3.z),
        v123 = (v1.x) * (v2.y) * (v3.z);
        return (v231 - v321 - v132 - v213 + v123 + v312) / 6.0;

(these values are from STL file) and seems correct.

Now How do I calculate the support material volume ?

PZac
  • 21
  • 1
  • 2

2 Answers2

2

I had the same problem a while ago and was learning about parsers in Unix at the same time, so I had decided to implement a simple volume calculator. It does just that, and you can use it for other operations with minor modifications, since the grammar rules are already there.

It should be one of the fastest alternatives possible, since it is written in C with the parser generated by Bison/Flex.

osolmaz
  • 1,873
  • 2
  • 24
  • 41
1

A little while ago someone asked (on SO) for a command-line utility that would compute volume of points in an STL file. It looks like this utility will do it: https://sites.google.com/a/varlog.com/www/admesh-htm

TravisJ
  • 1,592
  • 1
  • 21
  • 37
  • 1
    Yes I have seen this. From the output, it does not give the volume of supported material. But the volume of the model. I am interested in seeing the formula for volume of the supported structure. – PZac Jan 15 '15 at 19:13
  • Would you mind describing how the volume the supported material is related to the object in the STL file? It is terminology that I'm not familiar with (my background is mathematics). – TravisJ Jan 15 '15 at 19:32
  • Ok. have you heard of the 3D-Printer that creates("print") an object based on the 3D model provided by the STL file. if we are making an object that have any overhanging structure, it needs support to make it stand and let the object dry and later the support structure is removed leaving behind the overhanging structure. To see it clearly.... see this youtube link... [link](https://www.youtube.com/watch?v=bnpEfRWqDKU&noredirect=1) – PZac Jan 15 '15 at 20:43