Skip to content

Instantly share code, notes, and snippets.

@anthonybudd
Last active April 22, 2019 21:19
Show Gist options
  • Save anthonybudd/cc2d2118489f406109b9e328871f46be to your computer and use it in GitHub Desktop.
Save anthonybudd/cc2d2118489f406109b9e328871f46be to your computer and use it in GitHub Desktop.
const TPS = require('3ps-js')
const fs = require('fs')
var tps = new TPS('YOUR_API_KEY')
tps.components.create({
name: 'Dice',
group_id: '00ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
is_public: false,
stl: fs.readFileSync('./dice.stl'),
// Default Print Settings
material: 'PLA',
process: 'FDM',
resolution: '200',
infill: '20',
color: 'Red',
}).then(function(component) {
// Print
tps.print({
group_id: '00ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
fulfillment_type: 'standard',
components: [{
id: component.id
}]
}).then(function (job) {
console.log(`Printing ${job.id}`)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment