Hacker News new | past | comments | ask | show | jobs | submit login

A quick hack would be to render the outlines to a bitmap. Apply a suitable edge detector that handles filled and unfilled geometry the same and then count active pixels for a ballpark estimate.

With vectors imported into a common data structure you just need to convert curves to line segments with enough segments to maintain a reasonable approximation and then add up their lengths. Cairo and Anti-grain geometry can do the heavy lifting for you there. Anti-grain has example code for doing this adaptively.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: