[HN Gopher] Cleaner parallel curves with Euler spirals
       ___________________________________________________________________
        
       Cleaner parallel curves with Euler spirals
        
       Author : raphlinus
       Score  : 74 points
       Date   : 2021-02-19 18:49 UTC (4 hours ago)
        
 (HTM) web link (raphlinus.github.io)
 (TXT) w3m dump (raphlinus.github.io)
        
       | johncalvinyoung wrote:
       | Oh this is very interesting to me. Currently working on adding
       | proper cubic bezier primitives to a geometry engine I'm working
       | on, and curve offsetting is an operation I haven't implemented
       | yet. Skimmed the essay, and will have to sit down and read it
       | properly next week.
        
       | bmer wrote:
       | Hi Raph! This was a fun read, and I have some questions to help
       | me contextualize this post with respect to your other work.
       | 
       | * In terms of mathematical technique, this is a "sister post" to
       | https://raphlinus.github.io/graphics/curves/2019/12/23/flatt... ,
       | because they both use the idea of using the relationship between
       | arclength and curvature to determine how best approximate one
       | type of curve as another curve?
       | 
       | * Have you done the analysis in this paper with a Euler spirals
       | -> cubic Beziers because they are the "cultural norm", or because
       | quadratic Beziers are problematic here for some reason?
       | 
       | * When you say that you look forward to exploring using Euler
       | spirals for other "classical 2D geometry problems", do you mean
       | "classical 2D geometry problems, related to 2D graphics
       | rendering", or are you actually thinking more generally? If
       | you're thinking in terms of 2D graphics rendering, do you have a
       | short-list of problems in mind?
       | 
       | * Here's an idea for a book. On the cover, a thousand cartoon
       | Raphs are pictured, each equipped with a typewriter. The title
       | is: "1000 problems your 2D graphics renderer NEEDS to handle (no
       | solutions included)". Do-able for 2021?
        
         | raphlinus wrote:
         | Great questions, thanks!
         | 
         | * Yes, absolutely. The fundamental concept common to both posts
         | is the error metric. There's no _general_ cookbook formula for
         | coming up with good ones (see Trefethen 's work for
         | mathematical foundations), but if the function you're
         | approximating has simple mathematical properties, it's often
         | possible to come up with something. The technique that seems to
         | work best for me is some integral based on curvature and
         | curvature variation. With Euler spirals it's super easy to
         | compute those.
         | 
         | * I'm actually working on both cubic and quadratic Beziers as
         | the final output format. I thought the story here with the n^5
         | scaling of cubics was simple and compelling, and the two-
         | parabola picture might be helpful to designers.
         | 
         | * Related to font design and rendering, yes. The main problems
         | I'm thinking about right now include generating optimized
         | simplified representations (mostly for fonts), overlap removal,
         | and warping (waving flags for emoji was a motivation). One
         | particular facet that's especially fascinating is generating
         | variable fonts, where the outlines need to be "interpolation
         | compatible."
         | 
         | * The problem with that idea is that HN would strip the leading
         | number from the title, which would be confusing. In my opinion,
         | that's a valid reason not to go with it.
        
           | chrismorgan wrote:
           | (Note that if HN mangles your title, you can go back and edit
           | it to fix it. But in this sort of a case, the number _would_
           | be contrary to one of the HN guidelines, so if you reinstated
           | it it'd be liable to be removed by mods.)
        
         | Someone wrote:
         | For that book, I would take a look at Apples long dead
         | QuickDraw GX. It did the offsetting, even-odd rule _and_ non-
         | zero rule, all kinds of intersections, color spaces, text along
         | paths, affine transforms, etc.
         | 
         | I don't know any more complete 2D graphics API (but then I
         | don't know many well)
         | 
         | Following TrueType, it used quadratic Bezier curves. It also
         | made the, I think somewhat contentious, choice to use fixed-
         | point coordinates. That guaranteed that translations of
         | graphics didn't change their rendering, though.
        
       | aappleby wrote:
       | Nice. Wish I'd seen this ~15 years ago when I was doing a font
       | renderer.
        
       ___________________________________________________________________
       (page generated 2021-02-19 23:00 UTC)