Chaikin Curves
George Chaikin's corner-cutting algorithm (1974) is one of the simplest and most elegant ideas in computational geometry: take an open polygon, cut off every sharp corner at the one-quarter and three-quarters marks along each edge, and repeat. Within three or four iterations, a jagged gestural polyline converges smoothly into a uniform quadratic B-spline curve.
In traditional freehand sketching, the hand rarely draws a finished line in a single pass. Instead, an artist sketches loosely—making several rapid, exploratory passes over the same gesture, searching for the curve's true trajectory. Each successive pass reinforces the contour while mental and motor feedback discard the outliers, allowing the stroke to gradually "settle" into its final, confident form.
The gesture settles the curve. On this canvas, sketching over an existing stroke composites the new pass into the curve's underlying vector geometry. When a stroke is drawn, the engine parameterizes it by arc length, evaluates spatial proximity and tangent alignment against nearby curves, and blends the control polygons using confidence-weighted averaging:
$$P_{\text{settled}}(t) = (1 - \alpha) P_{\text{settled}}(t) + \alpha P_{\text{gesture}}(t) \quad \text{where} \quad \alpha = \frac{1}{1 + k^{0.75}}$$
As the stroke count $k$ increases, confidence tightens, high-frequency motor wobble dissolves, and Chaikin subdivision produces a poised, settled vector curve. Ghost traces of earlier exploratory passes remain visible beneath, documenting the hand's search.
Chinese Brushwork (毛笔 / 水墨). Rather than a sterile vector ribbon, the settled curve is rendered with a bitmapped Chinese brush engine:
- Multi-bristle tuft dynamics: dozens of individual animal hairs (狼毫 wolf hair and 羊毫 goat hair) track along the curve's normal vectors $\mathbf{N}(s)$, expanding outward under pressure and tapering toward entry (cángfēng 藏锋) and release (lùfēng 露锋).
- 飞白 (Fēibái / Flying White): When a stroke is drawn rapidly or lightly, individual bristles separate and ink starves, leaving dry calligraphic striations where the tooth of the paper shines through.
- Ink diffusion (水墨晕染): Slower strokes and corner turns (dùnbǐ 顿笔) pool ink, bleeding softly into the fibrous texture of Xuan paper (宣纸).
- Ink tones: Switch between dense sumi (濃墨), dry flying white (飛白), layered pale wash (淡墨), and scorched calligraphy (焦墨).
Interactive Controls & Motifs. Draw freely with an Apple Pencil, stylus, trackpad, or mouse. Toggle Vector Geometry to inspect the raw control polygon and corner-cutting vertices in real time; dial the Chaikin Passes slider from 1 to 6 to watch subdivision unfold; or explore curated multi-pass motifs including 墨竹 (Bamboo stalk and leaves), 禅圆 (Ensō circle), 永字八法 (the eight principles of Yǒng), and 远山 (Mountain mist). Export your drawing as a high-resolution PNG or pure vector SVG.
Plain HTML5 canvas and JavaScript, no libraries, light and dark mode to match the page.
References
- Chaikin, G. M. (1974). An algorithm for high-speed curve generation. Computer Graphics and Image Processing, 3(4), 346–349.
- Riesenfeld, R. F. (1975). On Chaikin's algorithm. Computer Graphics and Image Processing, 4(3), 304–310 — proving convergence to uniform quadratic B-splines.
- Bacus, J. (2021). Digital Sketching: Computer-Aided Conceptual Design. John Wiley & Sons.
- Chiang, Y. (1973). Chinese Calligraphy: An Introduction to Its Aesthetic and Technique. Harvard University Press.