Versions Compared

Key

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

...

...

Code Block
languagejs
let price = model.volume * 0.0002;  // model.volume in cubic mm

// Add a 10% Discount when ordering more then 10 items
if(item.quantity > 10) {
    price = price * 0.90;
}

// Provide a 5% Discount for Users with a @3yourmind Address
else if(user.email && user.email.endsWith('@3yourmind.com')) {
    price = price * 0.95;
}

// 90$ Discount if price is above 1500
else if(price > 1500) {
    price = price - 90;
}

price; // last line contains final price

Accounting for Additional Costs

Additional costs that are generated by your business can also be accounted for, one of the most common being labor costs for preparing build platforms.

Code Block
let labor = ;
let platformPreparationCost = ;

let otherCosts = labor + platformPreparationCost/item.quantity;
Info

In this case platform preparation cost is calculated per part (this is why platformPreparationCost variable is divided by item.quantity).

Variable

Description

Unit

Code Block
labour

Costs related to all work done by people when preparing the part for printing.

$ or €

Code Block
platformPreparationCost

Cost of preparing the printer (e.g. of warming up the powder bed).

$ or €