Identify and annotate thin (narrow) regions in STL meshes.
Project description
ThinSkin
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:
- Ray-cast thickness — casts a ray inward along the inverted vertex normal and measures the distance to the nearest opposing surface.
- 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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thinskin-0.1.0.tar.gz.
File metadata
- Download URL: thinskin-0.1.0.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2737679b4e1b8c1840603962ae6939accb8be10f2a9b2dc1a90c4b3a4a675480
|
|
| MD5 |
bba62674c52028a11dd5861e58d5eb62
|
|
| BLAKE2b-256 |
17278fe79a0515719c84a6258311eb37bf82d2127bbb0133eb3bd1d6123beb29
|
Provenance
The following attestation bundles were made for thinskin-0.1.0.tar.gz:
Publisher:
publish.yml on SemiQuant/ThinSkin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thinskin-0.1.0.tar.gz -
Subject digest:
2737679b4e1b8c1840603962ae6939accb8be10f2a9b2dc1a90c4b3a4a675480 - Sigstore transparency entry: 1983623569
- Sigstore integration time:
-
Permalink:
SemiQuant/ThinSkin@5c221549b245354ef032096d48f368c27e20c9f5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SemiQuant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c221549b245354ef032096d48f368c27e20c9f5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file thinskin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: thinskin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04be2b88196a53c036c4cd97d60f5002f7796a2c21d625fe4637df8033526d35
|
|
| MD5 |
502ba5bca305bbd303bb94393f1aa935
|
|
| BLAKE2b-256 |
41e20e7fa3d5d1a6656ff1dd3516f833d5874b1431b4096496b2047d4c1accd7
|
Provenance
The following attestation bundles were made for thinskin-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on SemiQuant/ThinSkin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thinskin-0.1.0-py3-none-any.whl -
Subject digest:
04be2b88196a53c036c4cd97d60f5002f7796a2c21d625fe4637df8033526d35 - Sigstore transparency entry: 1983623872
- Sigstore integration time:
-
Permalink:
SemiQuant/ThinSkin@5c221549b245354ef032096d48f368c27e20c9f5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SemiQuant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5c221549b245354ef032096d48f368c27e20c9f5 -
Trigger Event:
push
-
Statement type: