mourner

Joined 15 years ago

Karma
1,755
Submissions
224
Member since
Jul 10
Engineer at Mapbox, creator of Leaflet, open source enthusiast, algorithms geek, speaker, musician (Obiymy Doschu), baker, father of twin girls, Ukrainian. agafonkin.com
View on Hacker News

Recent submissions

Comment · 9 days ago
The commenter probably meant https://github.com/iShape-Rust/iTriangle, a sibling library that is indeed quite fast at triangulation, especially on bigger inputs
Comment · 9 days ago
Very high constants and high implementation complexity — I attempted it and gave up before coming up with earcut (Seidel was both slower and less robust on typical map data). Maybe worth another attempt — working on algorithmic libraries is much easier now thanks to LLM-driven validation/optimization loops.
Comment · 9 days ago
For practical data, a faster approach is usually to triangulate without validation, then just measure if triangulation is valid afterwards (which is simply comparing the sum of triangle areas with polygon area)
Comment · 9 days ago
Having triangulation conform to Delaunay is a big advantage though! You should also try out https://github.com/mapbox/earcut.hpp for the benchmark — it got a refine function recently that refines earcut output to Delaunay as well, and earcut+refine is still pretty fast.
Comment · 9 days ago
Hey Evgen, Earcut author here — thanks for the writeup and a really cool library! I need to see if there are any tricks to borrow for Earcut's JS version. :)

One thing to note is that I deliberately had to reject some of the potential optimizations to keep the library small, so that bundle size doesn't blow up — for most practical applications (e.g. Mapbox GL JS), it's already fast enough (and 4.1k min/gz). Curious how big the WASM build of Earstrip is.

On the C++ side, Mapbox now uses a hybrid approach where small polygons are processed with earcut.hpp, while big and complex polygon switch to a different algorithm based on monotone decomposition, because while it has higher constants in algorithmic complexity, it scales much better with input size.

Comment · 2 months ago
Comment · 2 months ago
Comment · 2 months ago
Oh, a fellow Ukrainian! Was pleasantly surprised to see that fountain on HN — I was just walking around it a few days ago, very nice and peaceful spot this time of year.
Comment · 4 months ago
Nice article! As someone who implemented both clustering and heatmaps in Mapbox / Maplibre GL JS, just wanted to add that clustering isn't just a visualization technique — it's also a performance feature that can support other visualization types. It might not matter for 30k points, but for e.g. 300k, you can implement dot density with stacked opacity via clustering — use a tiny clustering radius, and style the dots so that opacity is a function of point_count. This creates an approximation of an unclustered viz that performs much smoother. Same thing with heatmaps — you can define heatmap-weight as a function of clustered source's point_count, and it will look nearly identical (aside minor shifts) as the unclustered one, but perform much better.
Comment · 7 months ago
Amazing achievement, congratulations! Can't seem to be able to read it though, it greets me with "Sorry, you have been blocked" CloudFlare page — is this a HN overloading the website, or did the host accidentally block IPs from Ukraine perhaps?
Comment · 9 months ago
Comment · 10 months ago
> Perhaps you see this conflict from the perspective of a sports fan

I see this from the perspective of a Ukrainian living in Kyiv. Your ignorance is mind-boggling, and after the laughable mention of "NATO biolabs" there's truly no sense in further conversation. These tinfoil-head "I do my own research" people are something else.

Comment · 10 months ago
Russian war industry just burns reserves for nothing — hundreds of billions spent on missiles and long range drones didn't achieve any strategic objectives, all those expensive modern tanks, armored vehicles and artillery systems gets demolished by $500 drones, russian soldiers mass switching from military vehicles to donkeys, horses, bikes & buggies. Russia is no longer able to defend their vast territory against Ukrainian long range attacks so their oil refineries and military factories explode every day. 150k+ verified deaths (with names) already vastly exceed any russian wars since WW2 and we know there are many times more unverified ones.

Sevastopol nuclear base is irrelevant to modern warfare, and the fleet (both ships and subs) is either on the bottom of the sea (like the flagship Moskva) or gone to hiding in Novorossiysk because they can't defend against cheap Ukrainian naval drones.

Capture of cities not on the agenda — of course every time they fail spectacularly at something they'll claim they didn't plan it anyway, lol. They attempted and failed the capture of Kyiv, Kharkiv, Chernihiv, Sumy & Mykolaiv, then had to flee from Kherson & much of the Kharkiv oblast, and they are no longer strategically able to attempt capturing any more — only slow creep over obliterated rubble of small towns by sacrificing a thousand people a day in meat grinders.

I can't believe you can be so delusional, it's just amazing what russian propaganda does to people.

Comment · 10 months ago
Soviet stockpiles nearly depleted, 1.5 million dead or wounded, Black Sea fleet practically destroyed, third of strategic bomber fleet destroyed, economy in downfall, no major cities captured in 4 years of all out war, gas and oil revenues plummeting, and there are STILL people saying “oh they just didn’t even start for real yet, just you wait”, gosh. Just laughable.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton