Live data from Hacker News

Bezier-rs – algorithms for Bézier segments and shapes

graphite.rs

21–30 of 57 posts

Re: Bezier-rs – algorithms for Bézier segments and shapes

#21

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

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

#22

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

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

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

#23
post #14
post #2

I'm hoping to code Bezier animation in OCaml/F# in four dimensional space time, with a moving vantage point. Offload rendering each time slice frame to worker threads. I'm surprised Bezier-rs is all about curves. Sure, fonts, but I can't be alone here in seeing curves as a special case. It's easy as a pure mathematician to write off Bezier theory as "specialized" but it's simply the right way to work with polynomials…

If you're not restricted to Bezier for graphics (it's a very common choice as the path primitive for vector graphics), there are other classes of curves that you may find are a better fit. In particular, I think animations typically feel better if they move at constant speed - which is nontrivial with Bezier curves because they do not have an exact closed-form arc length parameterization. Something like pythagorean h…

Instead of using closed form, they can easily computed with the approximation of the curve with segments, and you place the points where there is most curvature or where the 1st derivative isn't close to zero

Re: Bezier-rs – algorithms for Bézier segments and shapes

#24

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

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

#25
post #22

Earlier quoted context omitted.

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

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

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

#27

Earlier quoted context omitted.

Link to the code for the mentioned Rust path-bool crate: https://github.com/GraphiteEditor/Graphite/tree/master/libra...

Interesting, I’m writing some code to find the interception of two clipping paths at the moment. I can’t use this because I have a no dependency rule but will take a look.

In case you end up coming up with your own solution: this is one of the best collections of info for what is currently out there Ive seen: https://github.com/linebender/kurbo/issues/277
Post reply on HN