2
$\begingroup$

I'm working with piecewise polynomial spirals: curves of the form $z(t) = z_0 + \int_0^t e^{i f(s)} ds$ where $f$ is a quartic polynomial determined by the tangent angles and curvatures at given endpoints.

When an arc violates a constraint – goes too near to or too far from a point $C$ – I want to bend it so that it barely meets the constraint: that is, so that it passes through a point $B$, at distance $h$ from $C$, on the line that contains $C$ and crosses the original arc at a right angle. (Below, I'll use $z_a$ and $t_a$ for that crossing.) I can then either break the arc in two, joined at the new point, or raise the degree of $f$ by one to fit a new curvature where it passes the constraint point.

Obviously the new point should have the same tangent angle $f(t_a)$ as the old, but how do I estimate the new curvature?

My least-ugly idea so far is: find the polynomial spline of degree 6 5 that matches the original arc and its first two derivatives at the endpoints, and with $z(t_a \pm ih) = C$; take the new tangent angle and curvature from the first two derivatives at $t_a$. I'm hoping you can do better.

Context, if you're interested: my project is to create pretty outline fonts that, at appropriate low resolution, will match certain old favorite bitmap fonts dot-for-dot. Not trusting my own ability to draw graceful curves, I'm working on an algorithm to minimize the integral over path length of the square of the first derivative of curvature, while passing within half a grid-unit of each original black dot and missing each original white dot by the same amount.

(My first question; please suggest better tags)

LATER: Here's an estimate that at least has intuitive plausibility and lends itself to iterative improvement: $$ f'(t_a) \pm \frac{(h-g)}{h} \frac{2h}{L} \frac{1}{h} $$ where $h$ is the desired separation, $g$ is the actual separation, and $L$ is the length of the original arc.

LATER STILL (Aug 30): Another idea that should be easier to implement. Call the original arc's endpoints A,B. Make an arc such that $$ z(-L) = A \\ f(-L) = \theta_A \\ f'(-L) = \kappa_A \\ f(+L) = \theta_C \\ $$ as you might expect, but $$ z(+L+ih) = C $$ and similarly from B on the right. Adopt a compromise between the two resulting curvatures at the middle, weighted in favor of the shorter of these two arcs.

$\endgroup$
  • $\begingroup$ If you're creating fonts, then your final output will presumably be either quadratic or cubic splines. So, I'd recommend working with these directly from the outset. Also, read Raph Levien's papers on font design and elastica, if you haven't already. en.wikipedia.org/wiki/Raph_Levien $\endgroup$ – bubba Jul 29 '15 at 5:44
  • $\begingroup$ With polynomial splines, computing the penalty function is not nearly so convenient. $\endgroup$ – Anton Sherwood Jul 29 '15 at 23:42
  • $\begingroup$ (Dammit, why can't I have a CR within a comment?) — What I've read, including Levien's doctoral thesis, is mostly about fitting given points exactly, whereas I don't care if my output exactly matches any of the input points. $\endgroup$ – Anton Sherwood Jul 29 '15 at 23:46
  • $\begingroup$ Also, it's less easy to maintain continuity of curvature with cubic splines. $\endgroup$ – Anton Sherwood Jul 29 '15 at 23:49
  • $\begingroup$ I've since decided that I like “my least-ugly idea so far” better than the others. $\endgroup$ – Anton Sherwood Sep 2 '16 at 19:27
0
$\begingroup$

My two cents. You can develop an ability to recognize how graceful curves come about.It is a reconnaissance of curvature, a "driving" sense around corners, steering ahead of corners and walls when we follow the way a curve goes forward by respecting their intrinsic or natural relation/equation.

A catalog of curves ( Lockwood, Mathworld, http://www-history.mcs.st-and.ac.uk/Curves/Curves.html, http://paulbourke.net/geometry, the French site, Zeeman & Rene Thom Cusp catastrophe ) etc. among others would all be helpful. A single case for Elastica $ (a^2\cdot \kappa = y )$ might perhaps not alone suffice as curvature variation situation.

Some Eastern scripts have cusps ( curvatures tending to $\infty$ ), their font development may involve noticing quite fast changing curvature relations.

$\endgroup$
  • $\begingroup$ I'd treat a stroke with a cusp, as in the middle of ‘3’, as two strokes that meet at a point. $\endgroup$ – Anton Sherwood Jul 30 '15 at 7:47
  • $\begingroup$ Yes at that arc length of cusp $ s= s_1$ curvature should preferably have a form like $ 1/ (s-s_1) $ $\endgroup$ – Narasimham Jul 30 '15 at 8:35
  • $\begingroup$ If curvature is a continuous function of arc length and it goes to infinity, you get an infinite number of coils, not a simple cusp. $\endgroup$ – Anton Sherwood Jul 31 '15 at 4:23
  • $\begingroup$ They may coil between the cusps.Please examine a cycloid when the tracing point touches x-axis. It has the differential equation $ k_2/ k_1 = 2 $ where I have written $ k_2 = \cos \phi /r ,\phi$ is slope. $\endgroup$ – Narasimham Jul 31 '15 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.