Garment Notation Language: Formal descriptive language for clothing construction

GitHub – khalildh/garment-notation Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert khalildh / garment-notation Public Notifications You must be signed in to change notification settings Fork 0 Star 14 14 stars 0 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings khalildh/garment-notation main Branches Tags Go to file Code Open more actions menu Folders and files Name Name Last commit message Last commit date Latest commit History 29 Commits 29 Commits converter converter docs docs grammar grammar images images tests tests viewer viewer .gitignore .gitignore .nojekyll .nojekyll README.md README.md garment-notation.md garment-notation.md index.html index.html package-lock.json package-lock.json package.json package.json View all files Repository files navigation GNL — Garment Notation Language A formal descriptive language for clothing construction. Try the live viewer Dance has Labanotation. Music has staff notation. Architecture has plan/section/elevation conventions. GNL brings the same rigor to garments — a generative descriptive language where a valid expression is sufficient to construct a garment without ambiguity. Core Concepts Body-anchored — the body is the coordinate system, using anatomical landmarks ( @shoulder.L ) and regions ( %torso.front ) Topological — garments are surfaces with boundaries and openings Constructive — descriptions encode build order, not just final form Composable — complex garments are compositions of simpler elements Quick Example GARMENT t_shirt [SYM] { FABRIC: M(160gsm, fluid, biaxial:15%, 1.0, knit.jersey) front = P(%torso.front, contour, 1.15) back = P(%torso.back, contour, 1.15) sleeve = P(%arm[0..0.4], contour, 1.2) neck = O(@neck, circle, body+8cm) hem = O(@hip, circle, body+10cm) BUILD: S(front.shoulder, back.shoulder, serged) >> S(sleeve.cap, {front.armhole, back.armhole}, serged) >> S(front.side, back.side, serged) >> F(hem, 2.5cm, in) } Grammar The language is formally defined as a PEG grammar targeting Peggy . The generated parser produces a richly-typed AST which is adapted to the renderer’s internal format at runtime. npm install # install Peggy (dev dependency only) npm run generate # regenerate viewer/src/gnl-parser.js from grammar/gnl.peg npm test # run parse + adapter tests against all examples Viewer The repo includes a live viewer that parses GNL and renders both assembled garment views and flat pattern pieces. Assembled View Write GNL on the left, see the full garment on the right — with stitch lines, dimension callouts, and construction details. T-Shirt Wrap Skirt Jacket Collar Pattern Pieces Toggle to “Pieces” to see the individual flat pattern pieces with shape outlines, grain lines, and dimensions. Korosteleva Dataset Converter The r

Source: Hacker News | Original Link