Spark has shut down
Learn More

Fixing 3D models with Spark’s Repair sample app

Many 3D models are printed with multiple defects, which are usually the result of faulty modelling. These flaws can also occur as a result of the software used to produce the STL file.

The good news is that Spark’s APIs fix most of these errors for you (holes, duplicate triangles, degenerate triangles, etc). And our Repair ­­­­­­­­­­­app shows you exactly how we do it. The best part of this sample app, is that you can use it to repair errors from your own 3D models. You can also use the sample code to learn how to integrate the APIs into your own apps, using the Spark JavaScript SDK.

So here are the steps:

  1. Log in to the app.
  2. Choose whether you want to repair one of the premade broken files, a file from the Spark drive or any other STL file.

    ​ ​

  3. Select a file to repair (in this example, one of the premade broken files).
     

  4. The APIs analyze the model’s mesh, and repairs the following defects:
     
    • Holes – An incomplete mesh surface.
    • Degenerate triangles - Triangles with zero area.
    • Duplicate triangles - Triangles with the same vertices.
    • Non-manifold vertices – A vertex adjacent to more than two untwinned edges, or a vertex adjacent to more than two triangles at the same edge.
    • Inconsistently oriented triangles - A triangle edge adjacent to another triangle with the opposite orientation.

      The Repair app gives you a list of all the errors that were found and repaired. You can also select the quick mode option to run this app without displaying information about the defects.
       
  5. Download the repaired model and print!

In addition, before printing, you can use Spark’s print preparation APIs to slice your model and create supports for it. View the Print preparation web app code to see a demonstration of how to use the slicing and support creation APIs.

The Repair app uses a bunch of Spark APIs, and shows you how to create the API requests in a variety of languages. To get started with the Repair app, click here.