Versions Compared

Key

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

...

This section contains sample scripts based on specific technologies and materials.
These pricing scripts can be copied directly into the platform and the variables can be adjusted according to your specific workflow and pricing.

FDM (ABS)

Code Block
languagejs
//Variables starting with keyword "let" are adjustable by customers
//Material cost
const materialPrice = 70 // € or $
const materialDensity = 1.29 // g/cm^3
const supportPrice = 30 // €/kg or $/kg
const supportDensity = 1.29 // g/cm^3
const infill = 0.7 // number in [0,1]
const supportInfill = 0.3 // number in [0,1]
const wallThickness = 1 // mm

const partVolume = model.volume;
const surfaceArea = model.area;
const supportVolume = support.volume;

const materialUsedInfill = Math.max((partVolume - surfaceArea * wallThickness) * infill, 0)
const materialUsedContour = Math.min(surfaceArea * wallThickness, partVolume)
const materialUsed = materialUsedInfill + materialUsedContour
const totalMaterialPrice =
	(materialUsed * materialDensity * materialPrice +
		supportVolume * supportPrice * supportDensity * supportInfill) *
	0.000001

// final unit price
const margin = 3;
let price = totalMaterialPrice * margin;
price;

SLS (PA12)

Code Block
languagejs
//Variables starting with keyword "let" are adjustable by customers
let maxVolume = 380 * 284 * 380; // dimensions of the printer
let materialCost = 60;           // euro/kg
let density = 1.02;              // g/cm^3
let machineRate = 50;            // euro/hour
let maxPrintTime = 14;           // printing time of a full building chamber
let margin = 5;                  // total price is multiplied with margin

// Price calculation
let material = model.volume * materialCost * density * 0.000001;
let time = (model.convex_hull_volume * maxPrintTime) / maxVolume;
let price = margin * (material + time * machineRate);

// Last line must contain final price
price;

...