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.

Pricing of 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 = ;
let materialDensity = ;
let supportPrice = ;
let supportDensity = ;
let infill = ;
let supportInfill = ;
let wallThickness = ;

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;
Warning

Do not change the final two lines of code:

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;

Each variable can then be defined with a constant value or mathematical calculation using available variables from the 3YOURMIND model analysis (next section).

Variable

Description

Unit

Code Block
languagejs
materialPrice

Price of the material used to print the part.

$/kg or €/kg

Code Block
languagejs
materialDensity

Density of the material used to print the part.

g/cm^3

Code Block
supportPrice

Price of the support material.

$/kg or €/kg

Code Block
languagejs
supportDensity

Density of the support material.

g/cm^3

Code Block
languagejs
infill

Grid structure used to take up space inside an empty 3D print.

0 <= infill <= 1

Code Block
languagejs
supportInfill

Grid structure used to take up space inside support.

0 <= infill <= 1

Code Block
languagejs
wallThickness

Thickness of the model's walls.

mm

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.

...