Closed ds300 closed 6 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
examples | ✅ Ready (Inspect) | Visit Preview | Nov 29, 2023 11:36am |
Hey, reviewing now. In general this is an improvement: the only place where I've noticed a regression in quality is that sharp corners tend to be reduced in size.
IIRC in our current freehand we actually push these corners out by a certain distance in order to capture detail. I'm not sure what the motivation for that was—it may have been a "feels good" feature, I vaguely recall adding that after watching videos of me drawing on the ipad.
Seems to handle short scribbles very well.
Some rare errors near the start of lines, like this one?
ok i think i fixed those things, take another look when you have a moment.
i think if we can get rid of these guys in a follow up it will actually be pretty close to perfect
Comparing the results, a few things I've noticed:
Knees are pointier due to the algorithm identifying a "sharp curve" as a "sharp corner". This is really difficult to distinguish; I remember trying to track the rate of directional change using acceleration in the past but likely just picked a "good enough" dot product change.
For example, the W and E here:
The settings you've used here is often an improvement, however, so I don't think it's a problem. For example, see the much improved corners around the W, A, and the twist to the D.
In general this is a big improvement in the detail we're able to pull from the same inputs. Well done!
I'm pushing a few small changes to the rendering for draw shapes.
Our ink has kinda homely elbows sometimes. This PR believes elbows can and should be beautiful.
The way this is achieved is by partitioning the points fed into perfect-freehand at elbow points, and then rendering each partition separately.
Doing this naively ballooned the size of the SVG path data so I also did a tiny bit of refactoring to allow us to use the SVG arc command. At the same time we are able to easily omit some of the points around the beginnings and ends of segments thanks to the nature of the corners.
All of this results in an average 13% reduction in SVG path data size over the current version.
Change Type
patch
— Bug fix