Live data from Hacker News

New Bézier curves for vector graphics

ad8e.pages.dev

21–30 of 61 posts

Re: New Bézier curves for vector graphics

#21
post #15
post #13

Earlier quoted context omitted.

Postscript used cubic Béziers, but TrueType, specified some ten years later by Apple with the learnings from practical use of Postscript on Macs, opted to only support quadratics instead. Donald E. Knuth seems to think pretty highly of this decision: “The quadratic has the great advantage that there's a real cheap way to render them. You can make hardware to draw a quadratic spline lickety-split. It's all Greek mathe…

Wow, I didn't know Knuth said that. I would've been 7 years old at the time - wild.

Knuth has been saying interesting things for a very long time. He began _The Art of Computer Programming_ project in 1962.

Re: New Bézier curves for vector graphics

#23
post #8

Obligatory links for anyone that is interested in learning more about Bézier curves: https://pomax.github.io/bezierinfo/ https://pomax.github.io/bezierjs/ https://github.com/Pomax/bezierjs

Might I also add: https://youtu.be/aVwxzDHniEw?feature=shared Which works through them from first principles with beautiful animations.

Re: New Bézier curves for vector graphics

#24
post #12

> Béziers can't represent circles. If you try to approximate one by hand, it'll look lopsided. Many graphics algorithms (vector operations: scale, translate, rotate; raster operations like rasterisation and interpolation) specialise for straight lines (and hence also triangles), Bézier curves, circles, etc separately, rather than forcing everything to be a Bézier curve.

"Béziers can't represent circles" is not exactly wrong, but is not really the full picture. Often you don't need to _represent_ a circle. TrueType fonts (quadratics) and OpenType fonts (cubics) can't mathmatically _represent_ a circle, either, but does that mean no font has circles in it? Sometimes an approximation is pretty damn good. Also conics (rational quadratic Beziers), which Microsoft has a surprisingly good…

Fortunately fonts usually don't contain perfect circles anyway, because the designer will optically correct any circles so that they don't appear to bulge. Kabel is the closest font I found with circular formas; LineTo's Circular is also quite close but slightly taller than wider.

Re: New Bézier curves for vector graphics

#25
post #13
post #11

Cool to see others working on this problem. I hope more people do. Funnily I've seen a lot of programmers and math folks who express how truly, genuinely beautiful Beziers and the math behind them are. But I've never met an artist or graphic designer who didn't express some deep frustration at Bezier controls and how hard they are to work with. There are even games[0] which make a mockery out of how hard Bezier contr…

Postscript used cubic Béziers, but TrueType, specified some ten years later by Apple with the learnings from practical use of Postscript on Macs, opted to only support quadratics instead. Donald E. Knuth seems to think pretty highly of this decision: “The quadratic has the great advantage that there's a real cheap way to render them. You can make hardware to draw a quadratic spline lickety-split. It's all Greek mathe…

And then OpenType added cubic bezier back in.... by embedding postscript font definitions.... Before they went one better and added support for embedding SVG for emojis.

(I ported a tiny TrueType renderer from C to Ruby, and looked at what it'd take to add OpenType support, since OpenType uses the same container format; font file formats look like they were designed by a drunk student as a prank)

Re: New Bézier curves for vector graphics

#26
The goals look quite similar to my hyperbezier explorations. There's an online demo of the first draft[1], and a Zulip thread on some progress toward a second draft[2]. The tl;dr is that I think I have the mathematics of the curve family, but I haven't finished the mapping between control points and the parameters of the curve family.

Both drafts have (exact) Euler spirals inside their parameter space, and thus circular arcs as well. I think that's a good criterion for a Bézier successor.

It's on the back burner for now, but I hope to get back to it, and am open to collaboration.

[1]: https://www.cmyr.net/blog/hyperbezier.html

[2]: https://xi.zulipchat.com/#narrow/stream/260979-kurbo/topic/H...

Re: New Bézier curves for vector graphics

#27
"I don't know of a reasonable way to guess the right location."

1. Drag curve handles out to 1/3 of the length of the curve segment they control.

2. Eschew s-curves between two control points.

3. Don't turn more than about 90º between two control points.

I learnt this about a year into what is now a 23-year career as an Illustrator artist. It has served me well. You will note that the first interactive example on this page is asking you to violate rule 2.

"Béziers can't represent circles. If you try to approximate one by hand, it'll look lopsided."

If you try to draw a circle by hand, it'll look lopsided too. Any pro traditional artist will have a compass and a few circle templates in their kit. In Illustrator there's an ellipse tool one keypress away. I've been drawing at a pro level for about thirty years and while I can probably pick up a pencil and draw a better circle in a couple quick arm motions than you can in a bunch of little sketchy attempts, they're still nowhere near perfect, and they don't need to be.

I also draw about 90% of my paths with the Pencil tool, which just abstracts worrying all of this way. Unless you are doing very geometric work, or require the absolute minimum possible number of points, I feel that using the Pen tool to draw everything is about as sensible as writing a program entirely in assembly language. And if I do need to work under a tight point count constraint, then I will still draw it with the Pencil, then pull out Astute's Smart Point Removal tool, which does a great job of optimizing the heck out of my paths, much better than Adobe's tools for this.

Re: New Bézier curves for vector graphics

#28

"I don't know of a reasonable way to guess the right location." 1. Drag curve handles out to 1/3 of the length of the curve segment they control. 2. Eschew s-curves between two control points. 3. Don't turn more than about 90º between two control points. I learnt this about a year into what is now a 23-year career as an Illustrator artist. It has served me well. You will note that the first interactive example on thi…

I think what you've done is mastered an unintuitive (or even counterintuitive) system. That's well and good, but it doesn't mean the system shouldn't be improved. It would make life no worse for you, and better for people with less experience, less time to experiment.

Re: New Bézier curves for vector graphics

#29
post #11

Cool to see others working on this problem. I hope more people do. Funnily I've seen a lot of programmers and math folks who express how truly, genuinely beautiful Beziers and the math behind them are. But I've never met an artist or graphic designer who didn't express some deep frustration at Bezier controls and how hard they are to work with. There are even games[0] which make a mockery out of how hard Bezier contr…

> But I've never met an artist or graphic designer who didn't express some deep frustration at Bezier controls and how hard they are to work with.

That surprises me, because Illustrator (especially earlier versions) is all about Bezier curves, and in my experience it doesn't take long before you start to "think" like the Pen tool. I don't recall working with an artist who couldn't intuit how they worked after creating with them for a few weeks.

Re: New Bézier curves for vector graphics

#30

"I don't know of a reasonable way to guess the right location." 1. Drag curve handles out to 1/3 of the length of the curve segment they control. 2. Eschew s-curves between two control points. 3. Don't turn more than about 90º between two control points. I learnt this about a year into what is now a 23-year career as an Illustrator artist. It has served me well. You will note that the first interactive example on thi…

I think what you've done is mastered an unintuitive (or even counterintuitive) system. That's well and good, but it doesn't mean the system shouldn't be improved. It would make life no worse for you, and better for people with less experience, less time to experiment.

I don’t think they’re implying it takes 21 years to learn. I’m inexperienced and learned how to accurately follow paths with bezier curves using the same technique after watching a 10 minute Burt Munroy tutorial.
Post reply on HN