OpenSKP OpenSKP
← Back to Blog

SketchUp Models as AI Training Data: What a .skp Keeps That a Mesh Loses

Most 3D datasets are piles of triangles. A SketchUp file still knows which faces form a chair leg, which material is walnut, and how tall the chair really is. OpenSKP's dataset builder keeps all of that.

If you train models on 3D shapes, you have probably worked with meshes: a list of vertices, a list of triangles, maybe a texture. That is what most 3D datasets give you, because it is what every format can agree on. But a mesh has already forgotten most of what the person who made the model knew.

A SketchUp file hasn't. Open a .skp of a table and chair and it still says that these seven faces are a component called Leg_Table, placed four times inside Table; that each leg is painted Walnut with a Brass foot; that the whole table sits on a tag called Table; and that the chair is 0.86 metres tall, because SketchUp models are drawn at real size. Those are labels, and nobody had to annotate them.

The same chair and table model shown three times, coloured by tag, by material and by component
One public sample file, read by OpenSKP's dataset builder. Each panel colours the same faces by a different label that was already in the file.

What a mesh loses

This isn't a new observation. ShapeNet, one of the best-known 3D datasets, collected many of its models from Trimble's 3D Warehouse, SketchUp's own model library, and used them as polygon meshes. Later work went back and added part labels to those shapes by hand, because the parts the modellers had drawn were no longer there to read.

Here is what a .skp keeps that a converted mesh usually drops:

From a folder of .skp files to arrays

OpenSKP reads .skp files without SketchUp, from SketchUp 3 to the current version. Since 1.8.0 it has a dataset builder that turns a folder of them into records a training pipeline can load directly:

pip install openskp
openskp dataset build ./models ./out

On the two sample models in the OpenSKP repository it prints:

Dataset build complete (2/2 models, 1.74s)
  Partial reads: 0 (files with warnings: 0)
  Failed files:  0
  Faces:         330 (756 triangles, 1416 vertices)
  Labels:        8 tags, 13 materials, 16 definitions, 22 placed instances

The output folder holds one JSON record per model in models.jsonl (and a Parquet table if pyarrow is installed), one NumPy archive per model in arrays/, and a summary.json for the whole run. The arrays are what you train on:

Turning a per-face label into a per-triangle label is one line of NumPy:

import json
import numpy as np

rec = json.loads(open("out/models.jsonl", encoding="utf-8").readline())
arrs = np.load("out/" + rec["arrays_path"])

tags = rec["labels"]["tags"]
tri_tags = arrs["face_tag"][arrs["triangle_face_index"]]   # one tag per triangle

print(rec["source_file"], arrs["vertices"].shape, arrs["triangles"].shape)
print(sorted({tags[i] for i in tri_tags}))
print(rec["labels"]["instance_paths"][2])
chair_and_table.skp (608, 3) (352, 3)
['Chair', 'Table']
ROOT / Table / Leg_Table[0]

The record next to the arrays carries the rest: the scene graph with every definition and placement, material colours and opacity, tag colours, text labels and dimensions, the model camera and every saved scene, in both SketchUp's own inches and glTF's metres.

Built to be rerun

A dataset you can't rebuild exactly is hard to trust, so the builder is strict about it:

What to watch out for

These labels come from people, so they are as tidy as the people who made them. Expect a Leg_Table in one file and leg 1 or Component#12 in the next. Many models leave everything on the default tag, Layer0. The records mark names SketchUp generated itself (name_is_generated), so you can tell them apart from names a person chose. Cleaning the vocabulary is still your job.

OpenSKP ships tools, not models. Whether you may use a set of .skp files to train or evaluate a model depends on where they came from and on their licence and terms of use. That stays with whoever builds the dataset. Model libraries such as 3D Warehouse have their own terms; read them before you download anything for training.

Real-world files also carry more than geometry: user names in texture paths, contributor records, geo-locations. If you build a dataset you plan to share, read What Your SketchUp File Says About You first; OpenSKP can report those traces and write a copy without them.

What comes next

The dataset builder is the first item of a larger toolkit, tracked openly in issue #731:

If you work on 3D learning and one of these would help you, or you need a label that isn't there yet, say so on that issue. The dataset builder is in Python today; the format is plain JSON and NumPy, so it works with whatever you train with.

Build a dataset from your own models

pip install openskp, point it at a folder, and load the result with NumPy, pandas or PyTorch.

Read the dataset guide