Skip to main content

Passthrough Fidget Generator

Generate interlocking passthrough fidgets from existing 3D models.

The generator takes an existing STL, OBJ, or PLY model and splits it into two interlocking pieces using a smooth curved interface. The resulting pieces can be printed separately and assembled into a passthrough fidget.

Features

  • Generate passthrough fidgets from existing 3D models
  • Smooth mathematical curved interfaces
  • Configurable clearance
  • Configurable waves
  • Configurable twists
  • Configurable radius scale
  • Configurable radial resolution
  • Configurable height resolution
  • STL output
  • Command-line interface
  • Python API

Installation

Install from PyPI:

pip install passthrough-fidget-generator

Command Line

Basic usage:

passthrough-fidget-generator model.stl

Specify an output directory:

passthrough-fidget-generator model.stl -o output

Parameters

--clearance

Sets the gap between the two pieces.

--clearance 0.3

The value uses the same units as the input model.

--waves

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

--waves 1.5

--twists

Controls how many rotations the interface makes around the model.

--twists 2

--radius

Sets the base radius of the spiral cutout.

--radius 2.0

The value uses the same units as the input model. If set to 0 (default), the radius is calculated automatically.

--radius-scale

Controls the fraction of the model's smaller XY extent used for the spiral cutout radius when --radius is 0.

--radius-scale 0.4

Larger values produce a wider cutout. The default is 0.35.

--radial-samples

Controls the resolution around the curved interface.

--radial-samples 128

Higher values produce smoother surfaces but require more processing.

--height-samples

Controls the resolution along the height of the interface.

--height-samples 64

Higher values produce smoother surfaces but require more processing.

Example

passthrough-fidget-generator model.stl \
    --clearance 0.3 \
    --waves 1.5 \
    --twists 2 \
    --radius-scale 0.4 \
    --radial-samples 128 \
    --height-samples 64 \
    -o output

Python API

The generator can be used directly from Python:

from passthrough_fidget_generator import generate_from_file

paths = generate_from_file(
    "model.stl",
    output="output",
    clearance=0.3,
    waves=1.5,
    twists=2,
    radial_samples=128,
    height_samples=64,
)

You can also work directly with a trimesh.Trimesh object:

from passthrough_fidget_generator import generate

inner, outer = generate(
    mesh,
    clearance=0.3,
    waves=1.5,
    twists=2,
    amplitude=0.0,
    radius=0.0,
    radius_scale=0.35,
    radial_samples=128,
    height_samples=64,
)

Input Models

The input should be a closed, watertight solid.

Supported formats depend on the underlying trimesh installation, including:

  • STL
  • OBJ
  • PLY

Non-watertight or invalid meshes may fail during the boolean operations used to create the pieces.

How It Works

The generator:

  1. Loads the input mesh.
  2. Creates a smooth mathematical interface through the model.
  3. Uses boolean operations to divide the original model along that interface.
  4. Applies the requested clearance.
  5. Extracts the resulting inner and outer pieces.
  6. Writes the generated meshes as STL files.

The interface is generated mathematically rather than using voxelization, allowing the resulting pieces to have smooth curved surfaces.

Dependencies

The project uses:

  • NumPy
  • SciPy
  • Trimesh
  • Manifold3D
  • scikit-image
  • NetworkX

These dependencies are installed automatically when installing from PyPI.

Development

Clone the repository:

git clone https://github.com/gooficat/passthrough_fidget_generator.git
cd passthrough_fidget_generator

Create a virtual environment:

python -m venv .venv
source .venv/bin/activate

Install the package in editable mode:

pip install -e .

Run the tests:

pytest

Building

Build the package with:

python -m build

The distribution files will be created in:

dist/

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.2.0.tar.gz (7.5 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.2.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for passthrough_fidget_generator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cdd06b8455bf76550828745512c142b18a777dfaa2148a2b692b02ad590ef62f
MD5 d2045b31ccc976233cf3543938861abd
BLAKE2b-256 c1fcb893bddb55e1dfa79ffdaf455f141d2b7e31455d37db4a2dc6a8d2c8831d

See more details on using hashes here.

Provenance

The following attestation bundles were made for passthrough_fidget_generator-0.2.0.tar.gz:

Publisher: publish.yml on gooficat/passthrough_fidget_generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for passthrough_fidget_generator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a817b464ea0db24370df0e999e71ac40fa69eb0674e7ab1b2c4649aedff14c7
MD5 bf9a44a8009659c01d81ca3be94253a1
BLAKE2b-256 ed2e5ecb9909c2e3f043a9ab11b3eaa9396298839bc833fc0bd8376729ca8d87

See more details on using hashes here.

Provenance

The following attestation bundles were made for passthrough_fidget_generator-0.2.0-py3-none-any.whl:

Publisher: publish.yml on gooficat/passthrough_fidget_generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.3

2 files

0.1.1

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