Gridfinity Rebase
CLI for replacing Gridfinity bin bases with configurable presets or a base copied from another STL.
Install
Available on PyPI as gridfinity-rebase.
Requires Python 3.10+.
With uv
Use uv to run the CLI without installing it permanently:
uvx gridfinity-rebase bin.stl --preset magnet-holes
Or install it as a command available from any directory:
uv tool install gridfinity-rebase
gridfinity-rebase bin.stl --preset magnet-holes
With pip
Create and activate a virtual environment, then install the package:
python -m venv .venv
source .venv/bin/activate
python -m pip install gridfinity-rebase
gridfinity-rebase bin.stl --preset magnet-holes
From source
To install a local checkout, run this command from the repository root:
uv tool install .
Usage
Pass an STL file to replace its base. You can also use the explicit
gridfinity-rebase rebase subcommand. Run gridfinity-rebase without arguments
to display help.
# Create smooth bottom-loading magnet pockets in bin-rebased-magnet-holes.stl.
gridfinity-rebase bin.stl --preset magnet-holes
# Create side-loading magnet pockets in bin-rebased-rebuilt.stl.
gridfinity-rebase bin.stl --preset rebuilt
# Create screw holes without magnet pockets in bin-rebased-screws.stl.
gridfinity-rebase bin.stl --screws
# Add screw holes to bottom-loading press-fit pockets
gridfinity-rebase bin.stl --preset press-fit --screws
# Place magnet pockets and screw holes only at the four outer corners of the bin.
gridfinity-rebase bin.stl --preset rebuilt --screws --only-corners
# Add side-loading magnet pockets and an M15x1.5 thumbscrew hole.
# The output is bin-rebased-rebuilt-thumbscrew.stl.
gridfinity-rebase bin.stl --preset rebuilt --thumbscrew
# Copy a base from another bin
gridfinity-rebase bin.stl --base donor.stl -o result.stl
# Inspect a model or list presets
gridfinity-rebase inspect bin.stl
gridfinity-rebase presets
Presets
Available presets: plain, magnet-holes, rebuilt and press-fit.
refined is an alias for rebuilt.
magnet-holes creates smooth bottom-loading Ø6.5 × 2.4 mm pockets without ribs.
press-fit adds eight crush ribs to each pocket. You can also get this geometry
with --preset magnet-holes --crush-ribs.
The previews show the same 2×3 example bin from underneath. Click a preview for the full-size image.
Append the options in each row to gridfinity-rebase bin.stl.
Geometry options
The default preset is plain. Select another preset or change individual settings:
--magnets none|side|bottom: no magnet pockets, side-loading pockets, or bottom-loading pockets.--side-pocket-height MM: set the side-loading pocket height. The default is 2.1 mm.--screws/--no-screws: enable or disable 3 mm screw bores.--crush-ribs/--no-crush-ribs: enable or disable ribs in bottom-loading pockets.--only-corners: limit magnet pockets and 3 mm screw bores to the four outer corners of the whole bin, regardless of grid size. A 1×1 bin keeps all four holes. Central--thumbscrewholes still appear in every foot.--thumbscrew/--no-thumbscrew: enable or disable the central threaded hole.
Examples with geometry options
Add flags to a preset to combine magnet pockets, screws and central threads, or to place magnet pockets and screw bores only at the outer corners.
Close-ups
The images show geometry generated by the CLI. Regenerate the graphics.
See curve resolution for --segments settings and visual comparisons.
Key details
- The CLI supports standard rectangular Gridfinity bins on a 42 mm grid. Use millimeters for STL units, with feet at the bottom and Z pointing up.
- The CLI detects the base and cut height. It preserves the bin interior and geometry above the cut, and rejects invalid meshes, incompatible bases and ambiguous models.
- A donor base can match the input grid or have its X/Y dimensions swapped. The CLI can also tile a 1×1 donor base across the input.
- Unmodified presets write to
bin-rebased-PRESET.stl.--thumbscrewand--only-cornersappend their names to the filename. Modified settings use a descriptive suffix, such asbin-rebased-magnets-bottom-crush-ribs-screws.stl. Donor bases usebin-rebased.stl. Use-oto choose a filename and--overwriteto replace an existing output. - JSON reports include the resolved
geometrysettings.baseidentifies the starting preset or donor path. The default preset isplain. For donor bases,geometryisnull. --base-height MMoverrides automatic detection for custom models and replaces everything below that height. The minimum is 4.75 mm.
Run gridfinity-rebase --help for all options.
Performance
Run the benchmark from the repository root:
uv run --locked --python 3.11 python scripts/benchmark.py --runs 5
The benchmark generates all test models locally. You do not need to download example STLs. See benchmark instructions, methodology and reference results for JSON output and environment details.
AI Disclosure
Szymon here. I used AI to build this tool.
I needed a way for quick replacement of base of custom Grdifnity bins downloaded from Internet, but I didn't want to spend too much of my free time on this. I collaborated with the AI, describing how it should work, how I want to use it and what's the important from the both code perspective and end-user perspective. It allowed me to iterate and create something that is exactly what I needed. Now I share it with you.
Just want you to know.
License
The MIT license covers this CLI and its adapted preset implementation.
Processing a model does not replace its existing license or attribution requirements. When sharing a rebased STL, preserve applicable notices and comply with the licenses of the input model and any donor geometry.
Acknowledgements
Preset geometry is adapted from the MIT-licensed Gridfinity Rebuilt implementation by Kenneth Hodson, based on Gridfinity by Zack Freedman. Rebuilt credits Gridfinity Refined by grizzie17 as the source of its side-loading magnet pockets.
Rebuilt source files at revision 910e22d8607fd7f5f51ad5e5cbc5287a76810bfd:
- standard.scad: mating profile, grid, radii and hole dimensions.
- gridfinity-rebuilt-holes.scad: side-loading magnet pockets and crush ribs.
- base.scad: fan arrangement of the four pockets and the central threaded hole.
The native thumbscrew thread tessellation derives from ScrewThread() in
threads-scad,
created in 2016 — 2017 by Ryan A. Colyer and released under CC0 1.0.
Metadata
Release files for gridfinity-rebase 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gridfinity_rebase-0.1.1.tar.gz | 2.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gridfinity_rebase-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.3 MB
Release files / gridfinity_rebase-0.1.1.tar.gz
| Download URL | gridfinity_rebase-0.1.1.tar.gz |
|---|---|
| Size | 2.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
504c5f8832c7a47ab6ee81e298f0f8b60c4152470a851a9d7099998af1ae225e
|
|
BLAKE2b-256 checksum How to use checksums |
37155acc336d0139c338ccf8b5d4d9d86c583ab145a917a2e052f4b7f1b0ba4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / gridfinity_rebase-0.1.1-py3-none-any.whl
| Download URL | gridfinity_rebase-0.1.1-py3-none-any.whl |
|---|---|
| Size | 28.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9fdf9f2ed4c4b883c1bc5f85804c0f79ee9fc2d3f69bfc8ed50429288360c318
|
|
BLAKE2b-256 checksum How to use checksums |
d76044573dd5fa02ab35d999cec02d1a7fd2177f4174ce72a0f9632c524dca51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|