Skip to main content

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


Download files

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

Source Distribution

openskp-0.2.0.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

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

openskp-0.2.0-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openskp-0.2.0.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openskp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d8895dc95bbeb7eff7ff49980be3c06487c094177f8e86351ef7fd9cf7613210
MD5 7e4129631ae32d48281e4dab4891d4ef
BLAKE2b-256 aaa45274672a56bab1402b39b6d86295c9fbf7eb2df0241cb380308d7e317e1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openskp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openskp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2eba23ae78c1b13aaeade64e36c67a4265f95e4b7acb29e1a5cd81181b0a9a41
MD5 88bfb1c514328c8e0e48994cfabb7312
BLAKE2b-256 aad17eb6e159a61b9e025954364edcbb25eecf7ae15ca31cb938384b823f6de9

See more details on using hashes here.

Supported by

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