M
mikeonenine@web.de
Wed, Apr 15, 2026 3:46 AM
Bezier curves get longer, the more they are bent. This is contrary to what happens in the real world somewhere out there.
Is there a parameter that can be set to obtain a fixed length instead of fixed ends?
Or is there an echo(); that returns the true length of a Bezier curve, from which a correction could be calculated?
The animation shows what I am looking for: the free ends move back and forth because I incorporated a fudge in the code.
Bezier curves get longer, the more they are bent. This is contrary to what happens in the real world somewhere out there.
Is there a parameter that can be set to obtain a fixed length instead of fixed ends?
Or is there an echo(); that returns the true length of a Bezier curve, from which a correction could be calculated?
The animation shows what I am looking for: the free ends move back and forth because I incorporated a fudge in the code.
AM
Adrian Mariano
Wed, Apr 15, 2026 10:13 AM
I don't really understand your problem because you don't say what
information is changing about the bezier. You want length to stay fixed
while what is varying?
However, I do note that even just calculating the length of a bezier has no
closed form solution, which means it's going to be impossible to control
the length with a parameter in a simple fashion.
On Tue, Apr 14, 2026 at 11:47 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
Bezier curves get longer, the more they are bent. This is contrary to what
happens in the real world somewhere out there.
Is there a parameter that can be set to obtain a fixed length instead of
fixed ends?
Or is there an echo(); that returns the true length of a Bezier curve,
from which a correction could be calculated?
The animation shows what I am looking for: the free ends move back and
forth because I incorporated a fudge in the code.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I don't really understand your problem because you don't say what
information is changing about the bezier. You want length to stay fixed
while what is varying?
However, I do note that even just calculating the length of a bezier has no
closed form solution, which means it's going to be impossible to control
the length with a parameter in a simple fashion.
On Tue, Apr 14, 2026 at 11:47 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
> Bezier curves get longer, the more they are bent. This is contrary to what
> happens in the real world somewhere out there.
>
> Is there a parameter that can be set to obtain a fixed length instead of
> fixed ends?
>
> Or is there an echo(); that returns the true length of a Bezier curve,
> from which a correction could be calculated?
>
> The animation shows what I am looking for: the free ends move back and
> forth because I incorporated a fudge in the code.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
M
mikeonenine@web.de
Wed, Apr 15, 2026 10:57 AM
I don't really understand your problem because you don't say what
information is changing about the bezier. You want length to stay fixed
while what is varying?
If you bend a strip of flexible material, that brings the ends closer together, but the strip stays the same length. With Bezier curves, it’s the other way round: the ends stay put and the length increases. I am looking for realistic behaviour. The animation shows the outer ends of the Beziers being pulled in as the curvature increases, which is what I want, but the distance they are pulled in is only a guess. How much should it be?
However, I do note that even just calculating the length of a bezier has no
closed form solution, which means it's going to be impossible to control
the length with a parameter in a simple fashion.
Alas, no “echo” and no “constant length = true”, then. Guess I’ll have to tape a cotton thread onto the monitor of my PC to measure the lengths of the Beziers, to get the difference between zero deflection and full deflection. Kitchen table maths!
Adrian Mariano wrote:
> I don't really understand your problem because you don't say what
> information is changing about the bezier. You want length to stay fixed
> while what is varying?
If you bend a strip of flexible material, that brings the ends closer together, but the strip stays the same length. With Bezier curves, it’s the other way round: the ends stay put and the length increases. I am looking for realistic behaviour. The animation shows the outer ends of the Beziers being pulled in as the curvature increases, which is what I want, but the distance they are pulled in is only a guess. How much should it be?
> However, I do note that even just calculating the length of a bezier has no
> closed form solution, which means it's going to be impossible to control
> the length with a parameter in a simple fashion.
Alas, no “echo” and no “constant length = true”, then. Guess I’ll have to tape a cotton thread onto the monitor of my PC to measure the lengths of the Beziers, to get the difference between zero deflection and full deflection. Kitchen table maths!
AM
Adrian Mariano
Wed, Apr 15, 2026 11:59 AM
There is no way to “bend” a bezier like a physical string. If you just
want to take a sequence of beziers and extract a sub curve that is the same
length that could be done. Your problem is not well defined because you
have not explained how you are varying the control points. Or how you want
to vary them.
You can compute the length of a bezier just not on closed form. To be able
to have a settable length parameter you would need a closed form expression
for length you could solve.
BOSL2 provides bezier_length() and you could write a recursive function
that would find the u span to approximate a desired length. You could
measure the length and scale the curve shorter to the desired length. You
could put the end control points very far from the others and then move
them inward to shorten it.
The result may have constant length but still won’t reflect actual movement
of a string. Getting that right would require solving an appropriate set
of differential equations.
On Wed, Apr 15, 2026 at 06:57 Caddiy via Discuss discuss@lists.openscad.org
wrote:
Adrian Mariano wrote:
I don't really understand your problem because you don't say what
information is changing about the bezier. You want length to stay fixed
while what is varying?
If you bend a strip of flexible material, that brings the ends closer
together, but the strip stays the same length. With Bezier curves, it’s the
other way round: the ends stay put and the length increases. I am looking
for realistic behaviour. The animation shows the outer ends of the Beziers
being pulled in as the curvature increases, which is what I want, but the
distance they are pulled in is only a guess. How much should it be?
However, I do note that even just calculating the length of a bezier has
no closed form solution, which means it's going to be impossible to control
the length with a parameter in a simple fashion.
Alas, no “echo” and no “constant length = true”, then. Guess I’ll have to
tape a cotton thread onto the monitor of my PC to measure the lengths of
the Beziers, to get the difference between zero deflection and full
deflection. Kitchen table maths!
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
There is no way to “bend” a bezier like a physical string. If you just
want to take a sequence of beziers and extract a sub curve that is the same
length that could be done. Your problem is not well defined because you
have not explained how you are varying the control points. Or how you want
to vary them.
You can compute the length of a bezier just not on closed form. To be able
to have a settable length parameter you would need a closed form expression
for length you could solve.
BOSL2 provides bezier_length() and you could write a recursive function
that would find the u span to approximate a desired length. You could
measure the length and scale the curve shorter to the desired length. You
could put the end control points very far from the others and then move
them inward to shorten it.
The result may have constant length but still won’t reflect actual movement
of a string. Getting that right would require solving an appropriate set
of differential equations.
On Wed, Apr 15, 2026 at 06:57 Caddiy via Discuss <discuss@lists.openscad.org>
wrote:
> Adrian Mariano wrote:
>
> I don't really understand your problem because you don't say what
> information is changing about the bezier. You want length to stay fixed
> while what is varying?
>
> If you bend a strip of flexible material, that brings the ends closer
> together, but the strip stays the same length. With Bezier curves, it’s the
> other way round: the ends stay put and the length increases. I am looking
> for realistic behaviour. The animation shows the outer ends of the Beziers
> being pulled in as the curvature increases, which is what I want, but the
> distance they are pulled in is only a guess. How much should it be?
>
> However, I do note that even just calculating the length of a bezier has
> no closed form solution, which means it's going to be impossible to control
> the length with a parameter in a simple fashion.
>
> Alas, no “echo” and no “constant length = true”, then. Guess I’ll have to
> tape a cotton thread onto the monitor of my PC to measure the lengths of
> the Beziers, to get the difference between zero deflection and full
> deflection. Kitchen table maths!
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Rogier Wolff
Wed, Apr 15, 2026 12:02 PM
On Wed, Apr 15, 2026 at 10:57:14AM +0000, Caddiy via Discuss wrote:
I don't really understand your problem because you don't say what
information is changing about the bezier. You want length to stay fixed
while what is varying?
If you bend a strip of flexible material, that brings the ends
closer together, but the strip stays the same length. With Bezier
curves, it’s the other way round: the ends stay put and the length
increases. I am looking for realistic behaviour. The animation shows
the outer ends of the Beziers being pulled in as the curvature
increases, which is what I want, but the distance they are pulled in
is only a guess. How much should it be?
IIRC, it is difficult to calculate the length of a bezier curve.
IIRC, Freya Holmér made a video about this. Her focus was on
moving an object at constant "speed" through the curve, but calculating
the length is also an issue in that case.
I realize you don't just want to calculate the length, but then want
to keep it constant, but to keep it constant the first step would be
to be able to calculate that length.
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Verl. Spiegelmakerstraat 37 2645 LZ Delfgauw, The Netherlands.
** KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a** is going up. -- Chris Hadfield about flying up the space shuttle.
** 'a' for accelleration.
On Wed, Apr 15, 2026 at 10:57:14AM +0000, Caddiy via Discuss wrote:
> Adrian Mariano wrote:
>
> > I don't really understand your problem because you don't say what
> > information is changing about the bezier. You want length to stay fixed
> > while what is varying?
>
> If you bend a strip of flexible material, that brings the ends
> closer together, but the strip stays the same length. With Bezier
> curves, it’s the other way round: the ends stay put and the length
> increases. I am looking for realistic behaviour. The animation shows
> the outer ends of the Beziers being pulled in as the curvature
> increases, which is what I want, but the distance they are pulled in
> is only a guess. How much should it be?
IIRC, it is difficult to calculate the length of a bezier curve.
IIRC, Freya Holmér made a video about this. Her focus was on
moving an object at constant "speed" through the curve, but calculating
the length is also an issue in that case.
I realize you don't just want to calculate the length, but then want
to keep it constant, but to keep it constant the first step would be
to be able to calculate that length.
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Verl. Spiegelmakerstraat 37 2645 LZ Delfgauw, The Netherlands.
** KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a** is going up. -- Chris Hadfield about flying up the space shuttle.
** 'a' for accelleration.
M
mikeonenine@web.de
Wed, Apr 15, 2026 1:01 PM
I realize you don't just want to calculate the length, but then want
to keep it constant, but to keep it constant the first step would be
to be able to calculate that length.
Exactly.
Then find the difference in length between when the Bezier has maximum deflection and when it has zero deflection/is straight.
It occurs to me that Beziers are made up of straight segments. There are not so many segments in my present Bezier. I could set $vpd such that a scale length of 10 units has a length of say 5 cm (or 10 cm) on the monitor. Then measure the segments with a ruler and add them together. But couldn’t my computer do that?
I did look up bezier_path_length() in Library File beziers.scad, but I didn’t understand it and unfortunately there was no example that would show how to use it, and above all, what it actually does.
Until I find that difference in lengths, I will not know whether it is actually significant for my project!
How a relatively long thin strip or rod of elastic material bends when forces are applied can be rendered very nicely with Bezier curves - better than the sine and cosine curves I have used previously.
Rogier Wolff wrote:
> I realize you don't just want to calculate the length, but then want
> to keep it constant, but to keep it constant the first step would be
> to be able to calculate that length.
Exactly.
Then find the difference in length between when the Bezier has maximum deflection and when it has zero deflection/is straight.
It occurs to me that Beziers are made up of straight segments. There are not so many segments in my present Bezier. I could set $vpd such that a scale length of 10 units has a length of say 5 cm (or 10 cm) on the monitor. Then measure the segments with a ruler and add them together. But couldn’t my computer do that?
I did look up bezier_path_length() in Library File beziers.scad, but I didn’t understand it and unfortunately there was no example that would show how to use it, and above all, what it actually does.
Until I find that difference in lengths, I will not know whether it is actually significant for my project!
How a relatively long thin strip or rod of elastic material bends when forces are applied can be rendered very nicely with Bezier curves - better than the sine and cosine curves I have used previously.
JD
John David
Wed, Apr 15, 2026 1:02 PM
I wrote a function to calculate the NURBS provided by BOSL2 (IIRC). I
thought I passed that back upstream for inclusion, but I could be wrong.
Anyway, there are a number of curves that do not have closed-form
mathematical solutions to calculate length, but you can estimate it by
successive subdivision approximation. That said, a NURB curve/surface can
be tied up into knots. The BOSL2 example shows such an example (IIRC).
Anyway, there should be some function to calculate the length, but it is
computationally more expensive than you would think.
If there is not a Bezier_/NURB_length function, we should come up with a
couple that use linear and circle-arc approximations -- linear segments is
straight forward, but circle-arc lengths often converge on an answer faster.
EBo --
On Wed, Apr 15, 2026 at 8:10 AM Rogier Wolff via Discuss <
discuss@lists.openscad.org> wrote:
On Wed, Apr 15, 2026 at 10:57:14AM +0000, Caddiy via Discuss wrote:
I don't really understand your problem because you don't say what
information is changing about the bezier. You want length to stay
If you bend a strip of flexible material, that brings the ends
closer together, but the strip stays the same length. With Bezier
curves, it’s the other way round: the ends stay put and the length
increases. I am looking for realistic behaviour. The animation shows
the outer ends of the Beziers being pulled in as the curvature
increases, which is what I want, but the distance they are pulled in
is only a guess. How much should it be?
IIRC, it is difficult to calculate the length of a bezier curve.
IIRC, Freya Holmér made a video about this. Her focus was on
moving an object at constant "speed" through the curve, but calculating
the length is also an issue in that case.
I realize you don't just want to calculate the length, but then want
to keep it constant, but to keep it constant the first step would be
to be able to calculate that length.
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
** Verl. Spiegelmakerstraat 37 2645 LZ Delfgauw, The Netherlands.
** KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a** is going up. -- Chris Hadfield about flying up the space shuttle.
** 'a' for accelleration.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I wrote a function to calculate the NURBS provided by BOSL2 (IIRC). I
thought I passed that back upstream for inclusion, but I could be wrong.
Anyway, there are a number of curves that do not have closed-form
mathematical solutions to calculate length, but you can estimate it by
successive subdivision approximation. That said, a NURB curve/surface can
be tied up into knots. The BOSL2 example shows such an example (IIRC).
Anyway, there should be some function to calculate the length, but it is
computationally more expensive than you would think.
If there is not a Bezier_/NURB_length function, we should come up with a
couple that use linear and circle-arc approximations -- linear segments is
straight forward, but circle-arc lengths often converge on an answer faster.
EBo --
On Wed, Apr 15, 2026 at 8:10 AM Rogier Wolff via Discuss <
discuss@lists.openscad.org> wrote:
> On Wed, Apr 15, 2026 at 10:57:14AM +0000, Caddiy via Discuss wrote:
> > Adrian Mariano wrote:
> >
> > > I don't really understand your problem because you don't say what
> > > information is changing about the bezier. You want length to stay
> fixed
> > > while what is varying?
> >
>
> > If you bend a strip of flexible material, that brings the ends
> > closer together, but the strip stays the same length. With Bezier
> > curves, it’s the other way round: the ends stay put and the length
> > increases. I am looking for realistic behaviour. The animation shows
> > the outer ends of the Beziers being pulled in as the curvature
> > increases, which is what I want, but the distance they are pulled in
> > is only a guess. How much should it be?
>
> IIRC, it is difficult to calculate the length of a bezier curve.
>
> IIRC, Freya Holmér made a video about this. Her focus was on
> moving an object at constant "speed" through the curve, but calculating
> the length is also an issue in that case.
>
> I realize you don't just want to calculate the length, but then want
> to keep it constant, but to keep it constant the first step would be
> to be able to calculate that length.
>
> Roger.
>
> --
> ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
> **
> ** Verl. Spiegelmakerstraat 37 2645 LZ Delfgauw, The Netherlands.
> ** KVK: 27239233 **
> f equals m times a. When your f is steady, and your m is going down
> your a** is going up. -- Chris Hadfield about flying up the space shuttle.
> ** 'a' for accelleration.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
GB
Glenn Butcher
Wed, Apr 15, 2026 1:36 PM
Wondering if a simple control-point spline wouldn't scratch your itch. I
use one in a photo processing program I wrote to make an interactive
tone curve, where the end points are anchored at 0,0 and 255,255. The C
implementation of the one I use is here:
https://kluge.in-chemnitz.de/opensource/spline/
Glenn
On 4/15/2026 7:02 AM, John David via Discuss wrote:
I wrote a function to calculate the NURBS provided by BOSL2 (IIRC). I
thought I passed that back upstream for inclusion, but I could be
wrong. Anyway, there are a number of curves that do not have
closed-form mathematical solutions to calculate length, but you can
estimate it by successive subdivision approximation. That said, a
NURB curve/surface can be tied up into knots. The BOSL2 example shows
such an example (IIRC). Anyway, there should be some function to
calculate the length, but it is computationally more expensive than
you would think.
If there is not a Bezier_/NURB_length function, we should come up with
a couple that use linear and circle-arc approximations -- linear
segments is straight forward, but circle-arc lengths often converge on
an answer faster.
EBo --
On Wed, Apr 15, 2026 at 8:10 AM Rogier Wolff via Discuss
discuss@lists.openscad.org wrote:
On Wed, Apr 15, 2026 at 10:57:14AM +0000, Caddiy via Discuss wrote:
I don't really understand your problem because you don't say what
information is changing about the bezier. You want length to
If you bend a strip of flexible material, that brings the ends
closer together, but the strip stays the same length. With Bezier
curves, it’s the other way round: the ends stay put and the length
increases. I am looking for realistic behaviour. The animation shows
the outer ends of the Beziers being pulled in as the curvature
increases, which is what I want, but the distance they are pulled in
is only a guess. How much should it be?
IIRC, it is difficult to calculate the length of a bezier curve.
IIRC, Freya Holmér made a video about this. Her focus was on
moving an object at constant "speed" through the curve, but
calculating
the length is also an issue in that case.
I realize you don't just want to calculate the length, but then want
to keep it constant, but to keep it constant the first step would be
to be able to calculate that length.
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/
<https://www.BitWizard.nl/> ** +31-15-2049110 **
** Verl. Spiegelmakerstraat 37 2645 LZ Delfgauw, The Netherlands.
** KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a** is going up. -- Chris Hadfield about flying up the space
shuttle.
** 'a' for accelleration.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org
Wondering if a simple control-point spline wouldn't scratch your itch. I
use one in a photo processing program I wrote to make an interactive
tone curve, where the end points are anchored at 0,0 and 255,255. The C
implementation of the one I use is here:
https://kluge.in-chemnitz.de/opensource/spline/
Glenn
On 4/15/2026 7:02 AM, John David via Discuss wrote:
> I wrote a function to calculate the NURBS provided by BOSL2 (IIRC). I
> thought I passed that back upstream for inclusion, but I could be
> wrong. Anyway, there are a number of curves that do not have
> closed-form mathematical solutions to calculate length, but you can
> estimate it by successive subdivision approximation. That said, a
> NURB curve/surface can be tied up into knots. The BOSL2 example shows
> such an example (IIRC). Anyway, there should be some function to
> calculate the length, but it is computationally more expensive than
> you would think.
>
> If there is not a Bezier_/NURB_length function, we should come up with
> a couple that use linear and circle-arc approximations -- linear
> segments is straight forward, but circle-arc lengths often converge on
> an answer faster.
>
> EBo --
>
> On Wed, Apr 15, 2026 at 8:10 AM Rogier Wolff via Discuss
> <discuss@lists.openscad.org> wrote:
>
> On Wed, Apr 15, 2026 at 10:57:14AM +0000, Caddiy via Discuss wrote:
> > Adrian Mariano wrote:
> >
> > > I don't really understand your problem because you don't say what
> > > information is changing about the bezier. You want length to
> stay fixed
> > > while what is varying?
> >
>
> > If you bend a strip of flexible material, that brings the ends
> > closer together, but the strip stays the same length. With Bezier
> > curves, it’s the other way round: the ends stay put and the length
> > increases. I am looking for realistic behaviour. The animation shows
> > the outer ends of the Beziers being pulled in as the curvature
> > increases, which is what I want, but the distance they are pulled in
> > is only a guess. How much should it be?
>
> IIRC, it is difficult to calculate the length of a bezier curve.
>
> IIRC, Freya Holmér made a video about this. Her focus was on
> moving an object at constant "speed" through the curve, but
> calculating
> the length is also an issue in that case.
>
> I realize you don't just want to calculate the length, but then want
> to keep it constant, but to keep it constant the first step would be
> to be able to calculate that length.
>
> Roger.
>
> --
> ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/
> <https://www.BitWizard.nl/> ** +31-15-2049110 **
> ** Verl. Spiegelmakerstraat 37 2645 LZ Delfgauw, The Netherlands.
> ** KVK: 27239233 **
> f equals m times a. When your f is steady, and your m is going down
> your a** is going up. -- Chris Hadfield about flying up the space
> shuttle.
> ** 'a' for accelleration.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email todiscuss-leave@lists.openscad.org
RW
Rogier Wolff
Wed, Apr 15, 2026 1:46 PM
On Wed, Apr 15, 2026 at 01:01:53PM +0000, Caddiy via Discuss wrote:
It occurs to me that Beziers are made up of straight segments. There
are not so many segments in my present Bezier. I could set $vpd such
that a scale length of 10 units has a length of say 5 cm (or 10 cm)
on the monitor. Then measure the segments with a ruler and add them
together. But couldn’t my computer do that?
Ohh..
To render a bezier, the trick is that you can calculate the midpoint
and then the controlpoints of a bezier curve that does just the first
half and just the second half.
This is used to render a bezier curve. Subdivide recursively until the
segments are short enough to be indistinguisable from a straight line.
And for those you can calculate the length.
Thus I suspect that the bezier_curve_length function works this way.
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Verl. Spiegelmakerstraat 37 2645 LZ Delfgauw, The Netherlands.
** KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a** is going up. -- Chris Hadfield about flying up the space shuttle.
** 'a' for accelleration.
On Wed, Apr 15, 2026 at 01:01:53PM +0000, Caddiy via Discuss wrote:
> It occurs to me that Beziers are made up of straight segments. There
> are not so many segments in my present Bezier. I could set $vpd such
> that a scale length of 10 units has a length of say 5 cm (or 10 cm)
> on the monitor. Then measure the segments with a ruler and add them
> together. But couldn’t my computer do that?
Ohh..
To render a bezier, the trick is that you can calculate the midpoint
and then the controlpoints of a bezier curve that does just the first
half and just the second half.
This is used to render a bezier curve. Subdivide recursively until the
segments are short enough to be indistinguisable from a straight line.
And for those you can calculate the length.
Thus I suspect that the bezier_curve_length function works this way.
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
** Verl. Spiegelmakerstraat 37 2645 LZ Delfgauw, The Netherlands.
** KVK: 27239233 **
f equals m times a. When your f is steady, and your m is going down
your a** is going up. -- Chris Hadfield about flying up the space shuttle.
** 'a' for accelleration.
SP
Sanjeev Prabhakar
Wed, Apr 15, 2026 2:07 PM
I have written it in python where the length as per my calculation remains
constant till 2 decimal digits.
In this one end of the rope is fixed and the other end moves.
To do this in openscad, as per me the idea is to superimpose a line on a
bezier curve, based on the length of the line.
to run the below python code, you need to import the library openscad4.py
from my github page:
https://github.com/sprabhakar2006/openSCAD
but it is definitely a tricky problem to solve.
Attached in the scad file and the python code is below:
from openscad4 import *
cpnt=cytz(m_points1_o(cr2dt([[0,0],[10,5],[20,-10],[10,5]]),4))
cpnt1=mirror_line(cpnt,[0,0,1],[0,0,0])
bcur=bezier(cpnt,50)
bcur1=bezier(cpnt1,50)
bcur2=slice_sol([bcur,bcur1],11)
l1=m_points1_o([[0,0.01],[0,39.9]],40)
l2=[wrap_around(l1,p) for p in bcur2]
lx=[l_lenv_o(p) for p in l2]
fo(f'''
color("cyan") for(p=[l2[abs(round(10sin($t360)))]])p_line3d(p,.2);
color("magenta") translate([3,1,5])rotate([90,0,0])linear_extrude(0.05)
text(str("line_length : ",lx[abs(round(10sin($t360)))]),2);
l2={l2};
lx={lx};
''')
use following parameters for animation:
[image: Screenshot 2026-04-15 at 7.26.37 PM.png]
On Wed, 15 Apr 2026 at 09:16, Caddiy via Discuss discuss@lists.openscad.org
wrote:
Bezier curves get longer, the more they are bent. This is contrary to what
happens in the real world somewhere out there.
Is there a parameter that can be set to obtain a fixed length instead of
fixed ends?
Or is there an echo(); that returns the true length of a Bezier curve,
from which a correction could be calculated?
The animation shows what I am looking for: the free ends move back and
forth because I incorporated a fudge in the code.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I have written it in python where the length as per my calculation remains
constant till 2 decimal digits.
In this one end of the rope is fixed and the other end moves.
To do this in openscad, as per me the idea is to superimpose a line on a
bezier curve, based on the length of the line.
to run the below python code, you need to import the library openscad4.py
from my github page:
https://github.com/sprabhakar2006/openSCAD
but it is definitely a tricky problem to solve.
Attached in the scad file and the python code is below:
from openscad4 import *
cpnt=cytz(m_points1_o(cr2dt([[0,0],[10,5],[20,-10],[10,5]]),4))
cpnt1=mirror_line(cpnt,[0,0,1],[0,0,0])
bcur=bezier(cpnt,50)
bcur1=bezier(cpnt1,50)
bcur2=slice_sol([bcur,bcur1],11)
l1=m_points1_o([[0,0.01],[0,39.9]],40)
l2=[wrap_around(l1,p) for p in bcur2]
lx=[l_lenv_o(p) for p in l2]
fo(f'''
color("cyan") for(p=[l2[abs(round(10*sin($t*360)))]])p_line3d(p,.2);
color("magenta") translate([3,1,5])rotate([90,0,0])linear_extrude(0.05)
text(str("line_length : ",lx[abs(round(10*sin($t*360)))]),2);
l2={l2};
lx={lx};
''')
use following parameters for animation:
[image: Screenshot 2026-04-15 at 7.26.37 PM.png]
On Wed, 15 Apr 2026 at 09:16, Caddiy via Discuss <discuss@lists.openscad.org>
wrote:
> Bezier curves get longer, the more they are bent. This is contrary to what
> happens in the real world somewhere out there.
>
> Is there a parameter that can be set to obtain a fixed length instead of
> fixed ends?
>
> Or is there an echo(); that returns the true length of a Bezier curve,
> from which a correction could be calculated?
>
> The animation shows what I am looking for: the free ends move back and
> forth because I incorporated a fudge in the code.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org