Skip to main content

PythonSCAD Pin Cutout

CI PyPI Python

Reusable, parametric recesses for hot-gluing metal brooch pins into PythonSCAD models.

The generated cutter is a rectangular pocket with two circular recesses. The recesses leave matching knobs in the printed part, which locate the pin and give the hot glue more surface area.

Installation

PythonSCAD Pin Cutout requires PythonSCAD 1.1.0 or newer:

pip install pythonscad-pincutout

Usage

Import the package, render a cutter, position it for your design, and subtract it from the solid:

import pincutout
from pythonscad import cube

base = cube([40, 40, 2])
pin_cutter = pincutout.PinCutout.generic_25mm().render().translate([7.25, 17.45, 0])

show(base - pin_cutter)

render() deliberately applies no X/Y positioning or model-specific centering. The pocket begins at PythonSCAD's default origin and is shifted downward only by epsilon to make the boolean operation robust.

Custom dimensions

All dimensions are in millimetres:

cutout = pincutout.PinCutout(
    length=30.0,
    width=6.0,
    depth=0.6,
    knob_diameter=2.4,
    knob_gap=8.0,
    epsilon=0.001,
    fn=128,
).render()
  • length, width, and depth describe the rectangular pocket.
  • knob_diameter is the diameter of each circular recess.
  • knob_gap is the edge-to-edge space between the recesses. Their centre-to-centre distance is knob_gap + knob_diameter.
  • epsilon extends overlapping geometry to avoid coincident boolean faces.
  • fn controls the circular tessellation.

Invalid or non-finite dimensions are rejected before rendering. The knobs must fit completely within the pocket.

Presets

PinCutout.generic_25mm() reproduces the measured geometry this project was extracted from: a 25.5 × 5.1 × 0.4 mm pocket with 2 mm knobs separated by a 6 mm edge-to-edge gap. It is intentionally generic and does not claim compatibility with a particular vendor.

Preset values can be overridden:

cutout = pincutout.PinCutout.generic_25mm(depth=0.6, fn=64)

Future presets should be based on measured hardware and identify their source.

Development

Clone the repository and install the project and development tools:

git clone https://github.com/nomike/pythonscad-pincutout.git
cd pythonscad-pincutout
uv sync --all-groups
pre-commit install --hook-type pre-commit --hook-type commit-msg
uv run pre-commit run --all-files

See CONTRIBUTING.md for commits and pull requests, VERSIONING.md for automated releases, and PUBLISHING.md for the one-time GitHub and package-index setup.

License

BSD 3-Clause

Download files

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

Source Distribution

pythonscad_pincutout-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

pythonscad_pincutout-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pythonscad_pincutout-0.1.0.tar.gz.

File metadata

  • Download URL: pythonscad_pincutout-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pythonscad_pincutout-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a28aa95d4d60fc601e57659e651516e67149c7bab2b9f26af1530967d419277
MD5 1e0c084b0ebe9055843068f8d3f3d56f
BLAKE2b-256 4a57d10d7ba0ffad7841844d297e2e36566ec2e4d434afb2995bb7e3800f9ead

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythonscad_pincutout-0.1.0.tar.gz:

Publisher: publish.yml on nomike/pythonscad-pincutout

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

File details

Details for the file pythonscad_pincutout-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pythonscad_pincutout-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64d6877b241d32e8149be85fc42a30b0aec6378e0b0efb4348d55851e68cfd6a
MD5 cfe460708f9d8f776d61274f83799e3e
BLAKE2b-256 6cb842f82042d6525d582a98f8e5239137dc4208e37f5e553499e62844297865

See more details on using hashes here.

Provenance

The following attestation bundles were made for pythonscad_pincutout-0.1.0-py3-none-any.whl:

Publisher: publish.yml on nomike/pythonscad-pincutout

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.1.0 This release

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