HN user

shihn

1,317 karma
Posts61
Comments80
View on HN
cafemedia.com 3y ago

CafeMedia Acquires Slickstream

shihn
1pts0
pshihn.github.io 4y ago

Show HN: Venny is a set of components to create Venn Diagrams on a web page

shihn
12pts0
shihn.ca 5y ago

Analyzing Voting Systems

shihn
7pts0
shihn.ca 5y ago

Autoplaying back-to-back videos on the web using a Media Pool

shihn
3pts0
www.slickstream.com 6y ago

How COVID-19 has affected food blogging

shihn
2pts0
roughnotation.com 6y ago

Show HN: RoughNotation – create and animate hand-drawn annotations on a web page

shihn
696pts74
shihn.ca 6y ago

How to emulate hand-drawn shapes – Algorithms behind RoughJS

shihn
36pts0
shihn.ca 6y ago

Reducing Colors in an Image ⇢ Dithering

shihn
4pts0
roughjs.com 6y ago

Rough.js v4.0 – hand-drawn, sketchy graphics

shihn
307pts20
legrajs.com 6y ago

Show HN: LegraJS – Draw using Lego-like brick shapes on Canvas

shihn
140pts27
legrajs.com 6y ago

Show HN: Draw using Lego like brick shapes on Canvas – LegraJS

shihn
5pts0
github.com 6y ago

Show HN: Sockly – Easiest Way to Work with API on WebSockets or WebRTC

shihn
9pts0
brickception.xyz 7y ago

Show HN: Brickception A fun breakout game with Popup Windows

shihn
2pts0
github.com 7y ago

Wired Elements 1.0: Hand-Drawn, Sketchy UI Elements for the Web

shihn
6pts0
whydocatsanddogs.com 7y ago

Whydocatsanddogs: A visual exploration of cat and dog lovers

shihn
1pts0
github.com 7y ago

Show HN: ByProxy – A different way of thinking of web client-server RPC

shihn
3pts0
github.com 7y ago

Show HN: Windtalk – Simplest way to work with iframes

shihn
2pts0
github.com 7y ago

Rough.js hand-drawn graphics library v3.1 released

shihn
4pts0
github.com 7y ago

Show HN: Base69 Binary-to-Text Encoding. Like Base64 but NOICEr

shihn
4pts0
news.ycombinator.com 7y ago

Ask HN: What was the last Math formula/concept you used while coding?

shihn
10pts5
github.com 7y ago

Show HN: MathML using custom-elements – works across all browsers

shihn
6pts1
pshihn.github.io 7y ago

Computer generated hand-drawn skulls

shihn
2pts0
github.com 7y ago

Show HN: PortCast – multicast from one worker/iframe to other workers/iframes

shihn
2pts0
github.com 7y ago

Show HN: WindTalk – Simplest way to communicate with iFrames and other windows

shihn
1pts1
pshihn.github.io 7y ago

Show HN: Create sketchy, hand-drawn version of image in browser with WebAssembly

shihn
16pts3
github.com 8y ago

Show HN: CSS Houdini Paint Worklets to add sketchy styling to elements using CSS

shihn
3pts1
github.com 8y ago

Hand-drawn graphics library Rough.js has new fill styles

shihn
98pts11
lumin.rocks 8y ago

Show HN: Lumin – Animate text highlighting or use highlighting to show progress

shihn
6pts1
wiredjs.com 8y ago

Show HN: Wired-elements – UI web components with a hand drawn, sketchy look

shihn
650pts120
github.com 8y ago

Show HN: Call functions or objects in another windowithiframe from local scope

shihn
1pts0

Actually there is some connection in rough.js' sketchy curve rendering and the way excalidraw smooths the hand-drawn shape. That is the Ramer–Douglas–Peucker algorithm https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93...

The way excalidraw does it, it collects all the points from mouse-move events, then uses the algorithm to take those points and reduce the number of points. The reduction is done by a 'distance' parameter in the algorithm. So instead of `n` points, you now have `m` points. m < n. Then excalidraw fits a rough curve through those `m` points. This fitting is automatically done in roughjs. Fewer points and curve fitting gives the effect you mentioned.

(The reduction algorithm is implemented and used from this package: https://github.com/pshihn/bezier-points) p.s. thanks for the shoutout @swyx

I wrote roughjs a couple of years ago and had always thought it would be nice to use it in all the ways people draw hand-drawn shapes. Annotation is one of them. I never got around to implementing it. Since roughjs does most of the heavy lifting, implementing this was not a lot of time. I did it in a day (~4-6 hours). Actually it took longer to make the website for the project and writing the readme :/