Skip to main content

ThinSkin

PyPI version Python versions License: MIT

ThinSkin analyses an STL mesh and identifies regions where the local geometry is thinner than a specified diameter threshold — handy for checking 3D-print wall thickness, minimum feature sizes, and structurally fragile areas before manufacturing.

How it works

For every vertex in the mesh, ThinSkin estimates the local inscribed diameter using two complementary approaches and takes the minimum of the two as the effective local diameter:

  1. Ray-cast thickness — casts a ray inward along the inverted vertex normal and measures the distance to the nearest opposing surface.
  2. Local curvature radius — derived from the mean curvature at each vertex via the cotangent-weighted Laplacian.

Vertices whose effective diameter falls below the threshold are flagged as narrow.

Installation

pip install thinskin

ThinSkin uses trimesh for ray casting, which relies on rtree (bundled libspatialindex). If you hit native-library issues, install via conda/mamba:

micromamba install -c conda-forge rtree
pip install thinskin

From source

git clone https://github.com/SemiQuant/ThinSkin.git
cd ThinSkin
pip install -e ".[dev]"

Usage

Command line

thinskin model.stl --diameter 2.0

Options:

Option Alias Default Description
--diameter -d 2.0 Minimum diameter threshold (mm).
--output -o <input>_narrow.stl Output STL path.
--version -V Print version and exit.
--help -h Show help and exit.

You can also run it as a module:

python -m thinskin model.stl -d 1.5

Outputs

For an input model.stl, ThinSkin writes (when narrow regions are found):

File Description
model_narrow.stl Mesh containing only the flagged (narrow) faces — overlay in MeshLab.
model_narrow_coloured.obj Full mesh with per-vertex colours (red = narrow, green = OK).
model_narrow_annotated_views.png CAD-style 2×2 multi-view annotated report.

The console also prints mesh stats, a results summary, and a diameter distribution histogram as tables.

Python API

import thinskin

mesh = thinskin.load_mesh("model.stl")
eff_diam, thickness, curv_radius = thinskin.compute_effective_diameter(mesh)

threshold = 2.0
narrow = eff_diam < threshold
print(f"{int(narrow.sum())} narrow vertices below {threshold} mm")

# Render the annotated report
thinskin.generate_annotated_report(mesh, eff_diam, threshold, "model_narrow.stl")

Requirements

  • Python ≥ 3.9
  • click, numpy, scipy, trimesh, rtree, matplotlib

License

MIT © SemiQuant (Jason Limberis)

Metadata

Release files for thinskin 0.1.0

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

Source distribution (sdist)

Source distribution for thinskin 0.1.0
File Size Uploaded Provenance Actions
thinskin-0.1.0.tar.gz 10.6 kB With provenance Details for thinskin-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for thinskin 0.1.0
File Interpreter ABI Platform Actions
thinskin-0.1.0-py3-none-any.whl Python 3 none any Details for thinskin-0.1.0-py3-none-any.whl

Total release size: 23.6 kB

Release files / thinskin-0.1.0.tar.gz

Download URL thinskin-0.1.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2737679b4e1b8c1840603962ae6939accb8be10f2a9b2dc1a90c4b3a4a675480
BLAKE2b-256 checksum
How to use checksums
17278fe79a0515719c84a6258311eb37bf82d2127bbb0133eb3bd1d6123beb29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 27, 2026.

Transparency log

Release files / thinskin-0.1.0-py3-none-any.whl

Download URL thinskin-0.1.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04be2b88196a53c036c4cd97d60f5002f7796a2c21d625fe4637df8033526d35
BLAKE2b-256 checksum
How to use checksums
41e20e7fa3d5d1a6656ff1dd3516f833d5874b1431b4096496b2047d4c1accd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 27, 2026.

Transparency log

Security for thinskin 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for thinskin-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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