Open-source SketchUp (.skp) binary file parser — extract geometry, metadata, layers, and materials
Project description
OpenSKP — Python Package
Open-source SketchUp (.skp) binary file parser. Extract geometry, metadata,
layers, and materials from SketchUp files without requiring SketchUp itself.
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 scene hierarchy
for inst in model.scene_hierarchy:
print(f" {inst.name} → definition #{inst.ref_idx}")
Exporting
from openskp.export import glb, obj, json_export
# Export to GLB (glTF 2.0 binary)
glb.export(model, "output.glb")
# Export to Wavefront OBJ
obj.export(model, "output.obj")
# Export metadata as JSON
meta = json_export.to_dict(model)
json_export.export(model, "output.json")
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, and JSON exporters |
Requirements
- Python ≥ 3.9
- NumPy ≥ 1.20
- Trimesh ≥ 3.0
- Shapely ≥ 1.8
License
MIT — see the root repository for full documentation and multi-language packages.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openskp-0.1.0.tar.gz.
File metadata
- Download URL: openskp-0.1.0.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48ab934102353c221a02974ad05d6315349c329e80513d5b6f5271e6e8e3c4a4
|
|
| MD5 |
aa0d2779c65582edec5f791edde625fe
|
|
| BLAKE2b-256 |
e1587e8cb34cb4fa2820ee31c0fa4928ddef317b4aee7d8d28b24eac59faf7e1
|
File details
Details for the file openskp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openskp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d9487a3bb1fda30ebd8ff4e2efb55a6e0d11d1d676b34b4cb5019e8dd19cf45
|
|
| MD5 |
cd4fc00d812ee4d8d24d91d05c2aa2ab
|
|
| BLAKE2b-256 |
bfa0a695ed3f56819e744115eb5bf96007bf9649a47bf93de1d2d0143090e9ed
|