Calibration: turning craft knowledge into a material profile
Experienced digitizers carry a large empirical model in their heads: this knit stretches, that canvas is stable, this thread sits high, that satin width needs more support, and this machine trims unreliably after a tiny object. A compiler needs a place to store the same knowledge.
Calibration turns those observations into measured, versioned inputs.
16.1 Separate the profiles
Do not place every correction in one “machine preset.” Separate at least:
Machine profile
- work envelope and coordinate resolution;
- supported commands and format mappings;
- speed and acceleration behavior;
- jump, trim, stop, and color-change behavior;
- needle layout;
- movement limits;
- known firmware quirks.
Material stack profile
- fabric construction and warp/weft orientation;
- stretch and shear response;
- stabilizer type and layers;
- thread type and weight;
- needle type and size;
- tension and hooping procedure;
- measured pull, push, sinking, and pucker tendencies;
- preferred stitch and row-spacing ranges;
- uncertainty or run-to-run variance.
Process profile
- production speed;
- whether trims are available or manually cut;
- operator stop conventions;
- quality priorities;
- acceptable intervention count;
- environment-specific choices such as adhesive, topping, or basting.
A material profile without its process assumptions is easy to misuse.
16.2 Design a calibration card
A good card varies one or two factors at a time while remaining small enough to stitch repeatedly. Include:
- filled rectangles at several angles;
- the same rectangles with several row spacings;
- satin columns at several widths and curvature radii;
- circles, acute corners, and narrow wedges;
- adjacent regions with several nominal overlaps;
- straight lines in warp, weft, and bias directions;
- isolated dots and small text;
- underlay variants;
- registration fiducials that remain visible in the photograph or scan.
Record the intended geometry and the exact generated program. A calibration sample without its compiler inputs is merely a swatch.
16.3 Register and measure the stitch-out
The measurement loop is:
flowchart LR
A[Generate calibration design] --> B[Stitch under controlled conditions]
B --> C[Photograph or scan with fiducials]
C --> D[Register image to design coordinates]
D --> E[Measure displacement and coverage]
E --> F[Fit or update profile]
F --> G[Validate on held-out motifs]
G -. repeat when setup changes .-> A
With planar fiducials, estimate a projective transform \(H\) such that image coordinates \(\tilde x\) map to design coordinates \(x\):
After registration, estimate the displacement of visible boundaries:
Decompose \(u\) relative to stitch direction \(d\) and its normal \(n\):
This separates along-row contraction or extension from cross-row effects.
Image segmentation is imperfect because thread is shiny and the substrate may show through. Store confidence masks and manually review a subset rather than pretending every pixel is equally trustworthy.
16.4 Fit a compensation model
A simple linear model may be enough for a first profile:
where \(y\) contains measured displacement, and \(X\) may include:
- nominal width;
- stitch angle relative to warp;
- row spacing;
- stitch length;
- curvature;
- underlay type;
- distance from hoop center;
- interaction terms.
For example,
The doubled angle appears because a fabric axis is directional up to \(180^\circ\), not \(360^\circ\).
A table, spline, Gaussian process, or small neural surrogate may outperform a linear model when enough calibration data exists. Prefer the simplest model that predicts held-out samples reliably and exposes uncertainty.
16.5 Model uncertainty
Store not only the expected correction \(\mu_c(x)\) but also uncertainty \(\sigma_c(x)\). A robust compensation may use
for a safety-critical overlap, while avoiding that extra margin where overgrowth would be visible. The factor \(k\) depends on the defect cost.
Uncertainty should increase when the requested design lies outside the calibration range. Extrapolating a model trained on 2–8 mm satin columns to a 16 mm column should produce a conspicuous warning.
16.6 Use held-out tests
Do not evaluate the calibration model only on the rectangles used to fit it. Keep several representative motifs as holdouts: lettering, a curved logo, a small patch, and a dense multi-color overlap.
A profile update is successful when it improves those held-out results without introducing new failures. This is ordinary model validation applied to a craft process.
16.7 Version everything
A profile should identify:
- the compiler and generator versions used for calibration;
- machine model and firmware;
- thread, needle, stabilizer, and fabric identifiers;
- hoop type and orientation;
- tension and speed settings;
- calibration date and operator;
- sample count and uncertainty estimates;
- the range over which the model is considered valid.
Changing the row generator may invalidate a previously fitted compensation model even when the material has not changed. Profiles are part of the software supply chain.
The human–solver interface
A fully automatic stitch compiler is an appealing idea. So is a compiler that guesses exactly what a programmer meant from a screenshot of source code. In both cases, automation works best when the system can preserve intent, expose ambiguity, and accept precise corrections.
The artist or digitizer is not merely moving stitch points. They are editing constraints, priorities, boundary conditions, and the loss function.
17.1 Make constraints first-class objects
Represent a user instruction explicitly:
Constraint {
id
domain: GEOMETRY | FIELD | DENSITY | LAYER | ROUTE | MECHANICS | MACHINE
type
targetObjectIds
spatialSupport
value
strength: HARD | SOFT
weight?
priority?
provenance: USER | IMPORTED | INFERRED | PROFILE | GENERATED
}
Examples include:
- “Keep this hole open.”
- “Make stitches tangent to this guide.”
- “Do not place a seam across the face.”
- “Start this satin at the bottom.”
- “This region must cover that edge.”
- “Travel is allowed beneath this later fill.”
- “Do not trim inside this lettering run.”
- “Preserve this negative-space channel after compensation.”
An inferred constraint should never masquerade as a user assertion. The UI should make it possible to see and override the difference.
17.2 Sparse controls, dense solutions
The user should not need to specify a direction at every point. Let a few guides define a dense field by optimization.
For guide samples \(g_j\) with target directions \(d_j\), solve
This is the same interaction pattern used by many geometric modeling systems: the person gives meaningful sparse constraints, and the solver supplies a coherent interpolation.
Useful direct-manipulation tools include:
- direction brushes and guide curves;
- density brushes;
- seam and singularity placement;
- protected negative-space masks;
- preferred or forbidden travel zones;
- start and end anchors;
- overlap arrows between neighboring regions;
- layer-graph editing;
- region split and merge tools;
- local primitive replacement.
17.3 Explain conflicts instead of silently averaging them
Suppose the user requires a field to be horizontal throughout a disk and tangent to the entire circular boundary. Those constraints conflict. A least-squares solver can quietly produce a compromise, but that may make both intentions look wrong.
When hard constraints are infeasible, report a small conflicting set where practical:
“Boundary-tangent constraint
guide-18conflicts with fixed horizontal directionbrush-4in this region. Relax one constraint, permit a singularity, or split the region.”
For soft constraints, visualize residuals. A direction guide with a \(2^\circ\) residual and one with a \(47^\circ\) residual should not look equally “accepted.”
17.4 Preserve locality
A small edit to one petal should not unpredictably reroute an entire flower unless a global constraint genuinely requires it. Add a stability term when recompiling:
where the distance compares corresponding IR objects, fields, paths, and schedule choices through provenance rather than comparing raw point indices.
Stability has two benefits:
- the design remains understandable to the user;
- small edits produce reviewable diffs and reproducible production changes.
Global improvement is not always worth a surprising rewrite.
17.5 Offer alternatives at genuine branch points
Some decisions are not well represented by a slider. When a narrow branching region can be handled by a seam, a local satin, or a relaxed fill field, present a few named alternatives with predicted consequences:
| Alternative | Likely benefit | Likely cost |
|---|---|---|
| Split along the center vein | Smooth fields on both halves | Visible or structural seam |
| Keep one field with a singularity | Continuous region semantics | Crowding near the singularity |
| Convert the tip to satin | Crisp narrow tip | Different sheen and stiffness |
| Simplify the outline | Robust fill | Less geometric fidelity |
The solver can rank these choices, but the labels should describe the trade-off rather than pretending one answer is mathematically ordained.
17.6 Progressive disclosure
A beginner may need “light,” “medium,” and “heavy” coverage profiles. An expert may need the actual spacing field, underlay inset, endpoint policy, and compensation response. Both can operate on the same model.
Good progressive disclosure follows the IR hierarchy:
- choose intent and style;
- inspect regions and stitch primitives;
- edit fields and layer relationships;
- inspect paths and routing;
- inspect individual stitches only when diagnosing or hand-tuning.
Do not force every user to edit points, but do not imprison advanced users behind a decorative preset name.
17.7 The artistic part has a precise home
“Artistic flair” is not magic sprinkled onto an otherwise mathematical process. It appears in at least four formal places:
- choosing which visual features belong in the source specification;
- selecting stitch primitives and region decompositions;
- setting objective weights and boundary conditions;
- choosing among Pareto-optimal solutions.
The compiler solves the problem it is given. The artist helps define what the problem is.
References
References and further reading
The following sources are a practical starting point rather than an exhaustive bibliography. The embroidery-specific literature is relatively small, so adjacent work in computational fabrication, direction-field design, cloth mechanics, and graph routing is essential.
For the central embroidery-path problem, begin with Liu et al. on direction-aware streamlines and Tian et al. on spiral paths. For the mathematical machinery behind fields, continue with direction-field and vector-field processing references. For the material side, the cloth-modeling and computational-embroidery papers show why geometry alone is not enough. For real implementation semantics, inspect the official Ink/Stitch documentation and pyembroidery source.
Margaret Ellen Seehorn, Gene S.-H. Kim, Aashaka Desai, Megan Hofmann, and Jennifer Mankoff, “Enhancing Access to High Quality Tangible Information through Machine Embroidered Tactile Graphics,” Proceedings of the ACM Symposium on Computational Fabrication (SCF ’22), Article 23, 2022. https://doi.org/10.1145/3559400.3565586
Gabriel Cirio, Jorge López-Moreno, David Miraut, and Miguel A. Otaduy, “Yarn-Level Simulation of Woven Cloth,” ACM Transactions on Graphics 33, no. 6, Article 207, 2014. https://doi.org/10.1145/2661229.2661279
Georg Sperl, Rosa M. Sánchez-Banderas, Manwen Li, Chris Wojtan, and Miguel A. Otaduy, “Estimation of Yarn-Level Simulation Models for Production Fabrics,” ACM Transactions on Graphics 41, no. 4, Article 65, 2022. https://doi.org/10.1145/3528223.3530167
Qiming Tian, Yupin Luo, and Dongcheng Hu, “Spiral-Fashion Embroidery Path Generation in Embroidery CAD Systems,” Computer-Aided Design 38, no. 2, pp. 125–133, 2006. https://doi.org/10.1016/j.cad.2005.08.004
Zhenyuan Liu, Michal Piovarči, Christian Hafner, Raphaël Charrondière, and Bernd Bickel, “Directionality-Aware Design of Embroidery Patterns,” Computer Graphics Forum 42, no. 2, pp. 397–409, 2023. https://doi.org/10.1111/cgf.14770
Xiangjia Chen, Guoxin Fang, Wei-Hsin Liao, and Charlie C. L. Wang, “Field-Based Toolpath Generation for 3D Printing Continuous Fibre Reinforced Thermoplastic Composites,” Additive Manufacturing 49, Article 102470, 2022. https://doi.org/10.1016/j.addma.2021.102470
Kate S. Glazko, Alexandra A. Portnova-Fahreeva, Arun Mankoff-Dey, Afroditi Psarra, and Jennifer Mankoff, “Shaping Lace: Machine Embroidered Metamaterials,” Proceedings of the 9th ACM Symposium on Computational Fabrication (SCF ’24), 2024. https://doi.org/10.1145/3639473.3665792
Ink/Stitch, “Tatami Stitch (Fill Stitch),” official documentation. https://inkstitch.org/docs/stitches/fill-stitch/
Fernando de Goes, Mathieu Desbrun, and Yiying Tong, “Vector Field Processing on Triangle Meshes,” ACM SIGGRAPH 2016 Course Notes, 2016; and Felix Knöppel, Keenan Crane, Ulrich Pinkall, and Peter Schröder, “Globally Optimal Direction Fields,” ACM Transactions on Graphics 32, no. 4, Article 59, 2013. Course notes; direction-field paper
Jack Edmonds and Ellis L. Johnson, “Matching, Euler Tours and the Chinese Postman,” Mathematical Programming 5, pp. 88–124, 1973. https://doi.org/10.1007/BF01580113
Ink/Stitch, “Tools: Stroke—Redwork,” official documentation. The tool’s routing goal is to traverse every path exactly twice. https://inkstitch.org/docs/stroke-tools/
Ink/Stitch, “Commands,” official documentation. https://inkstitch.org/docs/commands/
Huamin Wang, James F. O’Brien, and Ravi Ramamoorthi, “Data-Driven Elastic Models for Cloth: Modeling and Measurement,” ACM Transactions on Graphics 30, no. 4, Article 71, 2011. https://doi.org/10.1145/2010324.1964966
Ink/Stitch, “Satin Column,” official documentation. https://inkstitch.org/docs/stitches/satin-column/
Abhinit Sati, Ioannis Karamouzas, and Victor B. Zordan, “DIGISEW: Anisotropic Stitching for Variable Stretch in Textiles,” Proceedings of the ACM Symposium on Computational Fabrication (SCF ’21), Article 3, 2021. https://doi.org/10.1145/3485114.3485121
Yu Jiang, Narjes Pourjafarian, Alice Haynes, and Jürgen Steimle, “Embrogami: Shape-Changing Textiles with Machine Embroidery,” Proceedings of the 37th Annual ACM Symposium on User Interface Software and Technology (UIST ’24), 2024. https://doi.org/10.1145/3654777.3676431
Ayesha Nabila, Hua Ma, and Junichi Yamaoka, “4D Embroidery: Implementing Parametric Structures in Textiles for Sculptural Embroidery,” UbiComp/ISWC ’22 Adjunct, pp. 88–90, 2022. https://doi.org/10.1145/3544793.3560358
Xinling Chen, Michael McCool, Asanobu Kitamoto, and Stephen Mann, “Embroidery Modeling and Rendering,” Proceedings of Graphics Interface 2012, pp. 131–139, 2012. https://doi.org/10.5555/2305276.2305299
EmbroidePy, “pyembroidery,” an open-source Python library for reading and writing embroidery formats. https://github.com/EmbroidePy/pyembroidery
Ink/Stitch, “Tack and Lock Stitches,” official documentation. https://inkstitch.org/docs/stitches/lock-stitches/