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 | ||
---|---|---|
| ||
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 | |||||
---|---|---|---|---|---|---|---|
| Price of the material used to print the part. | $/kg or €/kg | |||||
| Density of the material used to print the part. | g/cm^3 | |||||
| Price of the support material. | $/kg or €/kg | |||||
| Density of the support material. | g/cm^3 | |||||
| Grid structure used to take up space inside an empty 3D print. | 0 <= infill <= 1 | |||||
| Grid structure used to take up space inside support. | 0 <= infill <= 1 | |||||
| Thickness of the model's walls. | mm |
Info |
---|
Technologies without Walls (SLS; DMLS, MJF) |
Info |
---|
Technologies without Support |
Note |
---|
Changing Units |
Variables Defined by 3YOURMIND Model Analysis for Material Pricing
...
This listing are all variables that are derived from each uploaded 3D model.
...