News for hackers. Stuff that matters.
Re:Bezier-rs – algorithms for Bézier segments and shapes by childintime on Wednesday August 13, 2025 @08:54AM (#44887852)
Bezier curves in painting software never gave me the results I wanted. And I mean never. I sincerely wonder who succeeds at using them?

From these graphs I see that I always wanted the simple Quadratic version, and would use 2 of them in sequence to approximate a Cubic version. That would be so much easier. But if the software could allow me to adjust the midpoint, and maintain a smooth transition, that would be perfect. I think.

So I basically wish for a different interface, one that has more thought put into it. Now it's a "give access to the parameters, and be done with it" kind. As if novices don't have the need for a nice smooth curve between known points.

Re:Bezier-rs – algorithms for Bézier segments and shapes by panzerboiler on Wednesday August 13, 2025 @09:07AM (#44887972)
A Bézier curve is not an interpolating spline. It is a parametric curve defined by a set of control points, which the curve typically does not pass through (except the first and last points). Bézier curves exhibit local control (changing a control point influences only a portion of the curve, especially in piecewise Bézier constructions). Interpolating splines may seem more user-friendly at first, since the curve passes exactly through all the given points. However, this can lead to unintuitive behavior: modifying a single point can cause global changes in the curve, including in areas far from the edited point. In some cases, these changes can be drastic, making precise control difficult or impossible. I may be biased by my 20+ years of graphic design work, but I prefer the precision and control given by Bézier curves.
Re:Bezier-rs – algorithms for Bézier segments and shapes by ttoinou on Wednesday August 13, 2025 @09:38AM (#44888296)
The person you're answering to is not suggesting interpolating curves. Piecewise quadratic bezier curves are very local, two quadratic bezier curves can approximate well a 3rd degree bezier curve
Re:Bezier-rs – algorithms for Bézier segments and shapes by panzerboiler on Wednesday August 13, 2025 @09:46AM (#44888405)
I probably misunderstood their message. By the way, two quadratic curves can approximate well a tiny subset of what a cubic bezier can represent. The number of quadratics required in the general case can grow quite substantially, very quickly.
Re:Bezier-rs – algorithms for Bézier segments and shapes by ttoinou on Wednesday August 13, 2025 @11:23AM (#44889669)
You're right we probably need at least 3 quadratic bezier curves to cover most uses cases of 3rd degree bezier curves. (In general, not all shapes of 3rd degree bezier curves are used in the wild, that would lead to too much deformation and impossible paths).

But I agree with the OP, artists might only need new tools that use quadratic bezier curves in a different ways

Re:Bezier-rs – algorithms for Bézier segments and shapes by neutronicus on Wednesday August 13, 2025 @03:50PM (#44892984)
To your point:

I work on a commercial CAD application (architecture space) and we have a Polyline Tool (misnomer) that lets users add quadratic Bezier curves and arc segments and they are not clamoring for anything more than that. There is the ability to specify the quadratic segments by point on curve at t=1/2, and various different ways of specifying arc segments. But this is all just UI, under the hood it's arc segments, line segments, and quadratic Bezier and it seems to meet their needs.

There is also a NURBS curve tool but my impression is that the vast majority of our users just stick with the 2D Polyline.

Re:Bezier-rs – algorithms for Bézier segments and shapes by ttoinou on Thursday August 14, 2025 @04:59AM (#44898313)
Interesting. Arc segments are arc circles ?
Re:Bezier-rs – algorithms for Bézier segments and shapes by neutronicus on Thursday August 14, 2025 @10:30AM (#44900842)
Yep, subsets of circles.

Users can specify them by three points on the perimeter, by tangents at endpoints (up to 180deg of course), with various other conveniences (you can place two tangent arc or bezier vertices in a row and create an implicit g1 interface between the two arc / bezier segments).

Constraint solvers are good at circles and you can offset them analytically so they make a lot of sense for CAD.

I can't really say this rigorously but I also think that Bezier segments and circle segments are good "partners" for approximating smooth curves - each has just enough degrees of freedom for you to require g1 continuity between them, one of them always has constant non-zero curvature, the other cannot have constant non-zero curvature, and the locality aspect matches the intuition of a human operator.

Re:Bezier-rs – algorithms for Bézier segments and shapes by ttoinou on Friday August 15, 2025 @04:02PM (#44916737)
Thanks ! I don't think Offsets are straightforward (closed form equation) with Bezier but it can be approximated
Re:Bezier-rs – algorithms for Bézier segments and shapes by childintime on Saturday August 16, 2025 @11:14AM (#44924173)
That's it, thank you for discussing this.
Re:Bezier-rs – algorithms for Bézier segments and shapes by WillAdams on Wednesday August 13, 2025 @09:33AM (#44888231)
A markedly different UI is that of FutureWave SmartSketch which has been reimplemented in

https://www.wickeditor.com/

For Beziér curves remember the basics:

- put nodes at extrema and points of inflection (extreme left/right, top/bottom, middle of _S_ curve)

- rule of 30 --- off curve nodes should be ~30% away from the matching on curve node for smoothest appearance unless the shape one is trying to achieve dictates a different placement

Re:Bezier-rs – algorithms for Bézier segments and shapes by phkahler on Wednesday August 13, 2025 @09:43AM (#44888366)
You might like the spline tool in Solvespace:

https://solvespace.com/

If you just do a start/end point it will create a cubic with 2 endpoints and 2 control points. But if you drop a whole series of points (up to 12 I think) it will create a curve that passes though all of them. This is done by internally creating a bunch of cubic splines where the control points are automatically positioned and not shown. You still get 2 control points for the derivatives at the ends, unless you create a closed loop.

Re:Bezier-rs – algorithms for Bézier segments and shapes by childintime on Saturday August 16, 2025 @03:22PM (#44926224)
Now that's the UI people like me need.