discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Closed bezier

SP
Sanjeev Prabhakar
Thu, Aug 14, 2025 1:43 AM

Hi All,

Anyone here has any idea how to create a closed loop bezier curve from a
set of defined control points.

I know it can be done through bspline, but only when the number of control
points are maybe less than 10 or something.

Once the control points are very high like 100 or more it takes a long time
and defeats the purpose.

Thanks

Hi All, Anyone here has any idea how to create a closed loop bezier curve from a set of defined control points. I know it can be done through bspline, but only when the number of control points are maybe less than 10 or something. Once the control points are very high like 100 or more it takes a long time and defeats the purpose. Thanks
JB
Jordan Brown
Thu, Aug 14, 2025 3:05 PM

On 8/14/2025 2:43 AM, Sanjeev Prabhakar via Discuss wrote:

Anyone here has any idea how to create a closed loop bezier curve from
a set of defined control points.

I know it can be done through bspline, but only when the number of
control points are maybe less than 10 or something.

Once the control points are very high like 100 or more it takes a long
time and defeats the purpose.

Maybe I am not understanding your goal.  Do you mean a single curve,
of a very high order, or do you mean numerous connected curves of lower
order (typically cubic, if I'm remembering correctly0?

I don't know beans about high-order Bezier curves, but connecting
low-order curves into a smooth loop is straightforward; you just ensure
that the begin and end points are the same, and that the adjacent
control points are co-linear with the begin/end point.

On 8/14/2025 2:43 AM, Sanjeev Prabhakar via Discuss wrote: > Anyone here has any idea how to create a closed loop bezier curve from > a set of defined control points. > > I know it can be done through bspline, but only when the number of > control points are maybe less than 10 or something. > > Once the control points are very high like 100 or more it takes a long > time and defeats the purpose. Maybe I am not understanding your goal.  Do you mean a *single* curve, of a very high order, or do you mean numerous connected curves of lower order (typically cubic, if I'm remembering correctly0? I don't know beans about high-order Bezier curves, but connecting low-order curves into a smooth loop is straightforward; you just ensure that the begin and end points are the same, and that the adjacent control points are co-linear with the begin/end point.
AM
Adrian Mariano
Thu, Aug 14, 2025 3:43 PM

For b spline run time should depend linearly on the point count so 100 pts
should be fine.

For a single bezier the curve has the property that it passes through its
first and last point so just make them equal. If you want derivatives then
line up vectors given by the two endpoints at each end.  I think this
computation is slower than b spline for many control points.

On Thu, Aug 14, 2025 at 11:06 Jordan Brown via Discuss <
discuss@lists.openscad.org> wrote:

On 8/14/2025 2:43 AM, Sanjeev Prabhakar via Discuss wrote:

Anyone here has any idea how to create a closed loop bezier curve from a
set of defined control points.

I know it can be done through bspline, but only when the number of control
points are maybe less than 10 or something.

Once the control points are very high like 100 or more it takes a long
time and defeats the purpose.

Maybe I am not understanding your goal.  Do you mean a single curve, of
a very high order, or do you mean numerous connected curves of lower order
(typically cubic, if I'm remembering correctly0?

I don't know beans about high-order Bezier curves, but connecting
low-order curves into a smooth loop is straightforward; you just ensure
that the begin and end points are the same, and that the adjacent control
points are co-linear with the begin/end point.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

For b spline run time should depend linearly on the point count so 100 pts should be fine. For a single bezier the curve has the property that it passes through its first and last point so just make them equal. If you want derivatives then line up vectors given by the two endpoints at each end. I think this computation is slower than b spline for many control points. On Thu, Aug 14, 2025 at 11:06 Jordan Brown via Discuss < discuss@lists.openscad.org> wrote: > On 8/14/2025 2:43 AM, Sanjeev Prabhakar via Discuss wrote: > > Anyone here has any idea how to create a closed loop bezier curve from a > set of defined control points. > > I know it can be done through bspline, but only when the number of control > points are maybe less than 10 or something. > > Once the control points are very high like 100 or more it takes a long > time and defeats the purpose. > > > Maybe I am not understanding your goal. Do you mean a *single* curve, of > a very high order, or do you mean numerous connected curves of lower order > (typically cubic, if I'm remembering correctly0? > > I don't know beans about high-order Bezier curves, but connecting > low-order curves into a smooth loop is straightforward; you just ensure > that the begin and end points are the same, and that the adjacent control > points are co-linear with the begin/end point. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
SP
Sanjeev Prabhakar
Thu, Aug 14, 2025 3:52 PM

If I remember correctly order of bezier curve is 1 less than the control
points. E.g. cubic means 4 control points.

I am looking for very high order bezier curve with control points maybe >
100 or so. The equation for the same is simple and easy to implement. The
issue comes when a closed loop is required. In a regular bezier curve, it
starts and ends on the first and the last control points supplied.

Cubic Bspline curve is what you explained as connecting multiple curves of
4 control points each, but then these are not the same as bezier curves and
there could be a big distortion in many cases.

Making closed loop bspline curve is also difficult, it took sometime for me
to understand initially but now it's clear and the algorithm is quite
stable.

I have implemented some work around for closed loop of bezier, but not very
satisfactory as of now.

On Thu, 14 Aug, 2025, 8:35 pm Jordan Brown, openscad@jordan.maileater.net
wrote:

On 8/14/2025 2:43 AM, Sanjeev Prabhakar via Discuss wrote:

Anyone here has any idea how to create a closed loop bezier curve from a
set of defined control points.

I know it can be done through bspline, but only when the number of control
points are maybe less than 10 or something.

Once the control points are very high like 100 or more it takes a long
time and defeats the purpose.

Maybe I am not understanding your goal.  Do you mean a single curve, of
a very high order, or do you mean numerous connected curves of lower order
(typically cubic, if I'm remembering correctly0?

I don't know beans about high-order Bezier curves, but connecting
low-order curves into a smooth loop is straightforward; you just ensure
that the begin and end points are the same, and that the adjacent control
points are co-linear with the begin/end point.

If I remember correctly order of bezier curve is 1 less than the control points. E.g. cubic means 4 control points. I am looking for very high order bezier curve with control points maybe > 100 or so. The equation for the same is simple and easy to implement. The issue comes when a closed loop is required. In a regular bezier curve, it starts and ends on the first and the last control points supplied. Cubic Bspline curve is what you explained as connecting multiple curves of 4 control points each, but then these are not the same as bezier curves and there could be a big distortion in many cases. Making closed loop bspline curve is also difficult, it took sometime for me to understand initially but now it's clear and the algorithm is quite stable. I have implemented some work around for closed loop of bezier, but not very satisfactory as of now. On Thu, 14 Aug, 2025, 8:35 pm Jordan Brown, <openscad@jordan.maileater.net> wrote: > On 8/14/2025 2:43 AM, Sanjeev Prabhakar via Discuss wrote: > > Anyone here has any idea how to create a closed loop bezier curve from a > set of defined control points. > > I know it can be done through bspline, but only when the number of control > points are maybe less than 10 or something. > > Once the control points are very high like 100 or more it takes a long > time and defeats the purpose. > > > Maybe I am not understanding your goal. Do you mean a *single* curve, of > a very high order, or do you mean numerous connected curves of lower order > (typically cubic, if I'm remembering correctly0? > > I don't know beans about high-order Bezier curves, but connecting > low-order curves into a smooth loop is straightforward; you just ensure > that the begin and end points are the same, and that the adjacent control > points are co-linear with the begin/end point. >
SP
Sanjeev Prabhakar
Thu, Aug 14, 2025 3:57 PM

Bspline curves with control points 100 and cubic degree is fine.

But if you go for bspline curve with deg =99, it will take endless time as
per me.

On Thu, 14 Aug, 2025, 9:13 pm Adrian Mariano via Discuss, <
discuss@lists.openscad.org> wrote:

For b spline run time should depend linearly on the point count so 100 pts
should be fine.

For a single bezier the curve has the property that it passes through its
first and last point so just make them equal. If you want derivatives then
line up vectors given by the two endpoints at each end.  I think this
computation is slower than b spline for many control points.

On Thu, Aug 14, 2025 at 11:06 Jordan Brown via Discuss <
discuss@lists.openscad.org> wrote:

On 8/14/2025 2:43 AM, Sanjeev Prabhakar via Discuss wrote:

Anyone here has any idea how to create a closed loop bezier curve from a
set of defined control points.

I know it can be done through bspline, but only when the number of
control points are maybe less than 10 or something.

Once the control points are very high like 100 or more it takes a long
time and defeats the purpose.

Maybe I am not understanding your goal.  Do you mean a single curve, of
a very high order, or do you mean numerous connected curves of lower order
(typically cubic, if I'm remembering correctly0?

I don't know beans about high-order Bezier curves, but connecting
low-order curves into a smooth loop is straightforward; you just ensure
that the begin and end points are the same, and that the adjacent control
points are co-linear with the begin/end point.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Bspline curves with control points 100 and cubic degree is fine. But if you go for bspline curve with deg =99, it will take endless time as per me. On Thu, 14 Aug, 2025, 9:13 pm Adrian Mariano via Discuss, < discuss@lists.openscad.org> wrote: > For b spline run time should depend linearly on the point count so 100 pts > should be fine. > > For a single bezier the curve has the property that it passes through its > first and last point so just make them equal. If you want derivatives then > line up vectors given by the two endpoints at each end. I think this > computation is slower than b spline for many control points. > > > On Thu, Aug 14, 2025 at 11:06 Jordan Brown via Discuss < > discuss@lists.openscad.org> wrote: > >> On 8/14/2025 2:43 AM, Sanjeev Prabhakar via Discuss wrote: >> >> Anyone here has any idea how to create a closed loop bezier curve from a >> set of defined control points. >> >> I know it can be done through bspline, but only when the number of >> control points are maybe less than 10 or something. >> >> Once the control points are very high like 100 or more it takes a long >> time and defeats the purpose. >> >> >> Maybe I am not understanding your goal. Do you mean a *single* curve, of >> a very high order, or do you mean numerous connected curves of lower order >> (typically cubic, if I'm remembering correctly0? >> >> I don't know beans about high-order Bezier curves, but connecting >> low-order curves into a smooth loop is straightforward; you just ensure >> that the begin and end points are the same, and that the adjacent control >> points are co-linear with the begin/end point. >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org