TutorialΒΆ

Authentise’s Quickslice service makes it easy to slice 3D objects into gcode with the cloud. This service will make it much easier for users to get started with 3D printing by avoiding setting up their own complex toolchain and will provide a single point of integration for various services to do slicing.

Before you get started you’ll want to review the Client Authentication documentation. All of the endpoints discussed in this tutorial will require you to have a valid session which means you’ll need to start by creating a user with Authentise and you’ll need to include the session cookie in every request.

Now, let’s assume you have a really cool model that you want to print. You’ve already uploaded this model to the Authentise 3DIAX. It looks like this:

../_images/logo-simple-frame-translated1.png

Let’s get this thing ready for printing on my trusty Printrbot! That model can be found at https://models.authentise.com/model/f10d27c7-9f1b-41b1-adba-3d9bbad99735/ and is available to the public.

First I’ll need to create a configuration object. This contains information about how I want the slice to proceed.

POST https://quickslice.authentise.com/config/curated/
Content-Type: application/json

{
    "description"       : "My first config",
    "engine"            : "slic3r",
    "parameters": {
        "print_quality"     : "low",
        "material"          : "PLA",
        "filament_diameter" : 1.75,
        "nozzle_diameter"   : 0.4,
    }
}

The response was

Status: 201
Location: http://quickslice.authentise.com/config/5b1387de-529d-415c-a8e6-2527f68f4b5e/

You’ll notice I specified a curated config for this first config. A curated config is one where I specify some high-level settings and the slicing engine figures out the details to pass to use to accomplish my goals. Here I’m specifying that I want to create a configuration for the slic3r engine. I chose slic3r because I’m using a Printrbot. If I were using a Makerbot I would have specified makerbot here since they use their own flavor of gcode.

I’m calling this config My first config - I could have given it any description that is meaningful to me. I set the print_quality to low for this first test. It will make the job a bit faster and I don’t mind the low quality for a tutorial. The rest of the information is pretty basic 3d Printing stuff that I need the slicing engine to know about my printer.

In response to this request I get a 201 status code and a Location header. The Location header points to the newly created config resource and I can use it as many times as I’d like when performing slicing jobs. Let’s take a look at my config resource

GET http://quickslice.authentise.com/config/5b1387de-529d-415c-a8e6-2527f68f4b5e/

{
    "content": "https://prod-quickslice-configs.s3.amazonaws.com:443/5b1387de-529d-415c-a8e6-2527f68f4b5e?Signature=3vNWTVQEZy4hxFgHRzNMTJL4NYM%3D&Expires=1433802722&AWSAccessKeyId=AKIAINRO6B5UV24QSC5Q",
    "description"       : "My first config",
    "engine"            : "slic3r",
    "parameters"        : {
        "bed_temperature"   : 0.0,
        "filament_diameter" : 1.75,
        "infill_density"    : 0.15,
        "infill_speed"      : 40.0,
        "material"          : "PLA",
        "nozzle_diameter"   : 0.4,
        "perimeter_speed"   : 40,
        "perimeters"        : 1,
        "print_quality"     : "low",
        "raft"              : false,
        "support_material"  : false,
    }
}

Here you can see that the engine inserted several default values for me related to the printer. It assumes I have no bed since I didn’t specify one and therefore set the bed temerature to zero. It set some reasonable speeds and infill, etc. The other thing it did was produce a full-blown configuration file that will be passed to slic3r by the engine to service the job. The content property contains a URL where you can download that configuration file. This is useful so that you can download the configuration file yourself, inspect it, modify it, and upload it back to the slicing service. As you print more you’ll gradually establish a library of these configurations with different strengths and weaknesses that you can use for different kinds of prints on different printers.

Let’s say that I already had a slic3r configuration that I’ve been using for printing. I just want to upload this configuration and use it directly on my printer. We can do that too

POST https://quickslice.authentise.com/config/raw/
Content-Type: application/json

{
    "engine"        : "slic3r",
    "description"   : "My raw config",
    "content"       : "small_perimeter_speed = 30\\nvibration_limit = 0\\nperimeter_speed = 40.0...",
}

The response

Status: 201
Location: http://quickslice.authentise.com/config/bf1c87c7-a38d-4de4-946b-01dc8e53a08e/

In this example I’ve included my configuration as part of the JSON payload. The slicing service will do some simple validation on it on then return a Location header to the new config resource that was created to house my configuration. In this case it was https://quickslice.authentise.com/config/XYZ-PDQ/

Like before we can GET the content of that config to look at it

GET http://quickslice.authentise.com/config/d9f26ca9-7560-406b-b318-29063c2f5ccc/

{
    "content": "https://prod-quickslice-configs.s3.amazonaws.com:443/bf1c87c7-a38d-4de4-946b-01dc8e53a08e?Signature=Estv39G2pL1go1J4vl8lPtmaweI%3D&Expires=1433802723&AWSAccessKeyId=AKIAINRO6B5UV24QSC5Q",
    "engine": "slic3r",
    "description": "My raw config",
    "parameters": {
        "perimeter_speed"      : null,
        "nozzle_diameter"      : null,
        "extruder_temperature" : null,
        "bed_temperature"      : null,
        "support"              : null,
        "material"             : null,
        "perimeters"           : null,
        "print_quality"        : null,
        "infill_density"       : null,
        "filament_diameter"    : null,
        "raft"                 : null,
        "infill_speed"         : null
    }
}

Here you see the normal content property where you can download the file you just uploaded, if you’d like. description and engine are there too. The big difference is the parameters. Since you didn’t specify any of the high-level curated parameters and just supplied a file these are all left set to null because there’s no good way to extrapolate backwards to what the parameters should be.

Optionally, you may want to apply constraints to a slicing config. All curated slicing settings are supported. Here, I will ensure that the material used is always PLA:

POST https://quickslice.authentise.com/constraint/
Content-Type: application/json

{
    "name": "Only PLA",
    "description": "Ensure that the material is always PLA",
    "parameters": {
        "material": {
            "equals": "PLA"
        }
    }
}

Response

Status: 201
Location: http://quickslice.authentise.com/constraint/45022d90-6e99-4baf-con-9229c2035115/

I can apply more than one constraint to a model and I can associate more than one model to a constraint. Here, I will associate the model I created with this new constraint:

POST https://quickslice.authentise.com/constraint-model/
Content-Type: application/json

{
    "constraint": "http://quickslice.authentise.com/constraint/45022d90-6e99-4baf-con-9229c2035115/",
    "model_uri": "https://models.authentise.com/model/f10d27c7-9f1b-41b1-adba-3d9bbad99735/"
}

Response

Status: 201
Location: http://quickslice.authentise.com/constraint-model/21b7e3f3-4393-4c39-b885-891d121fca8f/

This will respond with a Location header of the form https://quickslice.authentise.com/constraint-model/<uuid>/. Now, whenever someone tries to print the model and their slicing config doesn’t use PLA for material, slicing the model will not proceed. The request will return a list with errors describing the constraints that were not met.

With that we’re ready to do an actual slicing job. It’s pretty straightforward

POST https://quickslice.authentise.com/slice/
Content-Type: application/json

{
    "model": "https://models.authentise.com/model/f10d27c7-9f1b-41b1-adba-3d9bbad99735/",
    "config": "http://quickslice.authentise.com/config/bf1c87c7-a38d-4de4-946b-01dc8e53a08e/"
}

Response

Status: 201
Location: http://quickslice.authentise.com/slice/45022d90-6e99-4baf-bea5-7249c2835415/

This will respond with a Location header of the form https://quickslice.authentise.com/slice/<uuid>/. I’ve pointed this slice job at the raw config I created above so it will use that configuration when performing the slicing. Note that in this example I’ve used a model URL that points at a model in Authentise’s Model Warehouse. I could just have easily provided a model from any other service provider that contains the same information.

I can poll for changes to see how the slice is progressing using the Location provided

GET http://quickslice.authentise.com/slice/45022d90-6e99-4baf-bea5-7249c2835415/

{
    "content"    : null,
    "slice_time" : null,
    "status"     : "queued",
    "config"     : "http://quickslice.authentise.com/config/bf1c87c7-a38d-4de4-946b-01dc8e53a08e/"
}

This indicates that the slicing job is in the queue but has not yet started. A little bit later I do the same request again and get this response

GET http://quickslice.authentise.com/slice/45022d90-6e99-4baf-bea5-7249c2835415/

{
    "content": null,
    "slice_time": null,
    "status": "processing",
    "config": "http://quickslice.authentise.com/config/bf1c87c7-a38d-4de4-946b-01dc8e53a08e/"
}

The status will come back as processing to indicate it is currently being processed. That means the system is actively generating gcode for this job right now. A little later still I make the request again and get

GET http://quickslice.authentise.com/slice/45022d90-6e99-4baf-bea5-7249c2835415/

{
    "content": "https://prod-gcode.s3.amazonaws.com:443/45022d90-6e99-4baf-bea5-7249c2835415?Signature=37wptJWipVTpva0VRiQ6k86vua8%3D&Expires=1433802923&AWSAccessKeyId=AKIAINRO6B5UV24QSC5Q",
    "slice_time": 589,
    "status": "processed",
    "config": "http://quickslice.authentise.com/config/bf1c87c7-a38d-4de4-946b-01dc8e53a08e/"
}

My job has now moved on to the final status: processed. I can now GET the URL in content and it will give me the gcode for the job. I can also see that my slice took 589 milliseconds in total - pretty fast! In our case we are putting the gcode in S3 and so the content URL will be a signed, time-limited URL for pulling the file from S3. You just have to do a GET request before the link expires to download the g-code. Every time you request this resource the content URL will be regenerated and the time limit reset so you can get your gcode at any time in the future.

Just for completeness, let’s download our finished gcode

GET https://prod-gcode.s3.amazonaws.com:443/45022d90-6e99-4baf-bea5-7249c2835415?Signature=37wptJWipVTpva0VRiQ6k86vua8%3D&Expires=1433802923&AWSAccessKeyId=AKIAINRO6B5UV24QSC5Q
Content-Type: application/octet-stream

; generated by Slic3r 1.0.0RC3 on 2015-03-13 at 14:05:34

; layer_height = 0.3
; perimeters = 2
; top_solid_layers = 4
; bottom_solid_layers = 3
; fill_density = 0.2
; perimeter_speed = 40.0
; infill_speed = 60
; travel_speed = 130.0
; nozzle_diameter = 0.4
; filament_diameter = 1.75
; extrusion_multiplier = 1
; perimeters extrusion width = 0.40mm
; infill extrusion width = 0.42mm
; solid infill extrusion width = 0.42mm
; top infill extrusion width = 0.42mm
; first layer extrusion width = 0.70mm

G21 ; set units to millimeters
M107
M104 S220 ; set temperature
G28 ;home all axis
G29 ;probe bed at 3 pts
G1 Z5 F5000 ; lift nozzle
...

Essentially that’s it! The service is pretty simple. I’ve shown the slic3r flavor of gcode, but there is also a makerbot flavor that can be used for Makerbot’s printers. We’re hoping to get this service integrated into some popular 3D printing tools soon. We’re leaving these services wide open for you to use, so please feel free to use them as much as you’d like for the time being. If there are more slicing engines you’d be interested in us having or any other feedback please let us know by emailing info@authentise.com

You can get the code here