News for hackers. Stuff that matters.
Re:Show HN: Lasergist.com – Your custom design in pure, lase... by mortenjorck on Monday December 07, 2015 @04:41PM (#10692939)
A bit onerous indeed. I've been working in vector graphics for over 15 years and I have no idea how I'd get the total path length for a file. I understand automating this on the server would be likewise an onerous development task, but users are going to need something more than "measure this thing you’ve never had to measure before" to start with.
Re:Show HN: Lasergist.com – Your custom design in pure, lase... by ics on Monday December 07, 2015 @07:06PM (#10693804)
In Rhino you can just select a bunch of curves (lines) and type Length<Return>. Since I construct a lot of wireframes I sometimes do a SelectAll<Return>Length<Return> just to see how many feet/miles of lines I've drawn. I thought it was a fun novelty to do that at the end of a project– partly because I don't know how if it would be so easy in other software.
Re:Show HN: Lasergist.com – Your custom design in pure, lase... by kevin_thibedeau on Monday December 07, 2015 @06:17PM (#10693539)
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.