Live data from Hacker News

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

graphite.rs

51–57 of 57 posts

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

#51
post #31

Earlier quoted context omitted.

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

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

Interesting. Arc segments are arc circles ?

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

#52

Earlier quoted context omitted.

Reference sounds interesting but I’m getting 404 there.

My apologies, it looks like it was switched over [0] to an external root-finder crate poly-cool [1] soon after I wrote my comment. (I should know better than to link to branches directly, but there weren't any useful tags on the repo, so I got lazy. For reference, I was trying to link to [2].) Curiously, the poly-cool crate appears to use the monomial basis instead of the Bernstein basis that the old version was usin…

Interesting, thanks!

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

#53
post #51

Earlier quoted context omitted.

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

Interesting. Arc segments are arc circles ?

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

#54
post #51

Earlier quoted context omitted.

Interesting. Arc segments are arc circles ?

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…

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

#55
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

That's it, thank you for discussing this.

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

#56

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…

Now that's the UI people like me need.
Post reply on HN