Expand description
Recognize freehand strokes as lines, circles, arcs, or cubic Beziers.
Classification tolerances scale with the stroke’s bounding-box extent. Open strokes near their endpoint chord become lines. A good least-squares circle fit produces a circle for closed strokes or an arc for open strokes. The fallback cubic uses endpoints and samples at one-third and two-thirds of the stroke’s arc length.
Enums§
- Hand
Draw Shape - A recognized handdraw shape, in plane
(u, v)coordinates. Point semantics match the solver’s geometry (line = [a, b],circle = [center, rim],arc = [center, start, end],bezier = [p0, c1, c2, p1]).
Functions§
- emit_
shape - Materialize a recognized
HandDrawShapeintodoc: mint its points (endpoints snap to an existing PRE-STROKE point withinsnap_radiusso a stroke drawn onto prior geometry coincides) and append the geometry (non-construction; the bezier fallback also adds its two dashed control-handle guide lines, matching the bezier tool). Never solves; the caller re-solves. - recognize
- Classify a raw uv
strokeinto one recognizedHandDrawShape. See the module docs for the tolerance rules. A stroke of fewer than 2 samples degenerates to a zero-length line (callers guard against tiny strokes before recognizing). - stroke_
extent - The bounding-box diagonal of a uv stroke — the relative-tolerance scale (and the engine’s “too tiny to recognize” gauge).