Versions Compared

Key

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

This page contains a listing of available variables under Materials pricing and sample pricing scripts for different technologies.

For a general overview of how Pricing Scripts work, read General Rules for Pricing Scripts - General Usage.

...

.

Pricing to Capture Material Cost

The material is used to print both the part itself and support structures underneath it (when necessary). In case of some of the technologies, the inside of the part will not be filled with the material completely, but instead there will be a repetitive infill structure which will also be included in the material cost calculation.

Table of Contents

General Form for Material Pricing Scripts

The basic form that we recommend for the Javascript code for calculating the material-related cost is:

Code Block
languagejs
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).

Info

Technologies without Walls (SLS; DMLS, MJF)
If there is no wall, one needs to simply put wallThickness = 0 (for example, in SLS, DMLS and MJF all parts are 100% filled with material, hence there is no need to introduce the wallThickness variable).

Info

Technologies without Support
If there are no support structures, one can either remove all variables containing the word "support" from the formula, or simply put supportInfill = 0.

Note

Changing Units
If one decides to choose different units than given above, then it is necessary to appropriately convert the units in the formula. For example, when one changes the units from kg/cm^3 to g/mm^3, a factor of 0.000001 must be added into the formula.

Variables Defined by 3YOURMIND Model Analysis for Material Pricing

This listing are all variables that are derived from each uploaded 3D model.

Variable

Description

model.volume

Volume of the 3D model in mm3

model.area

Area of the 3D model in mm2

model.h

Height of the 3D model in mm

model.w

Width of the 3D model in mm

model.d

Depth of the 3D model in mm

model.shells

Number of separated shells in 3D model

model.box

Bounding box volume of the 3D model in mm3

model.

machine

convex_hull_volume

Convex hull volume of the model in mm3

model.concave_hull_volume

Concave hull volume of the model in mm3, calculated with a max edge length of 55mm

support.volume

Volume of the solid support structures in mm3

support.area

Area of the model connected to support structures in mm2

item.quantity

Quantity of the same geometry in the basket.
(Because the pricing script define a unit price, this variable is needed for quantity-based discounts.

User Properties

See the variable listing under User Based Pricing Scripts

...

Sample Material Pricing Scripts

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.machineconvex_hull_volume * maxPrintTime) / maxVolume * machineRate;
let price = margin * (material + time * machineRate);

// Last line must contain final price
price;

SLA (Accura ClearVue)

Code Block
languagejs
let//Variables maxXYSurfacestarting =with 650keyword * 750;    // dimensions of the printer
"let" are adjustable by customers
let materialCost = 120;          // euro/kg
let density = 1.12;              // g/cm^3
let machineRate = 32;            // euro/hour
let timePerSurface = 0.00001;    // h/mm^2 model’s surface
let margin = 5;                  // total price is multiplied with margin

// Price calculation
let materialmaterialVolume = (model.volume + support.volume * 0.1); 
let material = materialVolume * materialCost * density * 0.000001;
let time = model.area * timePerSurface * machineRate;
let price = margin * (material + time);

// Last line must contain final price
price;

DMLS (Aluminum ALSI10MG)

Code Block
languagejs
//Variables starting with keyword "let" are adjustable by customers
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 modelInfillsupportInfill = 0.21;         // 20%10%
let supportInfilllaserNumber = 0.1;           // 10%
Set number of lasers for multi-laser machines
let factor = 1;


// Price calculation
let machineTimematerialVolume = factor * ((model.volume + support.volume * supportInfill;

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

let machineTime = factor * model.h(materialVolume / layerHeight(printingSpeed) /+ item.quantityrecoatingTime) / 3600;

let price = hourlyRate * machineTime + density * materialVolume * (model.volume + supportInfill * support.volume) * materialCost / 1000000materialCost / 1000000;

// Last line must contain final price
price;