humanLines icon indicating copy to clipboard operation
humanLines copied to clipboard

"Spikes" between paths

Open CapacitorSet opened this issue 8 years ago • 2 comments

Heyo! I've been trying to use humanlines to draw human-like text, but for some reason it shows spikes between one path and another. Do you know what may cause this?

Screen

The code is here, and here is a tarball for a working version.

CapacitorSet avatar Apr 19 '18 19:04 CapacitorSet

Yikes, yeah, that absolutely looks like a bug. My guess is that the randomness added to each spline, which is a constant amount not dependent on the scale of the line, is causing the spikes.

If I change the font size to 900 and the Y coord to 600:

path = font.getPath("lorem ipsum", 0, 600, 900);

The result looks quite a bit better, but the sharp edges are still there.

I think fixing this will require adding some semantic information to the algorithm, so that the lines are not drawn entirely independently as they currently are (e.g., if two lines share a start/ending point, the results should be smooth). I'll take a look next week...

Sorry for the trouble!

RyanMarcus avatar Apr 19 '18 23:04 RyanMarcus

Sorry for the trouble!

No problem! That was just a "weekend project" to fiddle with humanlines, no big deal. Interesting project, by the way!

CapacitorSet avatar Apr 19 '18 23:04 CapacitorSet