...
Code Block |
---|
//Material variables let materialCost = 180; //euro/kg let density = 4.43; //g/cm^3 //Machine time variables let scanningSpeed = 40; // mm/s let supportScanningSpeed = 40; // mm/s let laserDiameter = 0.1; // mm let layerHeight = 0.1; // mm let layerPreparationTime = 10; // sec let supportInfill = 0.2; // number in [0,1] let hourlyRate = 35; //euro/hour // Material price calculation let materialVolume = model.volume + support.volume * supportInfill; let material = density * materialVolume * materialCost / 1000000; // Machine runtime cost calculation in hour let numberOfLayers = model.h/layerHeight; let machineTime = ((model.volume)/(scanningSpeed*laserDiameter*layerHeight) + support.volume*supportInfill/(supportScanningSpeed*laserDiameter*layerHeight) + layerPreparationTime*numberOfLayers/item.quantity)/3600; let machine = hourlyRate * machineTime; let price = machine + material; // Last line must contain final price price; |
...