OpenSKP OpenSKP
← Back to Blog

OpenSKP 1.8.0: Write SketchUp 2021+ Files, With Nothing Made by SketchUp Inside

The biggest release since the writer arrived: OpenSKP now writes the file format SketchUp itself saves today, and no package carries a file that SketchUp made.

OpenSKP 1.8.0 is out on PyPI, npm, NuGet and pub.dev, and as a C++ release on GitHub. The Rust port carries the same version in the repository. This post walks through what is new; the release notes have the full list and the upgrade notes.

Left: Python code that writes a SketchUp 2021+ file with create_vff. Right: what SketchUp's own library reads back from that file.
A model written by the 1.8.0 package from PyPI, and what SketchUp's own library counts when it opens the file.

Write the format SketchUp saves today

SketchUp has two file formats. Files from SketchUp 2020 and earlier use the classic one; SketchUp 2021 changed to a new container, and every version since saves that. OpenSKP has read both for a long time, but its writers only produced the classic format, as a SketchUp 2017 file. That works, because every SketchUp since 2017 opens it, but it was always the older format.

From 1.8.0, Python and TypeScript can write the current one:

from openskp import create_vff

b = create_vff()
oak = b.add_material("Oak", (198, 161, 116))
furniture = b.add_layer("Furniture")

with b.add_component_definition("Leg") as leg:
    leg.add_face([(0, 0, 0), (2, 0, 0), (2, 2, 0), (0, 2, 0)], material=oak)

b.add_instance(leg, translation=(10, 0, 0), layer=furniture)
b.add_scene("Front", (50, -300, 60), (50, 0, 40))
b.save("table.skp")

create_vff() in Python and createVff() in TypeScript cover faces with holes, materials and textures, tags, components and groups, curves, attributes, texts, dimensions, guides, section planes and scenes. The Python writer was contributed by @zbyte64; the TypeScript one follows it so closely that the two give the same bytes for the same model, and the tests compare them on every change. .NET, Dart, C++ and Rust still write the classic format; the new writer is on the list for them.

Nothing made by SketchUp inside

A writer has to start from something. Until now, each of ours started from a small empty document that SketchUp's own library had saved, and that file travelled inside every package. It was a few kilobytes, but it was not ours.

In 1.8.0 every writer builds its empty document in code, in all six languages. No package holds a file that SketchUp saved. One thing you will see: new files open with OpenSKP's own defaults, a plain white style, no geo-location and decimal units, in place of SketchUp's template.

A command line

You no longer need to write a script to look into a file or convert it:

pip install openskp

openskp info house.skp
openskp convert house.skp house.glb
openskp convert house.skp house.ifc

The npm package has the same two commands as npx openskp. The Python side was started by @isyanpcr, the TypeScript side by @andretorresdg.

Tools for datasets and for privacy

Two additions in Python go beyond reading and writing, and each has its own post:

Python also exports COLLADA (.dae) and Google Earth KMZ now, thanks to @richard-epsilla.

Closer to what SketchUp shows

A large part of this work in C++ is by @thomasloockx, and @sunwards-art added cameras and scenes to the C++ writer.

Before you upgrade

Code that only reads a model rarely has to change, but results differ in three ways you may notice:

The upgrade notes list the rest, language by language.

The add-ons

The Blender and FreeCAD add-ons have had releases of their own: Blender 0.5.0 fixes importing when Blender's interface is not in English, and FreeCAD 0.4.0 imports SketchUp's component hierarchy as parts and links. Both still carry OpenSKP 1.7.0 inside; their next versions will move to 1.8.0.

Thank you

This release has code, examples and documentation from @zbyte64, @isyanpcr, @andretorresdg, @richard-epsilla, @thomasloockx, @sunwards-art, @vantruong-dang and @rayw-lab, and bug reports from many more. If something in 1.8.0 does not work for your files, open an issue; a file that fails is the most useful thing you can send.

Get 1.8.0

pip install openskp, npm install openskp, dotnet add package OpenSkp, dart pub add openskp, or the C++ and Rust sources.

All downloads