Skip to main content

Passthrough Fidget Generator

A Python generator for creating interlocking passthrough fidgets from existing 3D models.

The generator takes a watertight STL/OBJ/PLY model and creates two separate meshes:

  • inner.stl — the inner/interlocking piece
  • outer.stl — the surrounding piece
  • combined.stl — both pieces together for inspection

The interlocking boundary is generated from a mathematical curved surface rather than voxelizing the model.

Requirements

  • Python 3.10+
  • NumPy
  • Trimesh
  • Manifold3D

Install the dependencies with:

pip install numpy trimesh manifold3d

Usage

Basic example:

python main.py model.stl

This creates:

output/
├── inner.stl
├── outer.stl
└── combined.stl

Example

python main.py "xyz-10mm-calibration-cube (1).stl" \
    --clearance 0.3 \
    --waves 1.5 \
    --twists 2 \
    --radial-samples 128 \
    --height-samples 64 \
    -o output

Options

--clearance

Controls the gap between the two pieces.

--clearance 0.3

The value uses the same units as the input model. For an STL in millimetres, this is 0.3 mm.

Typical starting values:

0.2 mm  Tight
0.3 mm  Normal
0.4 mm  Loose
0.5 mm  Very loose

The correct value depends on the printer and material.

--waves

Controls the number of waves along the height of the model.

--waves 1.5

Higher values produce more interlocking sections.

--twists

Controls how much the wave rotates around the object.

--twists 2

Higher values create more twisting between the inner and outer pieces.

--amplitude

Controls how far the curved interface moves from its base radius.

--amplitude 1.0

If omitted or set to 0, the generator chooses an amplitude automatically.

--radius

Controls the base radius of the curved interface.

--radius 2.5

If set to 0, the radius is calculated automatically from the input model.

--radial-samples

Controls the number of points around the curved surface.

--radial-samples 256

Higher values produce a smoother circular direction but increase processing time and STL size.

--height-samples

Controls the number of points along the height of the curved surface.

--height-samples 128

Higher values produce a smoother vertical curve.

Recommended Resolution

For testing:

--radial-samples 128 --height-samples 64

For a smoother final model:

--radial-samples 256 --height-samples 128

For very smooth surfaces:

--radial-samples 512 --height-samples 256

Higher resolutions create significantly more triangles.

How It Works

The interlocking surface is based on a mathematical function:

r(θ,z) = R + A sin(kz + nθ)

where:

  • R is the base radius
  • A is the wave amplitude
  • k controls the vertical waves
  • n controls the angular twisting

The surface is sampled directly and converted into a triangle mesh.

This is different from voxel-based generation.

Voxel approach

Model
  ↓
Voxel grid
  ↓
Marching cubes
  ↓
STL

This can produce stepped or blocky surfaces depending on voxel resolution.

This approach

Mathematical surface
  ↓
Direct surface sampling
  ↓
Triangle mesh
  ↓
STL

The underlying interface is therefore a continuous mathematical curve, with the STL triangles only approximating that curve.

Input Models

The input should preferably be:

  • Watertight
  • A single solid
  • A reasonably clean mesh
  • Suitable for boolean operations

For example:

model.stl

or:

model.obj

A model containing holes, self-intersections, or disconnected geometry may produce incorrect results.

Output

inner.stl contains the inner piece.

outer.stl contains the outer piece.

combined.stl contains both meshes in their generated positions and is useful for checking the result in a slicer or mesh viewer.

The two individual STLs should normally be exported separately for printing.

Printing

The generated parts are intended to be printed as separate pieces.

The most important setting is clearance. A printer with poorer dimensional accuracy may require a larger clearance.

A reasonable first test is:

Clearance: 0.3 mm

If the pieces are too tight:

0.4–0.5 mm

If they are excessively loose:

0.2–0.25 mm

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

passthrough_fidget_generator-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

passthrough_fidget_generator-0.1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file passthrough_fidget_generator-0.1.1.tar.gz.

File metadata

File hashes

Hashes for passthrough_fidget_generator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8900a7edf74a93722169ff9c2a25d93d5ac64bea7f572d28bcf4a314798661c3
MD5 762dfec14cca089387585f84d36919d8
BLAKE2b-256 5a7a3442ba49a8231d9ce88f792f6195ff858514dd6f96a6d24f8661cfbf1e38

See more details on using hashes here.

File details

Details for the file passthrough_fidget_generator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for passthrough_fidget_generator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c95c7a7c39ef6fd33e4da82fd025141773c22a2ebf86bc75c02529e4678e150
MD5 544bf1d82b0017c1c6443f8aee38590e
BLAKE2b-256 a7e1767c5dbdda79af4e9f4dbb778e73d18a0dd7baf21a8b51b6a9c8f71baf64

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.3

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

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