Skip to main content
https://badge.fury.io/py/stlsort.svg https://pypip.in/d/stlsort/badge.png

Some tools such as OpenSCAD produce randomly ordered STL files so source control like git can’t tell if they have changed or not. This tool orders each triangle to start with the lowest vertex first (comparing x, then y, then z). It then sorts the triangles to start with the one with the lowest vertices first (comparing first vertex, second, then third). This has no effect on the model but makes the STL consistent. I.e. it makes a canonical form.

Sort your STL files before committing changes! Add a pre-commit hook like this:

#!/bin/sh
# This was not tested with filenames containing spaces
files=`git diff --cached --name-only --diff-filter=ACM | grep .stl$ | tr '\n' ' '`
if [[ x"$files" != x ]]; then
  stlsort $files
  git add $files
fi

This was created by nop head as a part of Mendel90 repository. Works only for ASCII STLs (convert your STLs from binary to ASCII in pre-commit hook if needed).

Release files for stlsort 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stlsort 0.0.3
File Size Uploaded
stlsort-0.0.3.tar.gz 9.7 kB Details

Release files / stlsort-0.0.3.tar.gz

Download URL stlsort-0.0.3.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1939cf1e212ca8ad1057b1745b7d9451cb5876fcaf3c4362d7963c0d8d7aa6f6
BLAKE2b-256 checksum
How to use checksums
af020fb21923ce1f37362f2caf85c73e99940b03cffc58136260f7dd7d68d250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page