Skip to main content

OpenSKP

The open-source SketchUp (.skp) file parser — Python edition.

Parse .skp files without SketchUp. No SDK. No license. Just code.

License: MIT PyPI Python Versions

🏠 openskp.com · 🌐 Try the Live Web Viewer · 📖 Docs · Changelog

[!IMPORTANT] This project was built by reverse engineering a proprietary binary format. It is not affiliated with or endorsed by Trimble Inc. or SketchUp.

What is OpenSKP?

OpenSKP is the first and only open-source, cross-platform parser for SketchUp binary files — reverse-engineered from both the modern VFF container (SketchUp 2021+) and the classic MFC CArchive container (SketchUp 2013–2020). It gives you full programmatic access to geometry, materials, components, layers, and metadata, with no SketchUp installation and no proprietary SDK required. The same parser and export API also ship as first-class packages for TypeScript, .NET, Dart, and C++ — see the project README for the full cross-language picture.

Features

  • Full-fidelity parsing — vertices, edges, faces, normals, UV coordinates, nested component hierarchies, layers/tags, materials, textures, styles, and dynamic-component attributes.
  • Both SketchUp file generations — modern VFF (2021+) and legacy MFC (2013–2020) containers, transparently, behind one parse() call.
  • Scene baking — an opt-in build_scene() pass resolves the full placed scene graph to world-space, triangulated, export-ready geometry.
  • Native multi-format export — glTF (GLB), Wavefront OBJ/MTL, STL, PLY, AutoCAD DXF (3DFACE and Polyface Mesh), IFC4 (BIM/ISO 10303-21 STEP), and JSON — all written from scratch, no third-party CAD/BIM SDK involved. The DXF writer is verified against real desktop AutoCAD, not just lenient DXF readers.
  • Streaming / low-memory parsing — peak memory is bounded by the largest single definition, not the whole file.
  • Structured observability — opt-in progress reporting and location-carrying parse errors for debugging malformed or unusual files.

Installation

pip install openskp

Or install from source:

git clone https://github.com/iamahsanmehmood/openskp.git
cd openskp/packages/python
pip install -e .

Quick Start

from openskp import SkpFile

# Parse an SKP file
skp = SkpFile.open("model.skp")
model = skp.parse()

# Inspect layers
for layer in model.layers:
    print(f"{layer.name}: rgb({layer.color_r}, {layer.color_g}, {layer.color_b})")

# Inspect definitions (component geometry)
for defn in model.definitions.values():
    print(f"{defn.name}: {len(defn.faces)} faces, {len(defn.vertices)} vertices")

# Inspect resolved, world-space scene hierarchy (opt-in, heavier)
scene = skp.build_scene()
for inst in scene.scene_hierarchy.children:
    print(f"  {inst.name} [{inst.layer}] @ {inst.position_mm}")

Exporting

from openskp.export import glb, obj, stl, ply, dxf, ifc, json_export

# Export to GLB (glTF 2.0 binary) - takes the SkpFile itself
glb.export(skp, "output.glb")

# Export to Wavefront OBJ (+ companion .mtl) - takes a built Scene
obj.export(scene, "output.obj")

# Export to STL (3D Printing ASCII/Binary)
stl.export(scene, "output.stl", binary=True)

# Export to PLY (Stanford 3D Triangle Mesh)
ply.export(scene, "output.ply", binary=True)

# Export to AutoCAD 3D DXF (AutoCAD R2000 compliant, Polyface Mesh by default)
dxf.export(scene, "output.dxf")

# Export to IFC4 / BIM (ISO 10303-21 STEP ASCII format)
ifc.export(scene, "output.ifc")

# Export metadata as JSON - pass scene= to include the resolved hierarchy
meta = json_export.to_dict(model, scene=scene)
json_export.export(model, "output.json", scene=scene)

Package Structure

Module Purpose
openskp.parser TLV binary parser for SketchUp's internal format
openskp.model Dataclasses for geometry, layers, materials
openskp.vff VFF/ZIP container handling
openskp.geometry Geometry extraction from parsed nodes
openskp.triangulator 3D planar polygon triangulation
openskp.materials Material and layer XML parsing
openskp.metadata Dynamic properties and scene hierarchy
openskp.transforms 3D matrix transforms and coordinate conversion
openskp.export GLB, OBJ/MTL, STL, PLY, DXF, IFC4, and JSON exporters

Requirements

  • Python ≥ 3.9
  • NumPy ≥ 1.20
  • Trimesh ≥ 3.0
  • Shapely ≥ 1.8

Used in Production

OpenSKP powers the SketchUp import pipeline for FrameSmart (a 3D collaboration platform with nearly 200 active users) and IngeTrazo (a SketchUp-alternative 3D modeler with a BIM → IFC bridge). Using OpenSKP in your own project? Open an issue or a PR to get added here.

License

MIT — see the root repository for full documentation and multi-language packages.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openskp-1.0.0.tar.gz (105.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openskp-1.0.0-py3-none-any.whl (87.7 kB view details)

Uploaded Python 3

File details

Details for the file openskp-1.0.0.tar.gz.

File metadata

  • Download URL: openskp-1.0.0.tar.gz
  • Upload date:
  • Size: 105.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for openskp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c874988ebc9037baa25bebd8fc83808b70e944103e2479fa02ad8f74283a21d1
MD5 01decfa88c3f8d69c83d281e7d88eb8d
BLAKE2b-256 2d0c48cd69ecc055bbfacde221983e66de0ed7525008ae8243369c597a3c1457

See more details on using hashes here.

File details

Details for the file openskp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: openskp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 87.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for openskp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f966c25fb2e6db1cdf62132a03bd319f019a3b0baf293ae703c92d58149b0759
MD5 bcbbb5d1d70a7a446e098a5814a06f54
BLAKE2b-256 64c3d10da825f469f201536e1f705b9882aebf3f8aa03a4b2c0fe437e8548484

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.0

2 files

This release

1.0.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page