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 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

--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 \
    --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,
    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.1.3.tar.gz (6.1 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.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for passthrough_fidget_generator-0.1.3.tar.gz
Algorithm Hash digest
SHA256 14254c460e811ce6b0ff7bb0d781229d69fd23c9a8343e1f246edd03860c1c28
MD5 17c86578b549fedd790ec2363adf9663
BLAKE2b-256 970bb24d5a0b31db9d5cc6dca302469c2a7b1ea33f8d5a32ac159a78c1415877

See more details on using hashes here.

Provenance

The following attestation bundles were made for passthrough_fidget_generator-0.1.3.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.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for passthrough_fidget_generator-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3fa39c2b2095815fa3172b4656af6e0f6921745936991dc2a226ada2374c8049
MD5 1f9ed0a6d7009c7367baff175e0dc96f
BLAKE2b-256 0bcf5cf9436329f637d3538fa05491b8a2c7943e753ce4fdd8b82ed5d0ca498e

See more details on using hashes here.

Provenance

The following attestation bundles were made for passthrough_fidget_generator-0.1.3-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

0.2.0

2 files

This release

0.1.3 This release

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