Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit 98f7aa8 May 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Chrage May 10, 2019
test Init commit Apr 29, 2019
.babelrc Init commit Apr 29, 2019
.editorconfig Init commit Apr 29, 2019
.eslintignore Init commit Apr 29, 2019
.eslintrc Init commit Apr 29, 2019
.gitignore Init commit Apr 29, 2019
.npmignore Init commit Apr 29, 2019
README.md Readme May 19, 2019
package.json Init commit Apr 29, 2019

README.md

Ideea


3PS     Ideea.io     Full Documentation     Cheat Sheet


3PS JS SDK

This is the official SDK for the 3PS API. You can use this SDK to create components and objects and start new print jobs.

Installation

$ npm install tps

Getting Started

const TPS = require('3ps-js')
const fs = require('fs')

var tps = new TPS('YOUR_API_KEY')

var component = {
	name: 'Dice',
	is_public: false,
	group_id: '00ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',

	// .stl File
	stl: fs.readFileSync('./dice.stl'),

	// Default Print Settings
	material: 'PLA',
	process: 'FDM',
	resolution: '200',
	infill: '20',
	color: 'Red',
}


// Create Component
tps.components.create(component).then((newComponent) => {

	// Print Component
	tps.print({
		group_id: '00ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
		fulfillment_type: 'standard',
		components: [{
			id: newComponent.id
		}]
	}).then((job) => {
		console.log(`Printing ${job.id}`)
	}) 
})

Methods

This is not a complete list of methods. Please refer to the full documentation for the full list of methods.

TPS.components.create(component)

In 3PS a component represents a single .STL file and an object is a collection of multiple components. Your component can be public or private, public components are accessible by all users and can be printed by anyone. You can also set your component’s default print settings for easy replication.

tps.components.create({
	name: 'Dice',
	is_public: false,
	group_id: '00ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',

	// .stl File
	stl: fs.readFileSync('./dice.stl'),

	// Default Print Settings
	material: 'PLA',
	process: 'FDM',
	resolution: '200',
	infill: '20',
	color: 'Red',
}).then((component) => {

	console.log(component)

})

TPS.print(job)

A job reprsents a request from a customer to print one or more componets. To create a job send an array of objects and compoents with the .print() method

tps.print({
	group_id: '00ffedbb-ff29-5138-9b5d-cd1f6ae3bc6b',
	components: [{
		id: 'cead04bc-cf4f-402a-8e90-1f33669efa03'
	}]
}).then((job) => {

	console.log(`Printing Job: ${job.id}`)

})
You can’t perform that action at this time.