//material cost
let materialPrice = 80; // € or $
let materialDensity = 1.04; // g/cm^3
let supportPrice = 80; // €/kg or $/kg
let supportDensity = 1.04; // g/cm^3
let infill = 0.2; // number in [0,1]
let supportInfill = 0.2; // number in [0,1]
let wallThickness = 2; // mm
let materialUsedmaterialUsedInfill = Math.max((model.volume - model.area * wallThickness) * infill, 0);
let materialUsedContour += Math.min(model.area * wallThickness, model.volume);
let materialUsed = materialUsedInfill + materialUsedContour;
let totalMaterialPrice = (materialUsed*materialDensity*materialPrice +
support.volume*supportPrice*supportDensity*supportInfill)*0.000001;
// hourly rate
let priceOfMachine = 200000; // € or $
let usefulLife = 7; // years
let maintenance = 40000; // € or $
let powerConsumption = 10000; // €/year or $/year
let roomCost = 4000; // €/year/m^2 or $/year/m^2
let space = 10; // m^2
let spareParts = 2000; // €/year or $/year
let gasUsage = 0; // €/year or $/year
let workingHoursPerYear = 3500; // hours/year
let hourlyRate = ((priceOfMachine + maintenance)/usefulLife + powerConsumption +
roomCost*space + spareParts + gasUsage)/workingHoursPerYear;
// machine time
let lineWidth = 0.1; // mm
let layerHeight = 0.1; // mm
let speed = 45; // mm/s
let wallThickness = 2; // mm
let volumeFactor = 0.0010747;
let areaFactor = 0.04317783;
let supportFactor = 0.0003774;
let exponent;
if( model.volume < 3000){
exponent = 0.55;
} else {
exponent = 0.88;
}
let volumePart = volumeFactor*(0.818182 - lineWidth)*(Math.pow(layerHeight, (-1.07)) +
0.232)*(Math.pow(speed, (-1.08)))*(Math.pow(infill*100, (1.02)))*model.volume;
let areaPart = areaFactor*(1.578431 - lineWidth)*(Math.pow(layerHeight, (-0.98)) + 0.341)*
(Math.pow(wallThickness, exponent) + 0.002)*(Math.pow(speed, (-0.84)) +
0.003)*model.area;
let supportPart = supportFactor*supportInfill*support.volume;
let time = volumePart + areaPart + supportPart;
let machineTime = time/60;
// other costs
let labour = 15; // € or $
let platformPreparationCost = 200; // € or $
let otherCosts = labour + platformPreparationCost/item.quantity;
// final unit price
let margin = 0.1;
let price = (totalMaterialPrice + hourlyRate*machineTime + otherCosts)*(1+margin);
price; |