From 5cb86b769ae55fb6df0dbd6aab8d87dd5bcd72fa Mon Sep 17 00:00:00 2001 From: Mar Canet Date: Wed, 13 Jun 2018 10:44:09 +0300 Subject: [PATCH] Add more materials Add more materials to calculate weight of the volume. I had use the table from https://imaterialise.helpjuice.com/materials/density --- mesure_volume.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/mesure_volume.py b/mesure_volume.py index 1e74a6e..9351dd7 100644 --- a/mesure_volume.py +++ b/mesure_volume.py @@ -75,6 +75,34 @@ def calculateMassCM3(self,totalVolume): totalMass = (totalVolume*1.79) elif material in {'4','Plexiglass'}: totalMass = (totalVolume*1.18) + elif material in {'5','Alumide'}: + totalMass = (totalVolume*1.36) + elif material in {'6','Aluminum'}: + totalMass = (totalVolume*2.68) + elif material in {'7','Brass'}: + totalMass = (totalVolume*8.6) + elif material in {'8','Bronze'}: + totalMass = (totalVolume*9.0) + elif material in {'9','Copper'}: + totalMass = (totalVolume*9.0) + elif material in {'10','Gold_14K'}: + totalMass = (totalVolume*13.6) + elif material in {'11','Gold_18K'}: + totalMass = (totalVolume*15.6) + elif material in {'12','Polyamide_MJF'}: + totalMass = (totalVolume*1.01) + elif material in {'13','Polyamide_SLS'}: + totalMass = (totalVolume*0.95) + elif material in {'14','Rubber'}: + totalMass = (totalVolume*1.2) + elif material in {'15','Silver'}: + totalMass = (totalVolume*10.26) + elif material in {'15','Steel'}: + totalMass = (totalVolume*7.86) + elif material in {'15','Titanium'}: + totalMass = (totalVolume*4.41) + elif material in {'15','Resin'}: + totalMass = (totalVolume*1.2) return totalMass def calculateVolume(self,infilename, unit):