Advanced Onboarding

In this tutorial we'll walk through getting started using the KITTYCAD API

The Litterbox

KittyCAD offers client libraries in Python and other languages, and our "Litterbox" below is our mini in-browser editor for demonstrating with code snippets. Try executing the python STL conversion code below. You should see the 3d-file re-appear on the right-hand side along with logs from the execution.

lib version: 0.5.3
Sign into execute

Now try modifying the code and executing it again. As an example, delete the "#" to the left of "print(<your-name>, congrats! Your STL conversion was successful):" and replace <your-name> with your first name.

Then execute. If you came to this tutorial from Account Onboarding Progress than you'll need to modify and execute the code in order for it to count as completing the second task.

Executing from your machine

Again we're going to use python as an example, but if you're comfortable with installing libraries for Go, Javascript or Rust, instructions for installing them can be found here.

You will need to have Python installed on your machine, this will depend on your operating-system, but instructions can be found on the Python website.

Create a new folder where you'd like to setup your test project, and add three text files.

The first will be called requirements.txt and will have the following inside.

The second will be called convert.py and will have the following inside

Lastly we'll add a very basic .obj file called cube.obj and add the following contents

Then open a PowerShell or Bash terminal depending on your operating-system and navigate to the folder you recently created and run the following:

You should see the following message printed in your terminal:

File conversion id: <your-conversion-id>
File conversion status: Completed
Saving output to ./output.stl

Note that the python3 command might differ depending on what version you've got installed.

Well done, you've completed all of the onboarding. Have a look around the other tutorials and docs.

Found a typo?