How to calculate the approximate volume of material used in 3d print? Is there a reasonable way of approximating the volume of material used for 3D print by knowing only the STL file volume and infill percentage?

Or what is the formula for calculating the exact volume and which parameters can be fixed to reasonable values?

Can this be done easily using Slic3r or CuraEngine in command line?

Note:
Supposedly 3Dhubs use Cura[*] software to calculate the print volume.

Any help is appreciated.

[*] www.3dhubs.com/talk/thread/calculate-print-volume
Possible way to calculate the volume of material used is to multiply the filament length (calculated by CURA after slicing and displayed in lower right corner) and surface of filament tip.

Volume = Filament_length * ( Filament_diameter / 2 )^2 * PI

Of course do not forget to convert all values to the same order of magnitude (e.g. cm³).