Skip to content
Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Category: Programming

Functional Fills with Vecto

elbeno, 25 March, 200825 March, 2008

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…

Even more on ellipses and splines

elbeno, 15 March, 200815 March, 2008

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…

Ellipses & Splines again

elbeno, 10 March, 2008

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.

Splines and modulation

elbeno, 2 March, 20082 March, 2008

My efforts to equally subdivide a curve along its length have, in part, been leading to this. First, I extended the sampling to work with splines (made up of cubic Bézier curves with c1 continuity). This shot shows 4 curves put together to form a spline: Next, I wrote some…

And it was done

elbeno, 1 March, 2008

Since I already had the binary search and interpolation code, it was just a matter of writing different samplers for ellipses and Bézier curves. ;; make a sampler function for a bezier curve (defun make-bezier-sampler (p0 p1 p2 p3) (lambda (k) (decasteljau p0 p1 p2 p3 k))) ;; make a…

More on ellipses

elbeno, 1 March, 20081 March, 2008

I think I will use the same method as I do for Bézier curves to step along the circumference. Another generalisation I had to make from the circle code is with respect to the normal. For a circle of radius r, centred on the origin, and parameterised by angle θ,…

On ellipses

elbeno, 1 March, 20081 March, 2008

Having conquered equidistant spacing along a Bézier curve, my thoughts now turn to the same problem for an ellipse. I have solved the problem for a circle of course, which is a special case of an ellipse. One would think that going from a circle to an ellipse would be…

Profiling with SBCL

elbeno, 29 February, 200829 February, 2008

My Bézier curve code was not optimal, so I decided to learn how to profile with SBCL. In particular, I was not yet doing a binary search of the sampled points, neither was I doing an interpolation to recover the parameter t. Finally, I was sampling the curve at a…

Experimenting with (cubic) Bézier subdivision

elbeno, 27 February, 20081 March, 2008

As you know, a Bézier curve (here meaning specifically a cubic Bézier) is often used for drawing all kinds of things in vector graphics. It has the nice property that the endpoints and control points form a bounding box, and deCasteljau’s algorithm is a nice numerically stable way of evaluating…

Sneak preview

elbeno, 19 February, 200828 February, 2008

This is a sneak peek at my current personal project. A bit of computerised heraldry. (“Sable a [ordinary] ermine.” Left to right, top to bottom: chief, fess, pale, cross, bend, bend sinister, chevron, saltire. Yeah, I know; charges on a bend should be bendwise. It’s a work in progress.)

  • Previous
  • 1
  • …
  • 4
  • 5
  • 6
  • 7
  • Next
©2026 Why is a raven like a writing desk? | WordPress Theme by SuperbThemes