Curve (com.elbeno.curve) is my common lisp package for doing cool things with two-dimensional curves. In particular, modulating cubic Bézier curves and splines, but also approximating arbitrary elliptical and circular arc segments with cubic Bézier curves. It depends on Vector (com.elbeno.vector), a cobbled together set of functionality for representing and manipulating points on the 2D Cartesian… Continue reading Curve and Vector
Month: March 2008
Approximating elliptical arcs with Bézier curves
In doing my modulation work with curves and ellipses, I extended the vecto function for drawing an ellipse to enable an oriented ellipse. Lately it occurred to me that this didn’t go far enough in terms of functionality, and I began wondering about how to draw part of an elliptical arc. Vecto’s ellipse drawing function… Continue reading Approximating elliptical arcs with Bézier curves
Functional Fills with Vecto
I’ve been wanting to do exclusive-or functional fill in vecto for a while, so tonight I delved in. I added a pixel function to the graphics state and kept the default as the normal alpha-blending it was already doing. The pixel function signature is a bit clumsy, but it was easy to knock up a… Continue reading Functional Fills with Vecto
The Hedgehog
The hedgehog is a noble beast; he keeps the garden clear Of slugs and snails and other pests throughout the temperate year. Just after dusk you’ll see him on his customary beat Hunting Lumbricus terrestris or some other juicy treat. Although he’s not the biggest or the fastest or most muscular, He’s the most learned… Continue reading The Hedgehog
A bit of Pythagoras
Given Pythagorean triples that satisfy the Diophantine equation: a² + b² = c² where a, b and c share no common factors, one of a and b must be odd, the other must be even, and c is always odd. First, note that squares of even numbers are always divisible by 4. [Lemma 1] (2n)²… Continue reading A bit of Pythagoras
Even more on ellipses and splines
Honestly, they’re incredibly interesting. Anyway, I’ll skip straight to the pièce de résistance: This is a 4-curve cubic Bézier spline modulated onto an ellipse. The ellipse [a=4, b=3] is at an angle of π/4. C1 continuity of the complete curve is preserved. The flickr set tells the story of how I got here. This is… Continue reading Even more on ellipses and splines
On the Benefits of Showering
From time to time when I’m perplexed Or by a tricky problem vexed; A cipher that just will not yield But keeps its mystery concealed, I find I have a last resort Before cerebral fuel runs short: I open up the bathroom door And step onto the tiled floor. The whirring fan, the gurgling drain,… Continue reading On the Benefits of Showering
Ellipses & Splines again
After some code cleanup and generalisation, I can now modulate whole splines onto ellipses and onto splines themselves. Here is my simple 4-bezier spline modulated onto an ellipse: And onto itself: Repeatedly modulating a spline onto itself while varying the frequency parameter leads to some interesting and fractal patterns. Nice.
Wish-it-was two-factor authentication
In order to print out a tax form, I’ve just had to go through some silly security question rigmarole with my online bank. The wish-it-was two-factor authentication is getting quite out of hand these days. They are really desperate to give the appearance of security. In addition to displaying a chosen/random image and “security phrase”… Continue reading Wish-it-was two-factor authentication
On Being, and Raising, a Gifted Child
[apologies to my LJ readers for the lack of cut] Lately I’ve been reading books on gifted children: how to identify them; how to deal with them; what to expect as a parent. Is mini-Elbeno gifted? Without wanting to sound like a competitive parent, and properly considering that it’s still early days, I think he’s… Continue reading On Being, and Raising, a Gifted Child