din168-thread-scad
DIN 168 round threads (the GL threads on laboratory glassware) in OpenSCAD: a size table, the internal and external thread, and a screw cap. Also DURAN’s GLS 80, which is not DIN 168.

use <din168-thread-scad/din168.scad>
gl = din168_by_name("GL45");
din168_cap(gl, ribs=36); // a cap, seated at z = 0: place it at the rim
din168_cap(gl, ring_band=5); // with a band at the mouth that clears a pouring ring
din168_nut(gl, length=12); // the cap's thread alone, as a tube
din168_bolt(gl, length=12, bore=30); // the glass side, for a gauge
- Sizes: every size in DIN 168-1:1998-04, GL8 to GL125, including GL25 in both its pitches
(
din168_by_name("GL25", pitch=3.5)for the second). Every figure in the table is recorded with its source in docs/references.md. - GLS 80:
din168_by_name("GLS80"), the thread on DURAN’s wide-mouth bottles. It is not a DIN 168 thread and no standard defines it: three starts, crests 5 mm apart, 15 mm of advance per turn, which DWK and b.safe publish. Its diameters and tooth are GL80’s, which a measured third-party GLS 80 cap agrees with. A DIN GL80 cap does not fit a GLS 80 neck. - Profile: Bild 1 of the standard: flanks at 60° on the glass and 30° in the cap, crests rounded
to R1 and roots to R2, the glass tooth
b = P·kwide at its core. The standard gives no width for the cap tooth; it follows from the cap’s crest radius and flank angle (seedin168.scad). - Fit: the cap is cut to the largest cap the standard allows and the printed glass side
(
din168_bolt) to the smallest glass, then each is shrunk byclearance(default 0.2 mm) on every face. Centred on the largest glass the standard allows, the default cap leaves 0.28 mm (P = 2) to 0.70 mm (P = 5) at the closest point. - Cap height: no standard sets it. DIN 168-1 gives only the thread, and ISO 4796-1 leaves the
bottle’s neck to the maker. The cap is threaded from 2 mm under the top, where a liner sits, to
the mouth: five pitches by default (
thread_length), so 25 mm over all on GL45, the height of DURAN’s PP GL45 cap. The thread has to reach the neck’s, which starts some way below the rim. - Pouring rings:
ring_bandadds a band at the mouth, bored 2 mm outside the thread’s root, for a neck with a pouring ring fitted. DURAN’s rings are 4 mm tall on GL32 and GL45 and 6.85 mm on GLS 80, soring_band=5andring_band=8. - Placing a cap: z = 0 is the seal plane, where the glass’s rim meets the inside of the top.
Translate a cap to a bottle’s rim height and it sits on the rim, whatever its thread length,
liner space or ring band. The top runs from z = 0 to z =
top. - Rendering: the thread is one polyhedron swept along a true helix. A full render of the GL45 example takes over a minute on OpenSCAD 2021.01; preview is quick.
Sizes
din168_by_name("GL45") returns a size; din168_sizes lists them all, in the standard’s order.
Diameters are nominal, in mm; the full table with allowances and radii is in
docs/references.md.
| Size | P | d (glass) | D (cap) | Size | P | d (glass) | D (cap) | |
|---|---|---|---|---|---|---|---|---|
| GL8 | 2 | 8 | 8.1 | GL32 | 4 | 32 | 32.15 | |
| GL10 | 2 | 10 | 10.1 | GL36 | 4 | 36 | 36.15 | |
| GL12 | 2 | 12 | 12.1 | GL40 | 4 | 40 | 40.15 | |
| GL14 | 2.5 | 14 | 14.1 | GL45 | 4 | 45 | 45.15 | |
| GL16 | 2.5 | 16 | 16.1 | GL50 | 4 | 50 | 50.3 | |
| GL18 | 3 | 18 | 18.1 | GL56 | 4 | 56 | 56.3 | |
| GL20 | 3 | 20 | 20.1 | GL63 | 5 | 63 | 63.4 | |
| GL22 | 3 | 22 | 22.1 | GL70 | 5 | 70 | 70.4 | |
| GL25 | 3 | 25 | 25.1 | GL80 | 5 | 80 | 80.4 | |
| GL25 | 3.5 | 25 | 25.1 | GL90 | 5 | 90 | 90.4 | |
| GL28 | 3 | 28 | 28.1 | GL100 | 5 | 100 | 100.4 | |
| GL112 | 5 | 112 | 112.4 | |||||
| GL125 | 5 | 125 | 125.4 |
Examples
- examples/gl45_cap.scad: a GL45 cap and a short gauge to try it on.
- examples/gl80_cap.scad: the same for GL80, ribbed.
- examples/gls80_cap.scad: the same for GLS 80.
- examples/all_sizes.scad: a cap in every size, labelled.
Consumers
- iso4796-bottle-scad draws its bottles’
threads with
din168_by_name,din168_bolt,din168_bolt_coreanddin168_pitch, and checks its own neck finishes against this table. - uwo-fast/open-source-bioreactor makes its GL45
port caps with
din168_by_name,din168_capanddin168_cap_radius(scad/custom/gl_port_cap.scad).
Both pin this library with scadman, so a change here reaches them only when they move their pin.
To try a change against one before that, put a directory holding a link to this checkout, named
din168-thread-scad, ahead of the consumer’s own copy:
mkdir -p /tmp/din168-try && ln -s "$PWD" /tmp/din168-try/din168-thread-scad
cd ../iso4796-bottle-scad && scadman sync
OPENSCADPATH="/tmp/din168-try:$(scadman env)" python3 tests/test_iso4796.py
OpenSCAD takes the first match on OPENSCADPATH, so the link wins; without it the consumer
renders against its pinned copy and the check says nothing about the change.
Checks
just test takes about 11 s on OpenSCAD 2026.10.15, with warnings treated as errors:
- Every row of
din168_sizesmatches Tabelle 1 as docs/references.md records it, cell by cell, and GLS 80 is GL80’s row with three starts. - Every example renders.
- A cap comes out one solid, as tall as its top, liner space, thread and any ring band add up to,
and as wide as
din168_cap_radiussays, ribs aside. din168_by_namerefuses a size or pitch it doesn’t have, anddin168_capa negative ring band, each with its message.
The checks don’t screw a cap onto a gauge: as drawn, the two threads start at different angles, so whether they clear each other depends on turning one into phase. The fit figures above come from the profile, and the test prints are recorded in docs/references.md.
just images renders the picture above.