Milestone 2026-07-10 — Block + cylinder joined by one M3 screw

Download STL: blockcylinderM3_0001.stl · blockcylinderM3_0002.stl
Authors: Tim C. Lueth und Claude Opus 4.8 — SG-Lib Cowork tutorial milestone.
What this is
A 40×40×20 mm block with a Ø20 / H10 mm cylinder placed on top, joined by one recessed
DIN912/DIN985 M3 screw (cap-screw head recessed in the cylinder, self-locking nut recessed in the
block). Built with the SG-Lib idiom (contour/box → relative assembly → subtraction bausatz), watertight
via the Manifold boolean backend (SGBOOLENGINE='SGboolManifold2').
Key lessons captured in this milestone
- Screw length comes from
screwlengthDIN912985(M,t1,t2): shortest available DIN912 A2 length that keeps head+nut recessed with enough residual wall — driven by the clamped material thickness (t1+t2) and the required residual wall (material/strength), NOT by the block’s outline. Here → M3×16. - Placement idiom: both mating frames at the interface, opposite
ez(head up in the cylinder, nut down in the block); the screw axis is derived from the geometry centre (no magic numbers). - Insertion tunnel
tpl:SGdesignDIN912DIN985(...,'TT',tpl)—tpl=[HIL NIL]must be ≥ the body thickness on each side so the head/nut insertion channels break through to the outer face. The default[10 10]is too short for the 20 mm block (nut buried, not insertable);tpl=[tcyl tblk]+2fixes it. - Bill of materials + ordering: standard parts are listed with Wegertseder order codes via
productcode(DIN912 A2 M3×16 →2534-286, DIN985 A2 M3 →3346-232), resolvable withSGpartslistfindproductcodes. - One folder: constructed parts (STL) + parts list + assembly views written together (
SGwriteMultipleSTL).
Files
2026-07-10_build_blockcylinderM3.m— reproducible build script (self-contained, English output).2026-07-10_blockcylinderM3_STL/— the STL parts (blockcylinderM3_0001/0002.stl),StandardParts_parts.txt(BOM with order codes), assembly view JPGs,Design-Comments.txt,Assembly-Fitting.txt.2026-07-10_blockcylinderM3_views.png— half-section preview (recessed screw + insertion channels).2026-07-10_blockcylinderM3_buildinfo.txt— build provenance.2026-07-10_SGlibrunMilestone.m— copy of the runner used to reproduce this milestone.2026-07-10_blockcylinderM3_conversation_en.md/_de.md— the construction conversation (EN/DE).
Reproduce
SGlibrunMilestone(fullfile(pwd,'CLAUDE_MILESTONES','2026-07-10_blockcylinderM3', ...
'2026-07-10_build_blockcylinderM3.m'))
Result & provenance
- Result: M3×16, residual wall 3.5 mm, grip 12 mm, watertight (nm=0 on block and cylinder).
- Execution time: 4.28 s (tic/toc)
- Machine / stamp: Mac OSX 15.7.7 · MATLAB R2024b Update 6 · SG-Lib 5.7 develop · Java 11.0.24+8-LTS · Apple M3-PRO (12-Core CPU, 18-Core GPU), 36 GByte RAM
- Host: lueths-barcelona-mac.local (MACA64 / maca64)
- Run at: 2026-07-10 22:40:19
Design conversation (English)
2026-07-10 Milestone Block + Cylinder (one M3 screw) — the path (dialogue: task, hints, responses)
Authors: Tim C. Lueth und Claude Opus 4.8 Date: 2026-07-10
This document records the path to the milestone as a dialogue: Tim Lueth’s task statement and the hints up to the milestone result, with Claude’s responses in between. All contributions are verbatim (Tim’s only spelling-corrected; originally German, translated here). Of Claude’s contributions only the construction-related part is quoted; passages on MATLAB/programming are omitted with “[…]”.
Task statement — Tim Lueth
“Please construct 1 block 40×40×20 and a cylinder D20/H10 on top of it and join them with an M3 screw.”
Claude (construction part):
Built it: block
SGbox([40 40 20]), cylinderSGofCPLz(PLcircle(D/2),Hc)placed on top withSGtransrelSG(...,'ontop'). Screw axis derived from the geometry centre (no fixed coordinates). Length fromscrewlengthDIN912985(3, tcyl, tblk)withtcyl=10(cylinder),tblk=20(block) → M3×16, residual wall 3.5 mm, grip 12 mm. Head recessed on top in the cylinder, nut recessed below in the block (both mating frames at the interface, oppositeez); result nm=0.
Hint 1 — Tim Lueth
“When using SGdesignDIN912DIN985 you overlooked the parameter
tpl, which sets how big the subtraction tunnel must be. Default is 10 10 for head and nut, but this body is too thick for 10 mm to have been enough. Do you understand what I mean? Would you like to take a look?”
Claude (construction part):
Understood —
tpl=[HIL NIL]is the length of the insertion tunnels for head/nut. For the 20 mm thick block the 10 mm nut tunnel does not reach the bottom face → the nut would have no insertion channel to the outside. A half-section comparison shows: default [10 10] → the nut channel ends inside the solid;tplmatched to the thickness → the channel breaks through to the block’s bottom face.
Hint 2 — Tim Lueth
“Currently the insertion tunnel for the nut is too short and the nut could not be inserted.”
Claude (construction part):
Fixed:
tpl=[tcyl tblk]+2(from the geometry,tpl(side) ≥ body thickness), callSGdesignDIN912DIN985([3 L 0],'TT',tpl). Verified in the half-section: the nut channel now reaches the block bottom (z=−10), the head channel opens at the cylinder top (z=20), nm=0. Rule captured as §2d inSGLIB_Fuegen.md.
Additional (sourcing): the standard parts were registered in productcode (stainless A2): DIN912 A2 M3×16 →
2534-286, DIN985 A2 M3 → 3346-232 (Wegertseder article numbers researched, not invented). The parts list carries
the PC[...] codes; constructed parts (STL) + parts list written into one folder (SGwriteMultipleSTL).
Hint 3 — Tim Lueth
“Please remember this procedure — as soon as it is correctly verified/validated — in the joining rules.”
Claude: Recorded as §2d in SGLIB_Fuegen.md (insertion tunnel tpl ≥ body thickness), with the verified example.
Milestone request — Tim Lueth
“This is a milestone — please document again code, STL folder, and conversation in German and English; the output text in the code in English too.”
Claude: Milestone created: build script (English output, stamp+tic/toc via SGlibrunMilestone), STL folder with
both parts + parts list + views, READMEs (DE/EN), this conversation (DE/EN), runner copy.
Hint 4 — Tim Lueth
“Important: for
XXto work as a runtime comment, early on — before the first comment — there must be a single line with onlyXXto reset the log files. This is a general MATLAB programming-style rule, but also important for the SG-Lib rules.”
Claude: Recorded (MATLAB programming style §8b, note in SGLIB_Denkmuster.md). Added the bare XX reset line before
the first XX comment in the build script and in sgtestclaude; afterwards Design-Comments.txt is clean (only this
run’s comment).
Result
M3×16, residual wall 3.5 mm, grip 12 mm, watertight (nm=0). Insertion tunnels break through on both sides. Parts list with order codes. Execution time 4.28 s (tic/toc); machine/stamp see README/buildinfo.