USER FORUM

*(you are viewing a thread; or go back to
list of threads)*

**Point on bezier possible?**

*(by Ed C)*

Hi!

Absolutely love solvespace and use it heavily. However, recently I have come across the need to be able to contstrain points to bezier splines... this seems not to be possible.

Is it possible? Surely there is no reason this shouldn't be technically possible to do...

Thank you!

Absolutely love solvespace and use it heavily. However, recently I have come across the need to be able to contstrain points to bezier splines... this seems not to be possible.

Is it possible? Surely there is no reason this shouldn't be technically possible to do...

Thank you!

**(no subject)**

*(by Eric Buijs)*

Yes, that possible. First draw the desired points or lines and fully constrain them. Then draw the bezier with an equal amount of points (the maximum is ten). Now constrain the handles on the outermost points of the bezier. Lastly constrain all the points of the bezier on the constrained points. You'll end up with a fully constrained sketch. I've added a simple example.

**(no subject)**

*(by Paul)*

I think Eric is describing constraining point OF a spline and OP was asking about constraining point TO a spline. If that's the case, then no there is not way to constrain point-on-bezier.

I can imagine such a constraint for a single curve with 4 points, but it would be harder to implement for longer curves which are actually piece-wise splines - the point would have to seamlessly transition between sections.

I can imagine such a constraint for a single curve with 4 points, but it would be harder to implement for longer curves which are actually piece-wise splines - the point would have to seamlessly transition between sections.

**(no subject)**

*(by Jonathan Westhues)*

Even for a single piece it's nontrivial, since (unlike for a line or circle) there's no easy way to go from the control points to an implicit equation for the curve. Algorithms for implicitization do exist, but the math gets pretty complicated. I briefly studied this both for point-on-Bezier constraints and for the surface operations, but didn't find it promising enough to continue.

**(no subject)**

*(by Paul)*

@jwesthues We could add a free parameter (t) and write expressions for evaluation of the bezier at t. This is mostly implementing PointAt() and Bernstein symbolically.

**(no subject)**

*(by Jonathan Westhues)*

Yeah, probably the most promising direction. A long time ago I considered introducing a new point type in terms of t along a curve, but that seemed too complicated. In retrospect the easier path (and I guess what you're proposing here) is to make the constraint add one parameter t, and write two equations constraining u(t) and v(t) equal to the other point.

Of course you'd have to handle the piecewise part too. I don't think that would be bad for the solver, since the curves are all nicely continuous, just more implementation effort.

Of course you'd have to handle the piecewise part too. I don't think that would be bad for the solver, since the curves are all nicely continuous, just more implementation effort.

**(no subject)**

*(by Geert Hospers)*

I have experimented to represent airfloils by a few parabola. (Or 4 point beziers using solvespace.)

-At point maximum thickness the tangent is zero.

-At trailing edge the tangent is defined.

-At nose the tangent is infinite

-Define some point and corresponding tangent between nose and maximum thickness.

(-Alternative: combine the nose part of uppper and lower surface in 1 parabola.)

I tend to think (warning: I am qualified as mathematícal moderately intelligent...) that a multipoint Bezier consists of series of parabola. Please correct me if I'm wrong.

But if it is true, then the 'multiparabola route' looks promising to me.

-At point maximum thickness the tangent is zero.

-At trailing edge the tangent is defined.

-At nose the tangent is infinite

-Define some point and corresponding tangent between nose and maximum thickness.

(-Alternative: combine the nose part of uppper and lower surface in 1 parabola.)

I tend to think (warning: I am qualified as mathematícal moderately intelligent...) that a multipoint Bezier consists of series of parabola. Please correct me if I'm wrong.

But if it is true, then the 'multiparabola route' looks promising to me.

**(no subject)**

*(by Jonathan Westhues)*

Beziers can be of any order, but a spline in SolveSpace is piecewise cubic. Parabolas are quadratic. Any quadratic is also a cubic, with zero for the t^3 term. So a SolveSpace spline can represent a parabola exactly, but it has one additional degree of freedom beyond that.

**(no subject)**

*(by Geert Hospers)*

Doen't this indicate that every qubic kan be split in 2 qudratics?

https://ttnghia.github.io/pdf/QuadraticApproximation.pdf

I think it is also possible then to assemble all quadratics (parabola) into 1 higher order bezier, and the other way around.

For me (mechanical eng) it is quite comfortable to define things with parabola. Actually the (minimal 4 point) Solvespace Bezier I do consider as too complex. I suggest the simplest: 3 point.

https://ttnghia.github.io/pdf/QuadraticApproximation.pdf

I think it is also possible then to assemble all quadratics (parabola) into 1 higher order bezier, and the other way around.

For me (mechanical eng) it is quite comfortable to define things with parabola. Actually the (minimal 4 point) Solvespace Bezier I do consider as too complex. I suggest the simplest: 3 point.

**(no subject)**

*(by Geert Hospers)*

BTW, I am still not sure if the quadratics are an approximation or exact representation of the higher order Bezier.

In the citation there they talk about error...

In the citation there they talk about error...

**(no subject)**

*(by Geert Hospers)*

But is there also an error if you assemble exact quadratics into a higher order Bezier?

**(no subject)**

*(by Geert Hospers)*

If you respect continueaty when connecting the quadratics?

**(no subject)**

*(by Paul)*

@Geert Hospers There will always be difference between higher and lower order representations. Except in the rare case where the higher order term happens to be zero.

One thing I'm curious about but never looked at is where solvespace places the control points for the piecewise cubic splines. The user only has control over the 2 at each end. Obviously they are colinear to preserve C1 continuity, but that leaves some freedom for each point.

One thing I'm curious about but never looked at is where solvespace places the control points for the piecewise cubic splines. The user only has control over the 2 at each end. Obviously they are colinear to preserve C1 continuity, but that leaves some freedom for each point.

**(no subject)**

*(by Jonathan Westhues)*

As Paul notes, a cubic can exactly represent any quadratic, by setting the t^3 term to zero. A quadratic cannot exactly represent a general cubic.

Multiple piecewise quadratics can approximate a cubic--or any other curve--in the same way that multiple piecewise linear segments can approximate any curve. More segments make the approximation more accurate, but they don't make it exact.

SolveSpace splines are piecewise cubic, and C2 where the pieces join. See Entity::ComputeInterpolatingSpline() for the code that makes that so.

Multiple piecewise quadratics can approximate a cubic--or any other curve--in the same way that multiple piecewise linear segments can approximate any curve. More segments make the approximation more accurate, but they don't make it exact.

SolveSpace splines are piecewise cubic, and C2 where the pieces join. See Entity::ComputeInterpolatingSpline() for the code that makes that so.

**Wrong parabola from cubic bezier**

*(by Geert Hospers)*

Here I am again...

I tried to make parabola from a cubic spline.

The spline strats with 4 points, I constrain 3th and 4th point at the same place. That should produce a parabola.

But if I construct the triangle that defines the quadratic bezier the parabola does not "fit" at the t=0,5 points.

It becomes lower.

What is wrong?

I tried to make parabola from a cubic spline.

The spline strats with 4 points, I constrain 3th and 4th point at the same place. That should produce a parabola.

But if I construct the triangle that defines the quadratic bezier the parabola does not "fit" at the t=0,5 points.

It becomes lower.

What is wrong?

**(no subject)**

*(by Geert Hospers)*

I found what is wrong.

I should have kept the 4 points of the cubic spline, not merge 3 and 4.

The 2 endpoints go to the base of the bezier triangle.

And place the mid points at 2/3 of the triangle sides.

I should have kept the 4 points of the cubic spline, not merge 3 and 4.

The 2 endpoints go to the base of the bezier triangle.

And place the mid points at 2/3 of the triangle sides.

**Post a reply to this comment:**