Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
let materialCost = 180;        //euro/kg
let density = 4.43;            //g/cm^3
let hourlyRate = 35;           //euro/hour
let scanningSpeed = 3000;      //mm/s
let laserDiameter = 0.1;       //mm
let layerHeight = 0.1;         //mm
let layerPreparationTime = 10; //s
let supportInfill = 0.1;       // 10%
let laserNumber = 1;           // Set number of lasers for multi-laser machines
let factor = 1;


// Price calculation
let materialVolume = model.volume + support.volume * supportInfill;

let recoatingTime = ((layerPreparationTime * model.h) / layerHeight) / item.quantity;
let printingSpeed = scanningSpeed * laserNumber * laserDiameter * layerHeight;

let machineTime = factor * (materialVolume / (printingSpeed) + recoatingTime) / 3600;

let price = hourlyRate * machineTime + density * materialVolume * materialCost / 1000000;

// Last line must contain final price
price;