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.
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:
- Components and groups: named, reusable parts, nested like a real assembly (
Chair → Backrest → BackrestCushion), with a transform for every placement. - Tags (layers): how the modeller organised the model: furniture, walls, landscape, electrical.
- Named materials: Oak, Brass, Charcoal Linen, not
material_07, with the texture and its real tile size. - Real units: SketchUp stores inches, so sizes are physical, not normalised to a unit cube.
- Flat faces with holes: a wall with a window opening is one face with a hole, not a fan of triangles.
- Text: model and component names and descriptions, text labels, dimension texts, attribute dictionaries.
- Cameras: saved scenes with the view the modeller chose to present.
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:
vertices,normals,uvsandtriangles, in world space, in metres;triangle_face_index, which maps each triangle back to the SketchUp face it came from;- one label per face:
face_tag,face_material,face_back_material,face_definitionandface_instance_path; - a 4×4 local and world transform for every placed component.
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:
- Same input, same bytes out. Files are processed in a fixed order, labels are sorted, and nothing in the output carries a timestamp.
- One process per file, with a timeout. A huge or broken model can't take the whole run down; it is stopped and listed in
summary.jsonwith the reason. - Honest about partial reads. If an old file can only be read in part, its record says so (
partial_read,unread_root_entities) instead of quietly passing on half a model.
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:
- labelled point clouds, sampled from the surfaces with the same labels;
- a face graph, with faces as nodes and shared edges as links;
- models as code: a compact script that rebuilds a model, so a language model can read and write SketchUp models as text;
- an evaluation kit for generated models, and an MCP server so an agent can open, measure and edit a
.skp.
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.