fogbound.net




Mon, 18 Sep 2023

Borderline

— SjG @ 12:21 pm

When designing visual stuff, I often would like the ability to create a patterned frame for whatever it is I’m doing. It’s not so much work to drag and move image tiles around to make a nice frame, but I wanted to make it easier.

Thus “Borderline” was born. It’s a JavaScript tool for laying out tiles into frame designs, with a few automated features to make playing around easier.

Borderline lets you arrange small SVG files to form a border. It optionally does some rotational and mirroring transforms to make the pattern look nice.

It includes a small collection of custom, original SVG tiles to use for making nice borders. You can also “upload” your own! (since this all takes place in your browser, nothing actually gets uploaded to a server or leaves your local machine).

Once you’re happy with your design, you can export the entire border as an SVG suitable for printing or modification in your favorite vector graphics application.

You should be able to use just about any SVG file as a tile, although if it’s too big or complicated your browser may run out of memory and behave badly.

You can try it here: Borderline. Source is available at Codeberg.


Fri, 30 Jun 2023

Perspective correction and uncanny valley

— SjG @ 8:23 am

It’s interesting how optical corrections to “fix perspective” can end up making something look simultaneously “correct” and very, very wrong.

When I say “fix perspective,” I’m talking about the convergence of lines due to perspective. The further something is from your eye, the smaller it appears, so if you’re looking up at a building, the top looks narrower than the bottom. Similarly, if it’s not in the center of the frame, the different vanishing points combine with general lens distortion to make a funny-house mirror image.

This building does not, in fact, get smaller on the higher floors.

Now, optically, your eye sees perspective this way too, but the image-processing in the brain tends to counter it. What you “know” about the building overrides what you’re seeing, and you don’t really notice that it’s going all pointy on top. Weirdly, something that doesn’t bother us when we’re out on the street tends to bother a lot of people when they see it in photography.

In the old days, if you wanted to prevent this perspective narrowing of an architectural feature, you’d use an expensive and somewhat esoteric piece of equipment called a “tilt shift lens.” It would allow you to align the lens with the plane of what you’re photographing, and thereby cancel out some of the distortions. What that means in practical terms is that you can, in a controlled way, counter the convergence of lines due to perspective.

Now we do the same with ordinary lenses and software.

Where the “uncanny valley” comes in is that the convergence due to perspective can be fixed, but the point of view does not actually change. Where you see this dramatically is in something like this tower, where the perspective is telling your eye that you’re seeing it straight on, while the point of view of the constituent beams is from below. It’s mildly Escheresque. Compare the “corrected” and “uncorrected” views below.

I guess the solution is to always photograph everything using remote-controlled drones that sit in the perfect perspective spot, and then fix any lens distortions.


Sun, 28 May 2023

Caution!

— SjG @ 9:43 am

I recently came across this site for creating warning signs of various sorts. It was intended for use by those who operate laboratories and research facilities. It was pointed out to me because it has a random sign generation function, which creates some funny and absurd signs, perfect for your surrealist academies.

My mind, however, went to Shakespeare.


Sun, 2 Apr 2023

Old Limericks

— SjG @ 10:27 am

Going through my old scribbled notes, I came across these from 1994:

A limerick writer I’m not,
for rhyming no talent I’ve got.
I know to count feet
or syllabic beat,
but how many lines I’ve forgot.

The limericks that Tina once wrote
with one affliction were smote:
They ended so fine,
on next to last line

A poet there was from Bombay,
whose limericks were strange in one way:
three lines they’d have

There is a young gal from Purdue,
whose limericks all end at line two.

There once was a man from Verdun,

(and then I seem to recall there’s a limerick about a guy named Nero…)


Mon, 30 Jan 2023

Back on my BS again

— SjG @ 8:45 pm

Which BS is that, I hear you ask? With so many possible domains to choose from?

It’s my interactive geometry tiling BS this time. In the simplest description, the program should provide a triangle and allow the user to draw on it, and then expand that into a tiling across a whole plane. Eventual goals include different kinds of triangles and tilings (30-60-90 triangles into hexagons, 45-45-90 triangles into squares, and then later stuff that’s not quite as regular and that will form octagon/square tilings, and so on), weaving of the lines that are drawn, and so on.

It’s sort of embarrassing to see how many times I’ve gone and worked on this same basic idea without ever having really completed it. I remember doing stuff in Turbo-C on a DOS PC for drawing in VGA resolutions (ooh! ahh!) in the early 90s, and then again in a Java AWT applet in the late 90s. I have various residues of Adobe JSX scripts to do similar stuff in Photoshop and Illustrator, trying to use their discontinued ExtendScript interface. I have an attempt written in Processing. I have at least two previous attempts in JavaScript using Canvas.

Well, here I am, doing it in JavaScript and (quelle nouveauté!) SVG.

So far, I have the 30-60-90 triangles working. I can set pen widths and colors. I can save/load works-in-progress, and render and export the SVG files. I don’t yet have editing or removal of lines implemented. I haven’t even started thinking about the weaving problem again.

Watch this space (but not too closely) for updates. Maybe I’ll actually finish this time ’round.