Live data from Hacker News

New Bézier curves for vector graphics

ad8e.pages.dev

51–60 of 61 posts

Re: New Bézier curves for vector graphics

#51

Earlier quoted context omitted.

> 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 creatin…

You can easily learn how to use them. That doesn't mean they don't stop being frustrating. I will commonly wish there was a method to change a curve in a single drag in some particular situation, rather than 20 drags of fiddling with beziers, trying to figure out if adding another control point is necessary or redundant. Just because you figure out the intuition behind them doesn't turn them into an efficient way of…

> I will commonly wish there was a method to change a curve in a single drag in some particular situation…

If I understand what you want, you'd probably really dig the Curvature tool. https://www.youtube.com/watch?v=xzilL2zvldo

Re: New Bézier curves for vector graphics

#53
post #15

Earlier quoted context omitted.

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.

Yeah, I’m thinking that I met DEK before the parent poster was born (he told me that I would be able to be his student because I wasn’t taller than him. Spoiler: I was never his student).

Re: New Bézier curves for vector graphics

#54
post #45

Earlier quoted context omitted.

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

I personally really like this video, but it's interesting how when I showed it to a group of CS undergrad students, they all loved the animations but performed poorly on a post-video quiz about the topic. I knew the content already, but I wonder if this video is really as educational as it appears to be.

Her other video on the subject https://www.youtube.com/watch?v=jvPPXbo87ds&t is far more interesting and informative imo.

Re: New Bézier curves for vector graphics

#55

Earlier quoted context omitted.

You can easily learn how to use them. That doesn't mean they don't stop being frustrating. I will commonly wish there was a method to change a curve in a single drag in some particular situation, rather than 20 drags of fiddling with beziers, trying to figure out if adding another control point is necessary or redundant. Just because you figure out the intuition behind them doesn't turn them into an efficient way of…

> I will commonly wish there was a method to change a curve in a single drag in some particular situation… If I understand what you want, you'd probably really dig the Curvature tool. https://www.youtube.com/watch?v=xzilL2zvldo

That is exactly the type of user interface I am advocating for, I love that.

Give me that + fast/efficient GPU-animated keyframes of those curves, and I'm 100% sold.

Re: New Bézier curves for vector graphics

#56

Are Bézier curves with handles “worth it”? I've always found the easiest method for drawing curves to be, simply, “give me the (cubic) spline curve that goes through these points”. You place your points and continuity conditions determine the cubic, as described in https://mathworld.wolfram.com/CubicSpline.html .

It of course depends on what you need, what you’re doing. The cubic Bézier curves with handles are probably the best thing for animation curves, specifically because having handles allow you to break the continuity of the curve, and change direction suddenly. Animators need this when tweaking motion curves on a timeline. Think of abrupt changes in speed, like with collisions.

Splines with tangent handles are much better for font design as well, than splines without handles.

Splines defined by points and not tangents are useful for different reasons, and they’re not great if you want to have sharp changes of angle. You can do it by duplicating control points, but that causes some math mayhem in some situations.

In computer graphics people use the “Catmull-Rom” spline a lot, which is a type of interpolating spline that goes through the control points. https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline

People also use the B-spline as well, which is smoother and nicer than the Catmull-Rom spline, but it’s an approximating spline that doesn’t usually go exactly through the control points. https://en.wikipedia.org/wiki/B-spline

Both of these get used in CG for hair and fur - which is a good example of an application of curves that doesn’t require sharp angles along the splines.

Re: New Bézier curves for vector graphics

#57
I like using the "split tweak" method to do my curves. Converts polygons to curves. Works VERY well. Very intuitive, straightforward and ez. It's a variety of bezier.

Alg :

    given polygon P.
    For each vertex V in P.
        Get the midpoints of the 2 segs adjacent to V. M0 M1. Add those 2 points to the polygon.
        Get the midpoint of seg(M0, M1). M2. Move V to the midpoint of (V,M2).
Repeat 2 or 3 times or whatever. Each iteration increases smoothness.

And here's the code for that

https://github.com/johnalexandergreene/Geom_2D/blob/master/C...

There's a version of that for open curves too, elsewhere in that package .

Re: New Bézier curves for vector graphics

#58
post #50

It looks like the conclusion is "let's use rational Bezier curves instead of plain Bezier curves", in which case: you can, you just have more parameters to tweak now. Also calling this "new" is a bit disingenous given that rational Beziers have been around half a century now. They're useful, but if you only look at Bezier curves from the tooling side of things, you're going to miss the reason why we use them so much.…

There are a few misunderstandings here. Rational Bézier curves are incidental in this article, and the conclusion is not that they are correct. They were just a convenient curve I used to express the main message of local control, and the article endorses looking for other curves that fit the properties. The parameter count has not gone up; it's equal to or less than usual Bézier control handles, because I forced the…

Maybe I'm not reading what you wrote, but what I'm getting from the writeup is not that you're describing a new set of curve constraints, not a new Bezier curve (even if we just go by the list of constraints you're trying to satisfy), so that doesn't feel like a linguistic accusation so much as a pretty important thing to call out?

In the analogy of rocks: we've certainly been discovering rocks thousands of years ago, but if you pick up the same rock that others have already picked up, from the same patch that we've been picking up rocks from for a long time, but using a different set of rules to decide how to pick the rock up, that's not a new rock. That's a new method.

So describing it as a new methodoly for finding appropriate Bezier curves, rather than finding new Bezier curves, would make it much more clear what you're doing. And new methodologies are always exciting.

Re: New Bézier curves for vector graphics

#59

Earlier quoted context omitted.

You can easily learn how to use them. That doesn't mean they don't stop being frustrating. I will commonly wish there was a method to change a curve in a single drag in some particular situation, rather than 20 drags of fiddling with beziers, trying to figure out if adding another control point is necessary or redundant. Just because you figure out the intuition behind them doesn't turn them into an efficient way of…

> I will commonly wish there was a method to change a curve in a single drag in some particular situation… If I understand what you want, you'd probably really dig the Curvature tool. https://www.youtube.com/watch?v=xzilL2zvldo

OMG yes. I had no idea that had been invented and added to Illustrator -- that's exactly what I've been looking for. Thank you so much!

Re: New Bézier curves for vector graphics

#60
I was really hyped up by the beginning of the article, but it seems really miss the points with the conclusion.

I don't think it is easier to manipulate with the last two examples, and I am guessing no actual graphic artist has read this or play with this before you publish it. To think of ways to improve bezier curves for vector graphics, you need to fully contextualize your thinking about the use case; this is not an academic mathematical discussion after all. Based on my understanding, your finding has no mathematical value as Pomax pointed it out, it is not new, it is an old math with a few constraints that is pre-defined, based on your assumption of what graphic artist wanted most of the time, which I agree is a good direction.

I strongly suggest for anyone to try to make a better vector graphics tool, try to draw a letter S with the new approach as a test case, you can choose an existing font to match. And know existing vector graphics rules, here is a couple as example:

- add anchor points at the horizontal and vertical extrema of your paths

- control points should not cross path with one another

Curves that doesn't follow these rules are valid, fine mathematical curves, but graphic artists has practices this for years to rule out them as bad for the purpose of graphic design. Again, the goal is to find the more much smaller set of suitable curves from the infinite realm of mathematical possibilities, for the context of graphic design

Post reply on HN