Versions Compared

Key

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

...

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_volume (deprecated in 4.11)

Convex hull volume of the model in mm3

model.convex_hull_volume (since 4.11)

Convex hull volume of the model in mm3

model.concave_hull_volume (since 4.11)

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

...

Code Block
languagejs
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;
let price = margin * (material + time * machineRate);

// Last line must contain final price
price;

...