Hacker News new | ask | show | jobs
by torginus 87 days ago
One of the strangest discoveries of my life was that vector graphics is a solved problem, and the solution is turtle graphics that I was taught in primary school.
4 comments

I still have a copy of Hobby Electronics from 1982 that my dad bought when I was about 9 or so and in primary school, with the article on building Hebot II.

I got various bits and pieces together and experimented with doing things like driving Big Trak gearboxes (remember? J Bull Electrical used to advertise them in every magazine, along with all sorts of fascinating old shite) with an interface plugged into my ZX Spectrum, but I never actually built one.

Funnily enough I was thinking about that the other day, and how sad it is that schools like my son's primary school just have very locked-down iPads for the children to use instead of the BBC Micros we grew up with (I'm guessing you're more approximately my age than primary school age, and those things were in schools well into the early 2000s. Bombproof.) that could be endlessly tinkered with.

Anyway the guy next door does a lot of 3D printing and it's never been easier to draw PCBs and get them made or even etch them at home (it's the drilling bit I hate). So maybe now EBv2.0 is five, it's time to dig out that issue of HE and start transcribing stuff into Kicad and Blender :-)

This doesn't make any sense. Vector graphics aren't specified by rotating and walking a turtle, and that is obviously a tiny tiny trivial part of the vector graphics field. Try rendering a vector font directly on a GPU and see how far RIGHT 45 FORWARD 10 gets you.
Pretty far? No idea about the sota in GPU vector rendering, but if you triangulate shapes, RIGHT 45 FORWARD 10 would produce a vertex buffer of points on the CPU, which could be rendered on the GPU.
GPU font rendering isn't done by converting the letters to polygons like that. That would be prohibitively expensive.
I was trying to do a bit of generative art for a pixel display in my window, and feeling creatively stuck, then realized I wanted turtle graphics. Implemented that and I was unlocked.
Well turtle graphics is not implemented in drawvg. But it should be easy to implement it.
SVG path syntax [1] mentioned as being an inspiration in the article is very similar to Turtle graphics (move, lineto, etc.)

[1] https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/E...

Very many vector graphics standards use the idea of a current position. A distinguishing feature of turtle graphics is to have a current direction as well.

It's a shame SVG doesn't. Many shapes can be specified much more concisely.

plotter languages have the same concept.
Which ones? I've just skimmed through docs for HP-GL, DMPL and Gerber, but I can't see anything.