Post Processing Pricing Scripts
This page contains a listing of available variables for pricing Post Processing and includes sample pricing scripts for different processes.
For a general overview of how Pricing Scripts work, read https://3yourmind.atlassian.net/wiki/spaces/PD/pages/87916845 .
Variables Available for Pricing of Post-Processing
This listing are all variables that are derived from each uploaded 3D model.
Variable | Description |
|---|---|
| Volume of the 3D model in mm3 |
| Area of the 3D model in mm2 |
| Height of the 3D model in mm |
| Width of the 3D model in mm |
| Depth of the 3D model in mm |
| Number of separated shells in 3D model |
| Bounding box volume of the 3D model in mm3 |
| Convex hull volume of the model in mm3 |
| Concave hull volume of the model in mm3, calculated with a max edge length of 55mm |
| Volume of the solid support structures in mm3 |
| Area of the model covered by support structures in mm2 |
| Quantity of the same geometry in the basket. |
User Properties | See the variable listing under https://3yourmind.atlassian.net/wiki/spaces/PD/pages/87982464 |
Pricing of Adding Inserts
For post-processing methods of type “Adding Inserts”, the following additional variables are available.
Variable | Description |
|---|---|
| The total count of inserts chosen by the customer. |
| An object with the quantity per chosen size. Example
|
Here is an example pricing script that shows how to use both the individual unit price and the total count of inserts.
let basePrice = 0;
const prices = {
"M2 x 0.4": 0.1,
"M2.5 x 0.45": 0.2,
"M3 x 0.5": 0.3,
"M3.5 x 0.6": 0.4,
"M4 x 0.7": 0.5,
"M5 x 0.8": 0.6,
"M6 x 1": 0.7,
"M8 x 1.25": 0.8,
"M10 x 1.5": 0.9,
"M12 x 1.75": 1.0,
"1/2-13": 1.1,
"1/2-20": 1.2,
"1/4-20": 1.3,
"1/4-28": 1.4,
"2-56": 1.5,
"3/8-16": 1.6,
"3/8-24": 1.7,
"4-40": 1.8,
"5/16-18": 1.9,
"5/16-24": 2.0,
"6-32": 2.1,
"8-32": 2.2,
"10-24": 2.3,
"10-32": 2.4
};
if (pp.add_inserts && pp.add_inserts.quantity) {
for (const size in pp.add_inserts.quantity) {
const qty = pp.add_inserts.quantity[size] || 0;
const price = (prices.hasOwnProperty(size) ? prices[size] : 9.9); // high default for unknown
basePrice += qty * price;
}
}
if (pp.add_inserts && pp.add_inserts.total_quantity >= 10) {
basePrice *= 0.9; // 10% discount
}
basePrice