AM
Adrian Mariano
Wed, Apr 15, 2026 2:19 PM
I think you want bezier_length not bezier_path_length. The latter is for a
sequence of beziers joined end to end. The usage should not require an
example. You give it your bezier and it returns the length.
There’s nothing really magical here. You can calculate the length
yourself. Just evaluate all the points on the curve at some spacing and
then compute the length of all the segments. The library implementation
tries to be smarter about this same basic process.
John, it looks like your nurbs distance never made it. Contact me off list
and we can fix that.
On Wed, Apr 15, 2026 at 09:02 Caddiy via Discuss discuss@lists.openscad.org
wrote:
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.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I think you want bezier_length not bezier_path_length. The latter is for a
sequence of beziers joined end to end. The usage should not require an
example. You give it your bezier and it returns the length.
There’s nothing really magical here. You can calculate the length
yourself. Just evaluate all the points on the curve at some spacing and
then compute the length of all the segments. The library implementation
tries to be smarter about this same basic process.
John, it looks like your nurbs distance never made it. Contact me off list
and we can fix that.
On Wed, Apr 15, 2026 at 09:02 Caddiy via Discuss <discuss@lists.openscad.org>
wrote:
> 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.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
M
mikeonenine@web.de
Sat, Apr 18, 2026 1:56 AM
I think you want bezier_length not bezier_path_length. You give it your bezier and it returns the length.
Not with me!
I can’t find a bezier_length and I don’t want bezier_path_length. That leaves bezier_segment_length(). Is that the right one? It doesn’t work anyway.
module hump()
{
bezpath = flatten([
bez_begin([-15, 0], 60, 20),
bez_end ([ 15, 0], 120, 20),
]);
path_sweep(circle(d=1, $fn=20), bezpath_curve(bezpath));
//debug_bezier(bezpath);
}
hump();
hump()_segment_length(
[-15, 0],
[-15+25*cos(60), 25*sin(60)],
[15-25*cos(60), 25*sin(60)],
[-15, 0],
[0], [1],
[20]);
Where is the value supposed to appear?
Does it need echo();?
There’s nothing really magical here. You can calculate the length
yourself. Just evaluate all the points on the curve at some spacing and
then compute the length of all the segments.
With sqrt(pow(x1-x2)+pow(y1-y2)) + sqrt(pow(x2-x3)+pow(y2-y3)) + sqrt(pow(x3-x4)+pow(y3-y4)) . . . ? Looks like a nice job for a rainy day.
Adrian Mariano wrote:
> I think you want bezier_length not bezier_path_length. You give it your bezier and it returns the length.
Not with me!
I can’t find a bezier_length and I don’t want bezier_path_length. That leaves bezier_segment_length(). Is that the right one? It doesn’t work anyway.
*module hump()*
*{*
*bezpath = flatten(\[*
*bez_begin(\[-15, 0\], 60, 20),*
*bez_end (\[ 15, 0\], 120, 20),*
*\]);*
*path_sweep(circle(d=1, $fn=20), bezpath_curve(bezpath));*
*//debug_bezier(bezpath);*
*}*
*hump();*
*hump()_segment_length(*
*\[-15, 0\],*
*\[-15+25\*cos(60), 25\*sin(60)\],*
*\[15-25\*cos(60), 25\*sin(60)\],*
*\[-15, 0\],*
*\[0\], \[1\],*
*\[20\]);*
Where is the value supposed to appear?
Does it need echo();?
> There’s nothing really magical here. You can calculate the length
> yourself. Just evaluate all the points on the curve at some spacing and
> then compute the length of all the segments.
With sqrt(pow(x1-x2)+pow(y1-y2)) + sqrt(pow(x2-x3)+pow(y2-y3)) + sqrt(pow(x3-x4)+pow(y3-y4)) . . . ? Looks like a nice job for a rainy day.
AM
Adrian Mariano
Sat, Apr 18, 2026 3:59 AM
Ah, your code example shows that bezpath_length() is the correct
option. One general tip is that if something seems like "a nice job for a
rainy day" that means you're doing work the computer should be doing.
The BOSL2 docs I'm afraid generally assume that you know how to write
OpenSCAD code. They aren't meant to teach you to program.
bezpath_length() is a function. As with any function (in pretty much any
programming language) you have to put its return value in a variable or
echo it or pass it as a parameter into some other module or function.
You do with it whatever you want to do. The value doesn't "appear".
So for example if you want to echo it:
echo(bezpath_length(bezpath));
Or the approach from calculating the length from the curve points itself
without bezpath_length():
echo(path_length(bezpath_curve(bezpath)));
If you want to use the length to trim the curve you wouldn't want to echo
it, you'd need to use it to feed some recursive calculation to find the u
value that has the desired length.
On Fri, Apr 17, 2026 at 9:56 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
Adrian Mariano wrote:
I think you want bezier_length not bezier_path_length. You give it your
bezier and it returns the length.
Not with me!
I can’t find a bezier_length and I don’t want bezier_path_length. That
leaves bezier_segment_length(). Is that the right one? It doesn’t work
anyway.
module hump()
{
bezpath = flatten([
*bez_begin([-15, 0], 60, 20), *
*bez_end ([ 15, 0], 120, 20), *
]);
path_sweep(circle(d=1, $fn=20), bezpath_curve(bezpath));
//debug_bezier(bezpath);
}
hump();
hump()_segment_length(
*[-15, 0], *
[-15+25cos(60), 25*sin(60)], *
[15-25cos(60), 25*sin(60)], *
[-15, 0],
*[0], [1], *
[20]);
Where is the value supposed to appear?
Does it need echo();?
There’s nothing really magical here. You can calculate the length
yourself. Just evaluate all the points on the curve at some spacing and
then compute the length of all the segments.
With sqrt(pow(x1-x2)+pow(y1-y2)) + sqrt(pow(x2-x3)+pow(y2-y3)) +
sqrt(pow(x3-x4)+pow(y3-y4)) . . . ? Looks like a nice job for a rainy day.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Ah, your code example shows that bezpath_length() is the correct
option. One general tip is that if something seems like "a nice job for a
rainy day" that means you're doing work the computer should be doing.
The BOSL2 docs I'm afraid generally assume that you know how to write
OpenSCAD code. They aren't meant to teach you to program.
bezpath_length() is a function. As with any function (in pretty much any
programming language) you have to put its return value in a variable or
echo it or pass it as a parameter into some other module or function.
You do with it whatever you want to do. The value doesn't "appear".
So for example if you want to echo it:
echo(bezpath_length(bezpath));
Or the approach from calculating the length from the curve points itself
without bezpath_length():
echo(path_length(bezpath_curve(bezpath)));
If you want to use the length to trim the curve you wouldn't want to echo
it, you'd need to use it to feed some recursive calculation to find the u
value that has the desired length.
On Fri, Apr 17, 2026 at 9:56 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
> Adrian Mariano wrote:
>
> I think you want bezier_length not bezier_path_length. You give it your
> bezier and it returns the length.
>
> Not with me!
>
> I can’t find a bezier_length and I don’t want bezier_path_length. That
> leaves bezier_segment_length(). Is that the right one? It doesn’t work
> anyway.
>
> *module hump()*
>
> *{*
>
> *bezpath = flatten([*
>
> *bez_begin([-15, 0], 60, 20), *
>
> *bez_end ([ 15, 0], 120, 20), *
>
> *]);*
>
> *path_sweep(circle(d=1, $fn=20), bezpath_curve(bezpath));*
>
> *//debug_bezier(bezpath);*
>
> *}*
>
> *hump();*
>
> *hump()_segment_length(*
>
> *[-15, 0], *
>
> *[-15+25*cos(60), 25*sin(60)], *
>
> *[15-25*cos(60), 25*sin(60)], *
>
> *[-15, 0],*
>
> *[0], [1], *
>
> *[20]);*
>
> Where is the value supposed to appear?
>
> Does it need echo();?
>
> There’s nothing really magical here. You can calculate the length
> yourself. Just evaluate all the points on the curve at some spacing and
> then compute the length of all the segments.
>
> With sqrt(pow(x1-x2)+pow(y1-y2)) + sqrt(pow(x2-x3)+pow(y2-y3)) +
> sqrt(pow(x3-x4)+pow(y3-y4)) . . . ? Looks like a nice job for a rainy day.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
M
mikeonenine@web.de
Sat, Apr 18, 2026 6:45 AM
Ah, your code example shows that bezpath_length() is the correct
option. One general tip is that if something seems like "a nice job for a
rainy day" that means you're doing work the computer should be doing.
The BOSL2 docs I'm afraid generally assume that you know how to write
OpenSCAD code. They aren't meant to teach you to program.
I started probably 20-30 years later than most people on this mailing list. Is there somewhere I can learn how to write OpenSCAD code, a forum perhaps?
There is precious little on beziers in the OpenSCAD User Manual.
bezpath_length() is a function. As with any function (in pretty much any programming language) you have to put its return value in a variable or echo it or pass it as a parameter into some other module or function. You do with it whatever you want to do. The value doesn't "appear".
So for example if you want to echo it:
echo(bezpath_length(bezpath));
Or the approach from calculating the length from the curve points itself
without bezpath_length():
echo(path_length(bezpath_curve(bezpath)));
If you want to use the length to trim the curve you wouldn't want to echo
it, you'd need to use it to feed some recursive calculation to find the u
value that has the desired length.
Adrian Mariano wrote:
> Ah, your code example shows that bezpath_length() is the correct
> option. One general tip is that if something seems like "a nice job for a
> rainy day" that means you're doing work the computer should be doing.
>
> The BOSL2 docs I'm afraid generally assume that you know how to write
> OpenSCAD code. They aren't meant to teach you to program.
I started probably 20-30 years later than most people on this mailing list. Is there somewhere I can learn how to write OpenSCAD code, a forum perhaps?
There is precious little on beziers in the OpenSCAD User Manual.
> bezpath_length() is a function. As with any function (in pretty much any programming language) you have to put its return value in a variable or echo it or pass it as a parameter into some other module or function. You do with it whatever you want to do. The value doesn't "appear".
>
> So for example if you want to echo it:
>
> echo(bezpath_length(bezpath));
>
> Or the approach from calculating the length from the curve points itself
> without bezpath_length():
>
> echo(path_length(bezpath_curve(bezpath)));
>
> If you want to use the length to trim the curve you wouldn't want to echo
> it, you'd need to use it to feed some recursive calculation to find the u
> value that has the desired length.
I get the following error warnings:
[WARNING: Ignoring unknown module 'bezpath_length' in file C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 62](62,C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad)
[WARNING: Ignoring unknown variable 'bezpath' in file C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 78](78,C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad)
[WARNING: len() parameter could not be converted in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad, line 547](547,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad)
[WARNING: undefined operation (undefined % number) in file ../BOSL2/beziers.scad, line 547](547,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad)
[ERROR: Assertion '((len(bezpath) % N) == 1)' failed: " A degree 3 bezier path should have a multiple of 3 points in it, plus 1." in file ../BOSL2/beziers.scad, line 547](547,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad)
[TRACE: called by 'bezpath_length' in file Blank.scad, line 78](78,C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad)
[TRACE: called by 'echo' in file Blank.scad, line 78](78,C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad)
bezpath_length is an unknown module. What to do?
AM
Adrian Mariano
Sat, Apr 18, 2026 12:15 PM
The two code lines I provided are meant to run in a context where bezpath
is defined but bezpath is identified as an unknown variable. It appears
you ran some other code that you have not shown. Another general tip: when
asking for help always show a minimal code example that displays your
issue, which means the smallest piece of ocde you can manage that still has
whatever the problem is. The error "Ignoring unknown module
'bezpath_length'" means you invoked bezpath length as a module, that is,
without using its return value. OpenSCAD is unusual among programming
languages because of this distinction. If you write
bezpath_length(foo);
that's a module invocation. if you write
len = bezpath_length(foo);
that's a function invocation. In this case the function exists but not the
module. The two are completely separate objects in OpenSCAD and they are
defined and exist independently, despite sharing the same name. In my
example lines I did not have any module invocations, so you did something I
did not show. Also, I recommend running with the OpenSCAD setting "stop on
first warning" enabled. This avoids the problem where an error causes a
cascade of related errors and it becomes hard to tell what was the cause of
a problem.
I am not aware of any resources for learning to code in OpenSCAD. You can
read things like the BOSL2 source code for examples of how to write code.
But it seems like you may want something more tutorial.
On Sat, Apr 18, 2026 at 2:46 AM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
Adrian Mariano wrote:
Ah, your code example shows that bezpath_length() is the correct option.
One general tip is that if something seems like "a nice job for a rainy
day" that means you're doing work the computer should be doing.
The BOSL2 docs I'm afraid generally assume that you know how to write
OpenSCAD code. They aren't meant to teach you to program.
I started probably 20-30 years later than most people on this mailing
list. Is there somewhere I can learn how to write OpenSCAD code, a forum
perhaps?
There is precious little on beziers in the OpenSCAD User Manual.
bezpath_length() is a function. As with any function (in pretty much any
programming language) you have to put its return value in a variable or
echo it or pass it as a parameter into some other module or function. You
do with it whatever you want to do. The value doesn't "appear".
So for example if you want to echo it:
echo(bezpath_length(bezpath));
Or the approach from calculating the length from the curve points itself
without bezpath_length():
echo(path_length(bezpath_curve(bezpath)));
If you want to use the length to trim the curve you wouldn't want to echo
it, you'd need to use it to feed some recursive calculation to find the u
value that has the desired length.
I get the following error warnings:
WARNING: Ignoring unknown module 'bezpath_length' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 62
WARNING: Ignoring unknown variable 'bezpath' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 78
WARNING: len() parameter could not be converted in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad, line 547
WARNING: undefined operation (undefined % number) in file
../BOSL2/beziers.scad, line 547
ERROR: Assertion '((len(bezpath) % N) == 1)' failed: " A degree 3 bezier
path should have a multiple of 3 points in it, plus 1." in file
../BOSL2/beziers.scad, line 547
TRACE: called by 'bezpath_length' in file Blank.scad, line 78
TRACE: called by 'echo' in file Blank.scad, line 78
bezpath_length is an unknown module. What to do?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
The two code lines I provided are meant to run in a context where bezpath
is defined but bezpath is identified as an unknown variable. It appears
you ran some other code that you have not shown. Another general tip: when
asking for help always show a minimal code example that displays your
issue, which means the smallest piece of ocde you can manage that still has
whatever the problem is. The error "Ignoring unknown module
'bezpath_length'" means you invoked bezpath length as a module, that is,
without using its return value. OpenSCAD is unusual among programming
languages because of this distinction. If you write
bezpath_length(foo);
that's a module invocation. if you write
len = bezpath_length(foo);
that's a function invocation. In this case the function exists but not the
module. The two are completely separate objects in OpenSCAD and they are
defined and exist independently, despite sharing the same name. In my
example lines I did not have any module invocations, so you did something I
did not show. Also, I recommend running with the OpenSCAD setting "stop on
first warning" enabled. This avoids the problem where an error causes a
cascade of related errors and it becomes hard to tell what was the cause of
a problem.
I am not aware of any resources for learning to code in OpenSCAD. You can
read things like the BOSL2 source code for examples of how to write code.
But it seems like you may want something more tutorial.
On Sat, Apr 18, 2026 at 2:46 AM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
> Adrian Mariano wrote:
>
> Ah, your code example shows that bezpath_length() is the correct option.
> One general tip is that if something seems like "a nice job for a rainy
> day" that means you're doing work the computer should be doing.
>
> The BOSL2 docs I'm afraid generally assume that you know how to write
> OpenSCAD code. They aren't meant to teach you to program.
>
> I started probably 20-30 years later than most people on this mailing
> list. Is there somewhere I can learn how to write OpenSCAD code, a forum
> perhaps?
>
> There is precious little on beziers in the OpenSCAD User Manual.
>
> bezpath_length() is a function. As with any function (in pretty much any
> programming language) you have to put its return value in a variable or
> echo it or pass it as a parameter into some other module or function. You
> do with it whatever you want to do. The value doesn't "appear".
>
> So for example if you want to echo it:
>
> echo(bezpath_length(bezpath));
>
> Or the approach from calculating the length from the curve points itself
> without bezpath_length():
>
> echo(path_length(bezpath_curve(bezpath)));
>
> If you want to use the length to trim the curve you wouldn't want to echo
> it, you'd need to use it to feed some recursive calculation to find the u
> value that has the desired length.
>
> I get the following error warnings:
>
> WARNING: Ignoring unknown module 'bezpath_length' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 62
>
> WARNING: Ignoring unknown variable 'bezpath' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 78
>
> WARNING: len() parameter could not be converted in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad, line 547
>
> WARNING: undefined operation (undefined % number) in file
> ../BOSL2/beziers.scad, line 547
>
> ERROR: Assertion '((len(bezpath) % N) == 1)' failed: " A degree 3 bezier
> path should have a multiple of 3 points in it, plus 1." in file
> ../BOSL2/beziers.scad, line 547
>
> TRACE: called by 'bezpath_length' in file Blank.scad, line 78
>
> TRACE: called by 'echo' in file Blank.scad, line 78
>
> bezpath_length is an unknown module. What to do?
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jon Bondy
Sat, Apr 18, 2026 12:29 PM
When I run OpenSCAD, under the Help menu, there is a Documentation menu
entry. The first thing on the web page that appears is a Tutorial.
This is not hidden.
Jon
On 4/18/2026 8:15 AM, Adrian Mariano via Discuss wrote:
The two code lines I provided are meant to run in a context where
bezpath is defined but bezpath is identified as an unknown
variable. It appears you ran some other code that you have not
shown. Another general tip: when asking for help always show a
minimal code example that displays your issue, which means the
smallest piece of ocde you can manage that still has whatever the
problem is. The error "Ignoring unknown module 'bezpath_length'"
means you invoked bezpath length as a module, that is, without using
its return value. OpenSCAD is unusual among programming languages
because of this distinction. If you write
bezpath_length(foo);
that's a module invocation. if you write
len = bezpath_length(foo);
that's a function invocation. In this case the function exists but
not the module. The two are completely separate objects in OpenSCAD
and they are defined and exist independently, despite sharing the same
name. In my example lines I did not have any module invocations, so
you did something I did not show. Also, I recommend running with the
OpenSCAD setting "stop on first warning" enabled. This avoids the
problem where an error causes a cascade of related errors and it
becomes hard to tell what was the cause of a problem.
I am not aware of any resources for learning to code in OpenSCAD. You
can read things like the BOSL2 source code for examples of how to
write code. But it seems like you may want something more tutorial.
On Sat, Apr 18, 2026 at 2:46 AM Caddiy via Discuss
discuss@lists.openscad.org wrote:
Adrian Mariano wrote:
Ah, your code example shows that bezpath_length() is the
correct option. One general tip is that if something seems
like "a nice job for a rainy day" that means you're doing work
the computer should be doing.
The BOSL2 docs I'm afraid generally assume that you know how
to write OpenSCAD code. They aren't meant to teach you to program.
I started probably 20-30 years later than most people on this
mailing list. Is there somewhere I can learn how to write OpenSCAD
code, a forum perhaps?
There is precious little on beziers in the OpenSCAD User Manual.
bezpath_length() is a function. As with any function (in
pretty much any programming language) you have to put its
return value in a variable or echo it or pass it as a
parameter into some other module or function. You do with it
whatever you want to do. The value doesn't "appear".
So for example if you want to echo it:
echo(bezpath_length(bezpath));
Or the approach from calculating the length from the curve
points itself without bezpath_length():
echo(path_length(bezpath_curve(bezpath)));
If you want to use the length to trim the curve you wouldn't
want to echo it, you'd need to use it to feed some recursive
calculation to find the u value that has the desired length.
I get the following error warnings:
WARNING: Ignoring unknown module 'bezpath_length' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 62
WARNING: Ignoring unknown variable 'bezpath' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 78
WARNING: len() parameter could not be converted in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad,
line 547
WARNING: undefined operation (undefined % number) in file
../BOSL2/beziers.scad, line 547
ERROR: Assertion '((len(bezpath) % N) == 1)' failed: " A degree 3
bezier path should have a multiple of 3 points in it, plus 1." in
file ../BOSL2/beziers.scad, line 547
TRACE: called by 'bezpath_length' in file Blank.scad, line 78
TRACE: called by 'echo' in file Blank.scad, line 78
bezpath_length is an unknown module. What to do?
_______________________________________________
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
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
When I run OpenSCAD, under the Help menu, there is a Documentation menu
entry. The first thing on the web page that appears is a Tutorial.
This is not hidden.
Jon
On 4/18/2026 8:15 AM, Adrian Mariano via Discuss wrote:
> The two code lines I provided are meant to run in a context where
> bezpath is defined but bezpath is identified as an unknown
> variable. It appears you ran some other code that you have not
> shown. Another general tip: when asking for help always show a
> minimal code example that displays your issue, which means the
> smallest piece of ocde you can manage that still has whatever the
> problem is. The error "Ignoring unknown module 'bezpath_length'"
> means you invoked bezpath length as a module, that is, without using
> its return value. OpenSCAD is unusual among programming languages
> because of this distinction. If you write
>
> bezpath_length(foo);
>
> that's a module invocation. if you write
>
> len = bezpath_length(foo);
>
> that's a function invocation. In this case the function exists but
> not the module. The two are completely separate objects in OpenSCAD
> and they are defined and exist independently, despite sharing the same
> name. In my example lines I did not have any module invocations, so
> you did something I did not show. Also, I recommend running with the
> OpenSCAD setting "stop on first warning" enabled. This avoids the
> problem where an error causes a cascade of related errors and it
> becomes hard to tell what was the cause of a problem.
>
> I am not aware of any resources for learning to code in OpenSCAD. You
> can read things like the BOSL2 source code for examples of how to
> write code. But it seems like you may want something more tutorial.
>
> On Sat, Apr 18, 2026 at 2:46 AM Caddiy via Discuss
> <discuss@lists.openscad.org> wrote:
>
> Adrian Mariano wrote:
>
> Ah, your code example shows that bezpath_length() is the
> correct option. One general tip is that if something seems
> like "a nice job for a rainy day" that means you're doing work
> the computer should be doing.
>
> The BOSL2 docs I'm afraid generally assume that you know how
> to write OpenSCAD code. They aren't meant to teach you to program.
>
> I started probably 20-30 years later than most people on this
> mailing list. Is there somewhere I can learn how to write OpenSCAD
> code, a forum perhaps?
>
> There is precious little on beziers in the OpenSCAD User Manual.
>
> bezpath_length() is a function. As with any function (in
> pretty much any programming language) you have to put its
> return value in a variable or echo it or pass it as a
> parameter into some other module or function. You do with it
> whatever you want to do. The value doesn't "appear".
>
> So for example if you want to echo it:
>
> echo(bezpath_length(bezpath));
>
> Or the approach from calculating the length from the curve
> points itself without bezpath_length():
>
> echo(path_length(bezpath_curve(bezpath)));
>
> If you want to use the length to trim the curve you wouldn't
> want to echo it, you'd need to use it to feed some recursive
> calculation to find the u value that has the desired length.
>
> I get the following error warnings:
>
> WARNING: Ignoring unknown module 'bezpath_length' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 62
>
> WARNING: Ignoring unknown variable 'bezpath' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 78
>
> WARNING: len() parameter could not be converted in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad,
> line 547
>
> WARNING: undefined operation (undefined % number) in file
> ../BOSL2/beziers.scad, line 547
>
> ERROR: Assertion '((len(bezpath) % N) == 1)' failed: " A degree 3
> bezier path should have a multiple of 3 points in it, plus 1." in
> file ../BOSL2/beziers.scad, line 547
>
> TRACE: called by 'bezpath_length' in file Blank.scad, line 78
>
> TRACE: called by 'echo' in file Blank.scad, line 78
>
> bezpath_length is an unknown module. What to do?
>
> _______________________________________________
> 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
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
NH
nop head
Sat, Apr 18, 2026 12:33 PM
When I run OpenSCAD, under the Help menu, there is a Documentation menu
entry. The first thing on the web page that appears is a Tutorial. This
is not hidden.
Jon
On 4/18/2026 8:15 AM, Adrian Mariano via Discuss wrote:
The two code lines I provided are meant to run in a context where bezpath
is defined but bezpath is identified as an unknown variable. It appears
you ran some other code that you have not shown. Another general tip: when
asking for help always show a minimal code example that displays your
issue, which means the smallest piece of ocde you can manage that still has
whatever the problem is. The error "Ignoring unknown module
'bezpath_length'" means you invoked bezpath length as a module, that is,
without using its return value. OpenSCAD is unusual among programming
languages because of this distinction. If you write
bezpath_length(foo);
that's a module invocation. if you write
len = bezpath_length(foo);
that's a function invocation. In this case the function exists but not
the module. The two are completely separate objects in OpenSCAD and they
are defined and exist independently, despite sharing the same name. In my
example lines I did not have any module invocations, so you did something I
did not show. Also, I recommend running with the OpenSCAD setting "stop on
first warning" enabled. This avoids the problem where an error causes a
cascade of related errors and it becomes hard to tell what was the cause of
a problem.
I am not aware of any resources for learning to code in OpenSCAD. You can
read things like the BOSL2 source code for examples of how to write code.
But it seems like you may want something more tutorial.
On Sat, Apr 18, 2026 at 2:46 AM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
Adrian Mariano wrote:
Ah, your code example shows that bezpath_length() is the correct option.
One general tip is that if something seems like "a nice job for a rainy
day" that means you're doing work the computer should be doing.
The BOSL2 docs I'm afraid generally assume that you know how to write
OpenSCAD code. They aren't meant to teach you to program.
I started probably 20-30 years later than most people on this mailing
list. Is there somewhere I can learn how to write OpenSCAD code, a forum
perhaps?
There is precious little on beziers in the OpenSCAD User Manual.
bezpath_length() is a function. As with any function (in pretty much any
programming language) you have to put its return value in a variable or
echo it or pass it as a parameter into some other module or function. You
do with it whatever you want to do. The value doesn't "appear".
So for example if you want to echo it:
echo(bezpath_length(bezpath));
Or the approach from calculating the length from the curve points itself
without bezpath_length():
echo(path_length(bezpath_curve(bezpath)));
If you want to use the length to trim the curve you wouldn't want to echo
it, you'd need to use it to feed some recursive calculation to find the u
value that has the desired length.
I get the following error warnings:
WARNING: Ignoring unknown module 'bezpath_length' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 62
WARNING: Ignoring unknown variable 'bezpath' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 78
WARNING: len() parameter could not be converted in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad, line 547
WARNING: undefined operation (undefined % number) in file
../BOSL2/beziers.scad, line 547
ERROR: Assertion '((len(bezpath) % N) == 1)' failed: " A degree 3 bezier
path should have a multiple of 3 points in it, plus 1." in file
../BOSL2/beziers.scad, line 547
TRACE: called by 'bezpath_length' in file Blank.scad, line 78
TRACE: called by 'echo' in file Blank.scad, line 78
bezpath_length is an unknown module. What to do?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Marius also wrote a book about OpenSCAD.
On Sat, 18 Apr 2026 at 13:29, Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:
> When I run OpenSCAD, under the Help menu, there is a Documentation menu
> entry. The first thing on the web page that appears is a Tutorial. This
> is not hidden.
>
> Jon
>
>
> On 4/18/2026 8:15 AM, Adrian Mariano via Discuss wrote:
>
> The two code lines I provided are meant to run in a context where bezpath
> is defined but bezpath is identified as an unknown variable. It appears
> you ran some other code that you have not shown. Another general tip: when
> asking for help always show a minimal code example that displays your
> issue, which means the smallest piece of ocde you can manage that still has
> whatever the problem is. The error "Ignoring unknown module
> 'bezpath_length'" means you invoked bezpath length as a module, that is,
> without using its return value. OpenSCAD is unusual among programming
> languages because of this distinction. If you write
>
> bezpath_length(foo);
>
> that's a module invocation. if you write
>
> len = bezpath_length(foo);
>
> that's a function invocation. In this case the function exists but not
> the module. The two are completely separate objects in OpenSCAD and they
> are defined and exist independently, despite sharing the same name. In my
> example lines I did not have any module invocations, so you did something I
> did not show. Also, I recommend running with the OpenSCAD setting "stop on
> first warning" enabled. This avoids the problem where an error causes a
> cascade of related errors and it becomes hard to tell what was the cause of
> a problem.
>
> I am not aware of any resources for learning to code in OpenSCAD. You can
> read things like the BOSL2 source code for examples of how to write code.
> But it seems like you may want something more tutorial.
>
> On Sat, Apr 18, 2026 at 2:46 AM Caddiy via Discuss <
> discuss@lists.openscad.org> wrote:
>
>> Adrian Mariano wrote:
>>
>> Ah, your code example shows that bezpath_length() is the correct option.
>> One general tip is that if something seems like "a nice job for a rainy
>> day" that means you're doing work the computer should be doing.
>>
>> The BOSL2 docs I'm afraid generally assume that you know how to write
>> OpenSCAD code. They aren't meant to teach you to program.
>>
>> I started probably 20-30 years later than most people on this mailing
>> list. Is there somewhere I can learn how to write OpenSCAD code, a forum
>> perhaps?
>>
>> There is precious little on beziers in the OpenSCAD User Manual.
>>
>> bezpath_length() is a function. As with any function (in pretty much any
>> programming language) you have to put its return value in a variable or
>> echo it or pass it as a parameter into some other module or function. You
>> do with it whatever you want to do. The value doesn't "appear".
>>
>> So for example if you want to echo it:
>>
>> echo(bezpath_length(bezpath));
>>
>> Or the approach from calculating the length from the curve points itself
>> without bezpath_length():
>>
>> echo(path_length(bezpath_curve(bezpath)));
>>
>> If you want to use the length to trim the curve you wouldn't want to echo
>> it, you'd need to use it to feed some recursive calculation to find the u
>> value that has the desired length.
>>
>> I get the following error warnings:
>>
>> WARNING: Ignoring unknown module 'bezpath_length' in file
>> C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 62
>>
>> WARNING: Ignoring unknown variable 'bezpath' in file
>> C:/Users/Admin/Documents/OpenSCAD/libraries/Own/Blank.scad, line 78
>>
>> WARNING: len() parameter could not be converted in file
>> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/beziers.scad, line 547
>>
>> WARNING: undefined operation (undefined % number) in file
>> ../BOSL2/beziers.scad, line 547
>>
>> ERROR: Assertion '((len(bezpath) % N) == 1)' failed: " A degree 3 bezier
>> path should have a multiple of 3 points in it, plus 1." in file
>> ../BOSL2/beziers.scad, line 547
>>
>> TRACE: called by 'bezpath_length' in file Blank.scad, line 78
>>
>> TRACE: called by 'echo' in file Blank.scad, line 78
>>
>> bezpath_length is an unknown module. What to do?
>> _______________________________________________
>> 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
>
>
>
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
> Virus-free.www.avg.com
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
> <#m_-5069860782905211552_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
M
mikeonenine@web.de
Sun, Apr 19, 2026 12:29 AM
Bending a cylinder through 120° brings the ends 30% closer together.

Bending a cylinder through 120° brings the ends 30% closer together.

MM
Michael Marx (spintel)
Sun, Apr 19, 2026 4:01 AM
Marius also wrote a book about OpenSCAD.
> Marius also wrote a book about OpenSCAD.
https://openscad.org/documentation-books.html
_____
From: nop head via Discuss [mailto:discuss@lists.openscad.org]
Sent: Saturday, April 18, 2026 10:34 PM
To: OpenSCAD general discussion Mailing-list
Cc: nop head
Subject: [OpenSCAD] Re: Bezier stretch
Marius also wrote a book about OpenSCAD.
M
mikeonenine@web.de
Sun, Apr 19, 2026 11:43 AM
Thanks.
“Marius also wrote a book about OpenSCAD” on its own was a bit meagre.
The problem, though, is that I want to know how to get the length of a bezier here and now, so I can get on with the project.
7 % stretch is significant.



Thanks.
“Marius also wrote a book about OpenSCAD” on its own was a bit meagre.
The problem, though, is that I want to know how to get the length of a bezier here and now, so I can get on with the project.
7 % stretch is significant.


