Sketch-Based Interfaces and Modeling (SBIM) Sketching piecewise clothoid curves James McCrae à , Karan Singh Dynamic Graphics Project, University of Toronto, Canada article info Article history: Received 14 October 2008 Received in revised form 16 May 2009 Accepted 29 May 2009 Keywords: Line and curve generation abstract We present a novel approach to sketching 2D curves with minimally varying curvature as piecewise clothoids. A stable and efficient algorithm fits a sketched piecewise linear curve using a number of clothoid segments with G 2 continuity based on a specified error tolerance. Further, adjacent clothoid segments can be locally blended to result in a G 3 curve with curvature that predominantly varies linearly with arc length. We also handle intended sharp corners or G 1 discontinuities, as independent rotations of clothoid pieces. Our formulation is ideally suited to conceptual design applications where aesthetic fairness of the sketched curve takes precedence over the precise interpolation of geometric constraints. We show the effectiveness of our results within a system for sketch-based road and robot- vehicle path design, where clothoids are already widely used. & 2009 Elsevier Ltd. All rights reserved. 1. Introduction Curves are ubiquitous in Computer Graphics, as primitives to construct shape or define shape features, as strokes for sketch- based interaction and rendering or as paths for navigation and animation. Motivated originally by curve and surface design for engineering applications, complex shapes are typically repre- sented in a piecewise manner, by smoothly joining primitive shapes (see Fig. 1). Traditionally, research on curve primitives has focused on parametric polynomial representations defined using a set of geometric constraints, such as Be ´ zier or NURBS curves [1]. Such curves have a compact, analytically smooth representation and possess many attractive properties for curve and surface design. Increased computing power, however, has made less efficient curve primitives like the clothoid a feasible alternative for interactive design. Dense piecewise linear representations of continuous curves have also become increasingly popular. Desirable geometric properties, however, are not intrinsically captured by these polylines but need to be imposed by the curve creation and editing techniques used [2–4]. An important curve design property is fairness [5–7], which attempts to capture the visual aesthetic of a curve. Fairness is closely related to how little and how smoothly a curve bends [7] and for planar curves, described as curvature continuous curves with a small number of segments of almost piecewise linear curvature [5]. The family of curves whose curvature varies linearly with arc length were described by Euler in 1774 in connection with a coiled spring held taut horizontally with a weight at its extremity. Studied in various contexts in science and engineering, such a curve is also referred to as an Euler spiral, Cornu spiral, linarc, lince or clothoid (see Fig. 2). Clothoids are especially useful in transportation engineering, since they can be navigated at constant speed by linear steering and a constant rate of angular acceleration. Roller-coasters are frequently composed of sequences of clothoid loops. While intrinsic geometric splines like clothoids were introduced in computer aided design in 1972 [8] and subsequently developed as transition curves for road design [9,10], they have had little recent exposure in mainstream Computer Graphics. In this paper, we exploit the fairness properties of clothoids to fit 2D strokes for sketch-based applications. 1.1. Problem statement Polyline stroke data often need to be denoised and processed into fair 2D curves for further use in many sketch-based applications. This is usually done using smoothing filters [3] or by cubic or high-order spline fitting [11,12]. Iterative smoothing is best suited to removing high-frequency sketching noise and tends to produce low-frequency wiggles in the curve (local pockets of smooth curvature based on filter size). Spline fitting results, though visually smooth, frequently exhibit poor quality curvature plots (see Fig. 3). We present a new approach to processing sketch strokes using clothoids, that intrinsically favor line and circular arc segments and result in holistically fair G 2 curves. 1.2. Overview of our approach Our algorithm for fitting a sequence of G 2 clothoid segments to polyline stroke data is a two-step process (see Fig. 4). We first fit a ARTICLE IN PRESS Contents lists available at ScienceDirect journal homepage: www.elsevier.com/locate/cag Computers & Graphics 0097-8493/$ - see front matter & 2009 Elsevier Ltd. All rights reserved. doi:10.1016/j.cag.2009.05.006 à Corresponding author. E-mail addresses: mccrae@dgp.toronto.edu (J. McCrae), karan@dgp.toronto.edu (K. Singh). Computers & Graphics 33 (2009) 452–461