Converting Weaving Drafts to Towel Patterns
Given a draft and target size, produce the deliverables immediately if data is sufficient; otherwise ask only for the missing essentials.
Minimum required inputs:
- Threading sequence (shaft per warp end) — or image to parse
- Tie-up (shaft-to-treadle map) — or treadling-as-drawdown if no tie-up
- Treadling sequence (treadle/shafts per pick)
- Sett (EPI) or yarn weight to infer it
- Target finished width × length, and hem or fringe preference
If any of these 5 are missing, ask for them in a single consolidated question before proceeding. Do not interrogate one item at a time.
Python# Canonical draft representation — build this first, always draft = { "threading": [1, 2, 3, 4, 1, 2, 3, 4], # shaft per warp end, left-to-right "tieup": {1: [1,2], 2: [2,3], 3: [3,4], 4: [4,1]}, # treadle: shafts lifted "treadling": [1, 2, 3, 4, 1, 2, 3, 4], # treadle per pick, in order "shafts": 4, "treadles": 4, "epi": 20, "ppi": 20, "yarn": "8/2 cotton", }
Progress:
- [ ] 1. Ingest and parse the draft into canonical form
- [ ] 2. Validate structural integrity (repeats, shaft/treadle bounds)
- [ ] 3. Collect towel target spec (size, hems/fringe, border)
- [ ] 4. Compute sett-based warp/weft math
- [ ] 5. Select and report scaling strategy
- [ ] 6. Generate deliverables (warp plan, treadling chart, drawdown, yardage)
- [ ] 7. Run feasibility checks and flag issues
- [ ] 8. Output final numbered weaving instructions
1. Ingest and parse
- From an image: extract threading (top rows of chart), tie-up (small corner box), treadling (side rows), and drawdown if present. State confidence level on OCR/visual reads — never silently guess ambiguous cells.
- From a WIF file or text listing: parse directly into the canonical dict.
- From verbal description ("point twill on 4 shafts"): generate the threading/tie-up/treadling programmatically using known structure rules (e.g., point twill = ascend then descend: 1,2,3,4,3,2).
- Always echo back the parsed draft in canonical form for user confirmation before computing anything expensive.
2. Validate structural integrity
Check and report:
max(threading) <= shaftsmax(treadling) <= treadles(or<= len(tieup))- All tie-up keys referenced in treadling exist
- Threading length is divisible by the warp repeat unit (detect repeat by finding smallest periodic subsequence)
- Treadling length divisible by weft repeat unit
If a draft fails a check, do not silently "fix" it — report the discrepancy and propose the most conservative correction (e.g., "repeat is 8 ends but threading has 11; assuming last 3 are a partial repeat to be dropped or completed — confirm which").
3. Collect towel target spec
Ask for (in one batch, with sensible defaults offered):
- Finished width × length (typical: 16"×24" to 20"×28")
- Fringe (specify length, e.g., 1") or hemmed (specify hem allowance, e.g., 1" turned twice = 2" per end)
- Border: centered motif, mirrored borders, or edge-to-edge repeat
- Loom waste allowance (default: 18–24" for floor loom, more for rigid heddle)
4. Compute sett-based warp/weft math
Pythondef compute_warp(finished_width_in, epi, warp_repeat_ends, selvage_ends=4, takeup_pct=0.10, hem_allowance_in=0): width_with_hems = finished_width_in + hem_allowance_in raw_ends = width_with_hems * epi raw_ends += selvage_ends # round up to nearest full repeat import math repeats = math.ceil(raw_ends / warp_repeat_ends) total_ends = repeats * warp_repeat_ends width_on_loom = total_ends / epi width_at_takeup = width_on_loom * (1 - takeup_pct) return { "total_ends": total_ends, "repeats": repeats, "width_on_loom_in": round(width_on_loom, 2), "estimated_finished_width_in": round(width_at_takeup, 2), } def compute_weft(finished_length_in, ppi, weft_repeat_picks, hem_allowance_in=0, fringe_in=0, shrinkage_pct=0.10): length_with_allowances = finished_length_in + hem_allowance_in + fringe_in raw_picks = length_with_allowances * ppi raw_picks /= (1 - shrinkage_pct) import math repeats = math.ceil(raw_picks / weft_repeat_picks) total_picks = repeats * weft_repeat_picks return {"total_picks": total_picks, "repeats": repeats}
Report both the ideal and the rounded (repeat-snapped) finished dimensions — they often differ by 0.25–1". Flag the delta explicitly.
5. Select scaling strategy — report whichever is used
| Strategy | When to use | Effect |
|---|---|---|
| Repeat-preserving | Default; historic draft integrity matters | Towel size rounds to nearest full repeat; size may shift slightly from requested |
| Density-preserving | User has fixed yarn/reed they must use | EPI/PPI fixed; towel size adjusted instead |
| Motif-preserving | Draft has a clear central motif larger than one structural repeat | Motif kept whole and centered; borders padded with plain weave or repeat units to hit target size |
Always state: "Used [strategy] because [reason]. Finished size will be X×Y instead of requested A×B (delta: ...)."
6. Generate deliverables
Produce all of the following, even if some are simple:
Warp plan — total ends, number of repeats, selvage treatment, color order if striped.
Threading chart — shaft-by-shaft, grouped by repeat, e.g.:
Repeat (×12): 1-2-3-4-3-2-1-2 | Total ends: 96 + 4 selvage = 100
Treadling chart — pick-by-pick, repeatable block, with pick count to finished length.
Drawdown — ASCII or markdown over/under grid for one full repeat minimum:
Pick\End 1 2 3 4 5 6 7 8
1 X . X . X . X .
2 . X . X . X . X
Border/motif placement — exact end/pick numbers where motif starts and ends, confirmed centered or mirrored.
Yardage estimate:
Pythondef warp_yardage(total_ends, warp_length_in, waste_in=36): length_yd = (warp_length_in + waste_in) / 36 return round(total_ends * length_yd, 1) def weft_yardage(total_picks, width_in, waste_pct=0.10): length_yd = (total_picks * width_in / 36) * (1 + waste_pct) return round(length_yd, 1)
7. Feasibility checks
- Shaft count available ≤ shafts required by threading
- Treadle count available ≤ treadles required (or note if using direct tie-up / computer-assisted dobby, where this constraint disappears — relevant for TC2/dobby looms per modern digital-loom practice)
- Reed availability: confirm dent size accommodates EPI with chosen ends-per-dent grouping
- If any constraint fails, propose the nearest feasible alternative (e.g., "draft requires 8 shafts; if limited to 4, substitute with equivalent twill variant — confirm willingness to modify structure")
8. Final instructions
Number every step concretely:
- Warping — ends order, repeat count, selvage handling
- Threading — shaft-by-shaft, repeat markers every N ends
- Sleying — ends per dent, reed size
- Tie-up — treadle-to-shaft table
- Weaving — pick order, repeat tracking tip (e.g., "tie a marker every 4th repeat"), beat consistency note
- Finishing — hem turn/stitch or fringe twist instructions, wet-finishing (wash/press) guidance affecting final takeup
Example 1:
Input: 4-shaft point twill draft, threading 1,2,3,4,3,2 (repeat of 6), tie-up standard twill, treadling same as threading, EPI 20, target 18"×28" towel, hemmed.
Output:
- Repeat-preserving strategy used (6-end repeat divides cleanly)
- Total ends: 20 EPI × 18" = 360 → nearest multiple of 6 = 360 (already divisible) + 4 selvage = 364
- Finished width after 10% takeup: ~17.9" (confirm acceptable)
- Weft: 20 PPI × (28" + 2" hem) = 600 picks, snapped to nearest multiple of 6 = 600
- Full threading chart, treadling chart, drawdown for one repeat, yardage: warp ≈ 13.3 yd × 364 ends... (full numeric table), weft ≈ 11.7 yd
- Final 6-step instructions
Example 2: Input: User uploads a photo of an 1850s coverlet draft, no tie-up visible, asks for a towel. Output: Parse threading and treadling from image; note tie-up is missing and ask whether to (a) assume standard point-twill tie-up, or (b) treat as drawdown-only and derive an equivalent tie-up. Proceed only after this single clarifying question is answered, then continue workflow from step 2.
- Always echo the parsed/assumed draft back before computing — historic drafts are frequently ambiguous (shaft numbering direction, "up" vs "down" convention).
- Default to repeat-preserving scaling; it respects the historic structure's integrity, which is usually the point of using a historic draft.
- State every assumption explicitly and label it as an assumption, not a fact.
- Keep drawdown outputs to one repeat unless the full piece is small (<40 ends) — full drawdowns for large patterns are unreadable as text.
- When citing background methodology (CAD/name-drafting logic, digital drafting, code-based weave representation), reference the supporting literature on weave-draft CAD workflows, name/code drafting conventions, and computational weave representation (e.g., discrete thread-state modeling) rather than fabricating technique.
- Treat shaft/treadle limits as hard constraints only for floor/table looms; for dobby or computer-assisted looms (e.g., TC2-style), treadle constraints relax to direct shaft control.
- Don't silently complete a partial or corrupted repeat — flag it and ask or propose the fix explicitly.
- Don't ignore takeup/shrinkage — floor-loom cloth typically loses 8–15% in width/length during finishing; skipping this makes finished towels consistently