Drag to rotate · Scroll to zoom · Right-click to pan
1 / 3
⬡afstandbl…
⬡blok
⬡kap
Description
# Afstandblok
> A 3D-printable spacer block for mounting trellis mesh on a wall or fence, keeping it at a small distance so climbing plants can grow freely behind it.
## Description
The Afstandblok ("spacer block" in Dutch) is a compact 20×20×30 mm wall spacer designed to mount wire or plastic trellis mesh a few centimetres away from a wall or fence. This air gap gives climbing plants room to wrap their tendrils around the mesh without pressing directly against the surface. The block is screwed to the wall through its central hole, and a snap-fit cap (`print_kap`) clicks onto the front to retain the mesh panel. Integrated side lugs (noks) allow multiple blocks to interlock if needed. All corners are rounded for a clean finish and improved print quality.
## Files
| File | Description |
|------|-------------|
| `afstandblok.py` | PythonSCAD source file |
| `blok.3mf` | Ready-to-print 3MF — main spacer block |
| `kap.3mf` | Ready-to-print 3MF — snap-fit cap |
| `afstandblok.3mf` | Ready-to-print 3MF — all parts combined on build plate |
| `README.md` | This file |
## Requirements
### Runtime
- [PythonSCAD](https://pythonscad.org/) (OpenSCAD with Python scripting support)
- Python 3.x
### Python Dependencies
None — only standard library modules are used (via `mhlib`).
### Custom Libraries (by author)
| Library | Purpose |
|---------|---------|
| `mhlib` | Core PythonSCAD helper library — provides geometry primitives (`cylinder`, `cube`, `union`, `difference`, `hull`, etc.), transformation helpers (`mv`, `mvx`, `mvy`, `rot`, `roty`), plate spreading (`spread_on_plate`), and file export (`export`, `show`). Published separately by the author. |
## Configuration
The following parameters at the top of `afstandblok.py` can be adjusted before rendering:
| Parameter | Default | Description |
|-----------|---------|-------------|
| `fn` | `128` | Circle/cylinder facet count — higher values give smoother curves |
| `plateSpacing` | `10` | Spacing (mm) between parts when laid out on the build plate |
| `run` | `"all"` | Which part to preview: `"all"` shows everything; use `"blok"` or `"kap"` to isolate a single part |
| `x` | `20` | Block width (mm) |
| `y` | `20` | Block depth (mm) |
| `draad` | `5` | Thread/slot feature diameter (mm) |
| `dia` | `4` | Snap-fit lug (nok) diameter (mm) |
| `basisH` | `30` | Height of the main spacer block (mm) |
| `kapH` | `5` | Height of the snap-fit cap (mm) |
| `schroefD` | `3.5` | Screw shaft hole diameter (mm) |
| `schroefH` | `7` | Screw head countersink diameter (mm) |
## Functions
### `afstandblok()`
Top-level assembly function. Combines the main block and cap side-by-side into a single union for preview or export.
**Returns:** Union of `print_blok()` and `print_kap()`, offset 25 mm apart along X.
---
### `blok(x=20, y=20, h=15, dia=5, rnd=3)`
Creates a rounded rectangular prism by extruding a hull of four circles placed at each corner.
**Parameters**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `x` | float | `20` | Width (mm) |
| `y` | float | `20` | Depth (mm) |
| `h` | float | `15` | Height (mm) |
| `dia` | float | `5` | (Unused in body; inherited signature) |
| `rnd` | float | `3` | Corner radius (mm) |
**Returns:** Rounded rectangular solid (linear extrusion of hull).
---
### `print_blok(h=30)`
Printable main spacer block. Subtracts a central screw hole, countersink, two side snap-fit lugs, a cross-lug, a thin slot, and a recessed channel from the base block.
**Parameters**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `h` | float | `30` | Block height (mm) |
**Returns:** Finished spacer block geometry with all features cut in.
---
### `connectFemale(h=30)`
Female connector variant of the main block, rotated −90° around Y for side-mounting. Contains two snap-fit lug cutouts on its face.
**Parameters**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `h` | float | `30` | Block height (mm) |
**Returns:** Rotated block with female snap-fit recesses.
---
### `print_kap(h=5, tol=0)`
Printable snap-fit cap that clicks onto the top of the main block. Adds three snap-fit lugs (two on the sides, one on the end).
**Parameters**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `h` | float | `5` | Cap height (mm) |
| `tol` | float | `0` | Tolerance added to lug diameter for fit adjustment (mm) |
**Returns:** Cap solid with protruding snap-fit lugs.
---
### `connectMale(h=5, tol=0)`
Male connector variant of the cap, rotated −90° around Y for side-mounting. Includes an additional rectangular base pad.
**Parameters**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `h` | float | `5` | Cap height (mm) |
| `tol` | float | `0` | Tolerance added to lug diameter (mm) |
**Returns:** Rotated male connector geometry.
---
### `nok(l=5, dia=4, tol=0)`
Creates a single cylindrical snap-fit lug oriented horizontally (along X), with optional tolerance expansion.
**Parameters**
| Name | Type | Default | Description |
|------|------|---------|-------------|
| `l` | float | `5` | Lug length (mm) |
| `dia` | float | `4` | Lug diameter (mm) |
| `tol` | float | `0` | Extra diameter tolerance (mm) — positive for female (cutout), zero for male |
**Returns:** Horizontal cylinder geometry positioned at origin for placement via `mv`.
---
### `uitsparing()`
Creates a recessed slot/channel shape (hull of two cylinders) rotated and positioned as a T-slot relief cut in the top face of the block.
**Returns:** Slot geometry for subtraction from the main block.
---
## Usage
```python
# Open afstandblok.py in PythonSCAD
# To preview all parts on the build plate (default):
run = "all"
# To preview only the main block:
run = "blok"
# To preview only the cap:
run = "kap"
```
1. Open `afstandblok.py` in PythonSCAD.
2. Adjust configuration parameters if needed (see [Configuration](#configuration)).
3. Preview the model (F5) or render it (F6).
4. Individual `.3mf` files are exported automatically per part when not in preview mode.
## License
License: t.b.d. *(To be determined by the author — Matthieu Hendriks)*
💬 Discussion 0 comments