...
Code Block | ||
---|---|---|
| ||
let materialPrice = ; // $/kg or €/kg
let materialDensity = ; // g/cm^3
let supportPrice = ; // $/kg or €/kg
let supportDensity = ; // g/cm^3
let infill = ; // number in [0,1]
let supportInfill = ; // number in [0,1]
let wallThickness = ; // mm
let materialUsed = Math.max((model.volume - model.area*wallThickness)*infill, 0) +
Math.min(model.area*wallThickness, model.volume);
let totalMaterialPrice = (materialUsed*materialDensity*materialPrice +
support.volume*supportPrice*supportDensity*supportInfill)*0.000001;
totalMaterialPrice; |
Each variable can then be defined with a constant value or mathematical calculation using available variables from the 3YOURMIND model analysis (next section).
...