3D File Diffs

Image of Mike Skalnik

Back in April, we introduced the 3D file viewer. Today we’re
improving this by displaying diffs of STL files on
GitHub.

spindle-diff

There are two modes to figure out what you’re looking at. By default, we select
“Highlight”, a mode that highlights the removed parts in red and the added parts
in green, leaving what is unchanged as a wireframe.

Also available is the revision slider, which lets you transition between the
current version of the file, and the previous one with a small slider at the top
of the viewer.

revision-slider

How does this work? We take both versions of the model, and using binary
space partitioning
, we compute the added, removed, and unchanged
parts. This is done using csgtool, a C library paired with a Ruby gem
via FFI. These pieces are cached and displayed by the 3D viewer we already have,
though we color them differently and play with their transparency to help
illustrate the changes. If you have any further questions, check out the help
article.

We see this as a step for making it easier for you to use GitHub for your open source
hardware needs.

Join us at GitHub Universe

Our largest product and community conference is returning to the Palace of Fine Arts in San Francisco, November 13-14. Hear what's next for the GitHub platform, find inspiration for your next project, and connect with developers who are changing the world.

Get tickets

GitHub Actions now supports CI/CD

GitHub Actions makes it easier to automate how you build, test, and deploy your projects on any platform, including Linux, macOS, and Windows. Try out the beta before GitHub Actions is generally available on November 13.

Sign up for the beta