SG-Lib

Milestone 2026-07-12 — Coffee mug, grammar-conforming + relational (rewrite of the 2026-07-10 milestone)

Rendered views

Download STL: 2026-07-12_coffeemug_relational.stl

Type: rewrite/reference milestone. The 2026-07-10 coffee mug, rewritten in the new SG-Lib grammar and enforced by SGLIBgrammarcheck. The original (../2026-07-10_coffeemug/) is left untouched.

Task

A printable hollow mug (dia 80, height 95, wall 3.5, floor 6) with a C-bow side handle on the wall, bowing outward at mid-height. Watertight via Manifold2 (nm=0).

What changed vs the original (the rewrite)

  • HARD fixed: the absolute handle placement SGtransT(H, TofP([Rout-1, 0, Hh/2])) -> relational SGtransrelSG(SGH, SGM, 'right', -intr, 'centerz', 'centery') (bounding-box anchors: right = x, centerz = z at view(-30,30)). SGrotate only to stand the handle geometry up, not for placement.
  • Named givens at the top (Rout Hh twall tfloor Rc bar hw intr); no literal dimensions in the body.
  • XX design-task header + $..$ values as a caliper reference: geometry mug 80 mm dia x 95 mm high | wall 3.5 mm floor 6 mm | handle arc 34 mm bar 9 mm width 12 mm; result overall size 117.5 x 80 x 95 mm with handle | mug outer dia 80 mm (overall size measured via sofBB).
  • One English trailing comment per line; fprintf -> CLAUDE_dbprintf + XX values.
  • Grammar gate passed in the milestone builder (SGlibrunMilestone): buildinfo grammar: OK (0 msg).

Method choice (documented)

Placement here via spatial relations (method A) because it is an aesthetic placement (handle on the side). For standard parts / mechanisms / force transmission, method B (frames) would be mandatory - see CLAUDE_SGLIB_PATH2.md (methods A/B + the “legacy -> grammar-conforming” recipe) and SGLIB_Fuegen.md.

Files

  • ..._build_coffeemug.m - grammar-conforming milestone build (outputs into the folder, gated by the runner).
  • ..._reference_sgtestclaude.m - the sgtestclaude working copy of this rewrite.
  • ..._coffeemug_relational.stl - printable mesh (raw VL/FL, no frames).
  • ..._views.png - preview (view(-30,30)).
  • ..._coffeemug_buildinfo.txt - provenance incl. grammar: OK.
  • Conversation: ..._conversation_de.md / ..._conversation_en.md.

Design conversation (English)

Conversation (essence) — coffee mug grammar-conforming, 2026-07-12

  • Tim: Look at 2026-07-10_build_coffeemug.m - could you rewrite it with the new rules?
  • Claude: SGLIBgrammarcheck runs -> 1 HARD (SGtransT(H,TofP([Rout-1,0,Hh/2])) = absolute placement of the handle) + 13 SOFT (missing trailing comments). Rewrite doable; the core is the relational handle attachment.
  • Tim: there are BBofSG/sofBB/zofBB for sizes; use SGtransrelSG with 'right'/'center' (right/left = x, back/front = y, top/down = z at view(-30,30), my default). Does that help?
  • Claude: yes - handle via SGtransrelSG(SGH,SGM,'right',-intr,'centerz','centery') instead of the absolute SGtransT. Hollow mug (contour-first, wall/floor), C-bow built + stood up, union -> nm=0; overall size via sofBB = 117.5 x 80 x 95 mm.
  • Tim: you can also use TofSGFSselect (wall frame) + a frame on the handle + alignT/matchT. Make it a new design task tested with sgtestclaude. Remember both methods.
  • Tim (rule): spatial relations are easy for humans to formulate (aesthetics); frames are NECESSARY for mechanisms/robots/motion automata and standard parts (screws/washers/bearings/nuts/knock-in bushings), because for force transmission/kinematics the exact mechanics must be known AND derived.
  • Tim: “I am impressed” -> store as a milestone (original untouched).
  • Result: grammar-conforming coffee mug, handle purely relational, grammar: OK in buildinfo, printable STL.

Lesson: existing constructions can be made grammar-conforming systematically (recipe in CLAUDE_SGLIB_PATH2.md); the method choice follows function: aesthetics -> spatial relation, force/motion/ standard part -> frames.