Design a garment, fit it to your own measurements, draft your own pieces, drape it in 3D and lay it out for cutting, all in your browser.
A 1:43 tour: designing, measuring, drafting, draping and cutting. Watch the full video (1080p).
Dressmakers test a pattern by draping it on a form: they pin the cloth to a dress form and see how it hangs before cutting the good fabric. Drapeform does that on screen, on a form built from your measurements. Until November 2026 it was called GarmentCode 3D Studio.
Important
This is an unofficial community project built on GarmentCode and FreeSewing. It is not affiliated with, endorsed by, or supported by the original GarmentCode authors, ETH Zürich, or the Interactive Geometry Lab, nor by FreeSewing. All credit for GarmentCode, PyGarment, the garment programs and the body models goes to the original authors: see the original repository, the original GarmentCode below and the citation. For the official online demo, go to https://garmentcode.ethz.ch/. Please do not report issues with this project to the original authors.
Not actively maintained. Forks and pull requests welcome.
Drapeform is a static web app (in web/) hosted on GitHub Pages. There is no server and no account: GarmentCode's own Python runs in your browser, and your designs, bodies and patterns stay on your device.
- Five steps, one garment
- Features
- Who it's for
- Run it locally
- What this project adds
- Limitations
- Contributing
- Credits and licences
- The original GarmentCode
The app's top bar is the workflow. You can jump between steps at any time; every change re-drafts and re-drapes.
| Step | What you do |
|---|---|
| 1. Design | Pick a GarmentCode or FreeSewing design from the gallery, then tune it with sliders, the Sketchbook, or "Surprise me". |
| 2. Body | Type in your measurements (cm or inches). The mannequin morphs and the pattern is re-drafted to fit. |
| 3. Draft | Draw your own pattern pieces on the dress form, or edit a copy of the current GarmentCode design, sew the edges and watch it drape. |
| 4. Fabric | Choose a fabric, colour and print; set how it stretches along the warp, the weft and the bias. |
| 5. Cutting | Get the pieces with seam allowance laid out on a real-width bolt, how much fabric to buy, a sewing order, and printable PDF/SVG/DXF files. |
- GarmentCode, unchanged. The original
pygarmentlibrary andassets/garment_programsrun in Pyodide inside a Web Worker, so every GarmentCode parameter is available. - A design gallery with categories, search, GarmentCode / FreeSewing and "drapes in 3D" filters and recently used designs; GarmentCode starters include T-shirts, hoodies, a sweatshirt, dresses, skirts, trousers, joggers and shorts.
- Plain-language parameters with an Essentials / All switch and a search box. Surprise me randomises everything you haven't locked.
- Sketchbook: a mix-and-match builder for GarmentCode designs. Step through top, neckline, collar, sleeves, cuffs, waistband, bottom and extras as rows of cards with small line drawings; the full parameter list stays below to fine-tune.
- My designs: a library of saved designs with thumbnails, rename, duplicate and delete, and import/export as
.gcdesign.jsonfiles (single designs or a whole-library backup). GarmentCode.yamlparameter files open too.
- The whole FreeSewing collection (MIT, by Joost De Cock and the FreeSewing designers), each design credited in the gallery. FreeSewing's own code drafts the pattern in your browser from your measurements, with the design's options as sliders; every design gets its pattern, a cutting layout per material (main fabric, lining, interfacing, ribbing, ...) and all the exports.
- 54 designs also drape in 3D, nearly every garment: Bruce, Hugo, Teagan, Sven, Aaron, Simon, Charlie, Uma, Brian, Huey, Wahid, Shin, Bent, Jaeger, Paco, Tamiko (Joost De Cock); Penelope, Waralee, Lumira, Lumina, Crux, Noble, Otis, Devon (Wouter Van Wageningen); Toni, Hannah, Bibi, Shale, Sabrina (Jonathan Haas); Shelly, Onyx, Opal (Thrunic); Walburga, Tiberius, Lunetius (Rika Tamaike); Carlton, Carlita (Anneke Caramin and Joost De Cock); Lily, Sasha (Anna Puk); Titan (Debra Bean and Joost De Cock); Yuri (Biou); Tristan (Natalia Sayang); Sarah (Timur Duehr); Sandy (Erica Alcusa Sáez); Sunny (halbmoki); Umbra (Joost De Cock and Jonathan Haas); Bella (Bella Incognito and Joost De Cock); Bee (PrudenceRabbit); Cathrin (Cathrin Åhlén and Joost De Cock); Jett (Candle); Percy (Gawain/Candle); Ashley (Gawain CCBR); Jane (SeaZeeZee); Sophie (JenBarb_).
- The rest are marked Pattern (cut, not draped): the garments Diana, Tina, Breanna, Cornelius and Simone (no drape that looks like the design yet), plus the accessories, bags, hats and toys.
- FreeSewing describes each piece's outline and cut list but not which edges are sewn together, so each draping design has a small adapter (seam table and placement on the body; see
web/src/fs/). Simplifications are explained in each design's note in the app. - Measurements GarmentCode doesn't have (hip bone, high bust, biceps, head, knee, ankle, crotch seam) are measured on the morphed mannequin (
web/src/fs/measure.js).
- GarmentCode's body measurements, in cm or inches, on a neutral, female or male base body.
- The mannequin morphs to match: height and landmark lines, bust / underbust / waist / hip girths, shoulders, arms, thighs and neck, blended across GarmentCode's body segmentation.
- Saved body profiles, and YAML import/export compatible with GarmentCode.
- A drafting board on a cutting mat, drawn over the mannequin seen from the front or the back, in real centimetres and in GarmentCode's body frame, so pieces are drawn where they sit on the body.
- Draw pieces point by point; drag points, edges (to curve them) and whole pieces; straight, curved and S-shaped edges; copy a piece to the other side of the body.
- Formulas: any point can follow the body, e.g.
waist / 4 + ease, using the body measurements, landmark heights (waist_y,hip_y,shoulder_y, ...) and the pattern's own named numbers. Formulas are parsed by a small safe evaluator (noeval). - Grading: points drawn with the mouse are graded from the body they were drawn on, so they follow measurement changes too.
- Mirrored left/right pairs, pieces cut on the fold, single pieces and cut-only pieces (pockets, facings); grain and rib knit per piece; edges that hold the garment at the waist, under the arms or at the neck.
- Sewing: the Sew tool joins edges (several in a row, or a piece to its own mirror copy for a centre seam); seams are numbered and their lengths checked.
- Start from a measurement-driven block (A-line skirt, boxy T-shirt, shift dress), a blank board, or a copy of the current GarmentCode design, its panels and stitches turned into editable pieces and seams.
- Your pattern drapes live beside the board and gets the same cutting layout, exports, undo, share links and saving as every other design. Pattern files download as
.pattern.json.
- Presets for cotton, jersey knit, linen, denim, silk and chiffon; colours; plain weave, twill, stripes, gingham and polka-dot prints.
- Stretch by direction: separate lengthwise (warp), crosswise (weft) and bias sliders. Bias-cut pieces stretch, cling and drape softly, as they do in real cloth.
- Grain (straight, cross or bias) for the skirt and bodice pieces in Design, and per piece in Cutting; the same grain drives both the simulation and the layout.
- Advanced settings: stiffness, friction, mesh resolution, and optionally releasing the waist/neck attachments after 400 frames (as GarmentCode's simulator does).
- A small XPBD cloth solver in three.js, modelled on GarmentCode's simulation setup: stitched vertices welded as in GarmentCode's BoxMesh; gentle attachments at the waist, the top of strapless garments and the neckline; skirts and trousers don't collide with the arms; zero gravity for the first frames, a velocity clamp, and the drape stops once the cloth settles.
- Panels are pre-wrapped around the torso or arm before sewing, so they start close to the body.
- Cloth self-collision (after Ten Minute Physics #15), on by default: folds, layers and trouser legs don't pass through each other.
- A fit map colours tight and loose areas; a flat view shows the panels as GarmentCode places them.
- Pattern pieces with seam allowance (none, 0.6, 1 or 1.5 cm), notches, seam numbers and grainlines.
- An automatic layout on a real bolt: 90 to 152 cm or any custom width, single layer or folded lengthwise (mirror pairs cut through both layers, symmetric pieces on the fold). The nesting uses the true piece outlines (holes in concave pieces included) and searches the piece order in a Web Worker. It tells you if the other way of laying the fabric would take less.
- Pieces keep their grain parallel to the selvedge; they are turned 180° only if your fabric has no nap or one-way print. Drag to adjust, tap to rotate.
- How much fabric to buy (metres and yards), a cutting list with each piece's grain, and a generated sewing order.
- Exports:
- printable pattern PDF tiled on A4 or US Letter (with a 10 cm / 4 in test square and alignment marks), A0 copy-shop sheets, or a 36″ plotter roll;
- pattern pieces SVG (1:1); cutting layout as PDF (1:1, whole fabric), SVG or DXF (mm);
- GarmentCode's own pattern SVG and specification JSON;
- the draped garment as GLB or OBJ, a turntable video (WebM) and a screenshot (PNG);
- design parameters and body measurements as YAML.
- Undo / redo (Ctrl+Z / Ctrl+Shift+Z) across design, body, fabric and draft changes.
- Share links: the whole design is compressed into the URL, no upload involved.
- Autosave: reopen the tab and you're where you left off.
- Light and dark themes, styled like a dressmaker's workshop: kraft paper, chalk and a green cutting mat by day, the same room at night under a lamp.
- Works on phones: on small screens the controls become a bottom sheet.
- Installable as an app (PWA), and self-contained: every library is served from the site itself, and after one visit it works offline.
- Home sewists with fit problems: enter your own measurements and see the pattern change before you cut into fabric.
- FreeSewing users: try a FreeSewing design on a body in 3D, compare fabrics, and get a cutting layout for your fabric width.
- Cosplay and historical costumers: draft unusual pieces in Draft, grade them to the wearer, and test the drape.
- Fashion and pattern-making students: see how ease, grain and seam allowance change a garment, with real-scale printable output.
- Graphics and ML researchers: explore GarmentCode's design space interactively, and export patterns, specification JSON and draped meshes.
- Zero-waste makers: compare widths and folds and see what share of the fabric is used.
You need Node.js (22 or newer) and Python 3.
cd web && npm ci && npm run build # assembles ../_site (Python sources zip, FreeSewing bundle, body meshes, distance fields)
cd .. && python3 -m http.server 8000 --directory _site # then open http://localhost:8000npm run serve (from web/) does the second step. npm test runs the cutting self-check, the saved-file and share-link compatibility test and a fast drape regression subset; npm run test:drape:all runs the full drape matrix.
Deployment runs through .github/workflows/pages.yml on every push to main; the repository's Pages source must be set to "GitHub Actions". After upgrading @freesewing/*, run node web/tools/gen_fs_catalog.mjs to regenerate the catalogue, option lists and thumbnails.
web/
├── index.html, sw.js, manifest.webmanifest the app shell and offline cache
├── py/gc_bridge.py Python side of the Pyodide bridge to pygarment
├── src/
│ ├── main.js app wiring: the five steps, gallery, exports menu
│ ├── py.js, py-worker.js Pyodide in a Web Worker
│ ├── mixer.js Sketchbook (mix-and-match builder)
│ ├── library.js My designs
│ ├── state.js undo/redo, share links, autosave, profiles
│ ├── body.js measurement-driven mannequin morph
│ ├── garment.js meshing + XPBD cloth solver with self-collision
│ ├── viewer.js three.js stage, fit map, captures
│ ├── fabric.js, grain.js fabric presets and grain directions
│ ├── pieces.js, layout.js, layout-worker.js cut pieces and the nesting layout
│ ├── export.js PDF / SVG / DXF at true scale
│ ├── workshop/ Draft: pattern editor, formulas, blocks, GarmentCode import
│ └── fs/ FreeSewing catalogue, measurements and 3D adapters
└── tools/ build script, library bundling, body preparation, FreeSewing catalogue,
and the tests (cutting self-check, saved-file compatibility, drape/)
.github/workflows/pages.yml builds, tests and deploys the site
docs/studio/ architecture, adapter guide, simulation notes
Everything else is upstream GarmentCode, changed in two places. The shirt in assets/garment_programs/ gained three optional parameters, all off by default, that make the hoodie: an open front, a hem band and a kangaroo pocket (bodice.py, bands.py, pockets.py, assets/design_params/default.yaml). And there is one fix in the Python library: Interface.reverse() in pygarment/garmentcode/interface.py now keeps multi-section seam lengths in edge order (otherwise the hoodie's hem band was sewn on backwards).
- The drape is a lightweight real-time approximation, not the NVIDIA Warp simulator used by GarmentCode/GarmentCodeData, and fabric behaviour is simplified. Self-collision helps a lot, but closely layered pieces can still occasionally overlap. Use the original pipeline for research-quality results.
- Some designs, especially strapless and close-fitting tops, may settle lower than intended.
- Patterns drawn in Draft use the same simulator: pieces are wrapped around the body or arm from where they are drawn, so very unusual shapes may need a few tries.
- The mannequin is an approximate regional morph of GarmentCode's base bodies, not a statistical body model. Extreme measurements look stylised, and posture or body shape beyond the listed measurements isn't modelled.
- FreeSewing drapes are simplified per design: stretch designs (Bruce, Aaron, the ribbing of Hugo and Sven) drape a relaxed copy, since the cloth barely stretches, while the pattern, layout and exports use the real negative-ease pattern. Collars and lapels of the tailored jackets, patch pockets and bindings are cut but not simulated.
- 18 FreeSewing designs are pattern-only (see above).
Pull requests and forks are welcome; the project is not actively maintained, so answers may be slow.
CONTRIBUTING.md: principles, how to build and test, what a good pull request looks like.AGENTS.md: the short version for coding agents and people in a hurry.docs/studio/architecture.md: a map of the app, the pattern JSON and the file formats.docs/studio/freesewing-adapters.md: how to make a FreeSewing design drape, the best first contribution.docs/studio/simulation-notes.md: lessons about the cloth simulation.docs/studio/open-work.md: what is known to be missing, wrong or worth trying.
- GarmentCode and PyGarment by Maria Korosteleva, Olga Sorkine-Hornung and contributors at ETH Zürich (Interactive Geometry Lab), MIT licence. See
LICENSEand the original GarmentCode below. - FreeSewing designs and core are MIT licensed by Joost De Cock and the FreeSewing designers (https://freesewing.eu). They are bundled from
@freesewing/*at build time, and the bundle keeps their licence notices. Each design's authors are credited in the app. - Body measurements follow GarmentCode's definitions. The measurement tool GarmentMeasurements (Botsch et al.) was only used locally as a measuring tool during development; it is not bundled with or distributed in this project.
- Cloth self-collision follows Matthias Müller's Ten Minute Physics #15 (MIT). 3D rendering uses three.js (MIT) and three-mesh-bvh (MIT); Python runs in Pyodide with numpy, scipy, PyYAML, svgwrite and svgpathtools; PDFs are written with jsPDF, seam allowances and nesting use Clipper, and meshing uses Delaunator. The fonts are Fraunces and Inter (SIL Open Font Licence). All of these are bundled into the built site at exact versions (
web/tools/vendor.mjs), so the running app asks no other server for anything, and their licence texts ship with it invendor/THIRD_PARTY_LICENSES.txt. - Drapeform is distributed under the same MIT licence as the original project.
The original GarmentCode README follows, unchanged apart from heading levels.
Official Implementation of GarmentCode: Programming Parametric Sewing Patterns and GarmentCodeData: A Dataset of 3D Made-to-Measure Garments With Sewing Patterns.
You can find the body measurements part of the project here: https://github.com/mbotsch/GarmentMeasurements
[June 3, 2025] GarmentCode online configurator demo is back online 🥳
[April, 2025] GarmentCode online configurator demo is temporarily unavailable. We are working on bringing it back online!
[Nov 20, 2024] GarmentCode configurator demo is now ONLINE 🥳 Check it out: https://garmentcode.ethz.ch/ (not for mobile)
[Sept 4, 2024] We release a new version of the dataset with a few fixes and updates: GarmentCodeData (v2). See documentation for new data version for more details.
[Aug 30, 2024] Major release -- implementation of GarmentCodeData in pygarment v2.0.0, new GUI, and other updates and improvements. Basic JSON representation classes are now part of PyGarment library! See CHANGELOG for more details
[July 1, 2024] GarmentCodeData is accepted to ECCV!
[May 29, 2024] First release of GarmentCodeData dataset!
[Oct 18, 2023] First release of GarmentCode!
- Installation
- Running Configurator
- Running Data Generation (warp)
- Body measurements
- Dataset documentation
- Running Old Maya+Qualoth tools
PyGarment is the core library described in the GarmentCode paper. It contains the base types (Edge, Panel, Component, Interface, etc.), as well as edge factory and various helpers and operators that help you design sewing patterns.
See Installation instructions before use.
- assets/garment_programs/ contains the code of garment components designed using PyGarment.
- assets/design_params/, assets/bodies/ contain examples of design and body measurements presets. They can be used in both GarmentCode GUI and
test_garmentcode.pyscript.
NOTE: assets/design_params/default.yaml is the setup used by GUI on load. Changing this file results in changes in the GUI initial state =)
If you are using our system in your research, please cite our papers:
@inproceedings{GarmentCodeData:2024,
author = {Korosteleva, Maria and Kesdogan, Timur Levent and Kemper, Fabian and Wenninger, Stephan and Koller, Jasmin and Zhang, Yuhan and Botsch, Mario and Sorkine-Hornung, Olga},
title = {{GarmentCodeData}: A Dataset of 3{D} Made-to-Measure Garments With Sewing Patterns},
booktitle={Computer Vision -- ECCV 2024},
year = {2024},
keywords = {sewing patterns, garment reconstruction, dataset},
}@article{GarmentCode2023,
author = {Korosteleva, Maria and Sorkine-Hornung, Olga},
title = {{GarmentCode}: Programming Parametric Sewing Patterns},
year = {2023},
issue_date = {December 2023},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
volume = {42},
number = {6},
doi = {10.1145/3618351},
journal = {ACM Transaction on Graphics},
note = {SIGGRAPH ASIA 2023 issue},
numpages = {16},
keywords = {sewing patterns, garment modeling}
}Please post your issues and questions to GitHub Issues.
For other requests you can find my info on https://korosteleva.com/.
This project is brought to life by these people:
The body measurements team developed GarmentMeasurements:

