M
mikeonenine@web.de
Sun, Jul 13, 2025 2:03 AM
Hi,
I want to add a threaded part to my Balandin engine using BOSL2. But when I add include <BOSL2/std.scad>
to the code, the screen goes blank.
The threaded part appears as expected when the relevant snippet of code is used on its own with include <BOSL2/std.scad>
.
It seems BOSL2 and the Balandin engine don’t get on. The following warnings pop up in the console:
ERROR: Assertion 'is_vector(v)' failed: "Invalid vector" in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/vectors.scad, line 185
Line 185 is just [0, 14], a point in a polygon.
TRACE: called by 'unit' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line 2504
TRACE: called by '_find_anchor' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line 2268
TRACE: called by '_attach_transform' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line 1760
TRACE: called by 'attachable' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 297
TRACE: called by 'if' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 284
TRACE: called by 'if' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 273
[TRACE: called by 'circle' in file Balandin MB4 3.scad, line 414](414,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'translate' in file Balandin MB4 3.scad, line 413](413,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'rotate_extrude' in file Balandin MB4 3.scad, line 412](412,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'translate' in file Balandin MB4 3.scad, line 411](411,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'union' in file Balandin MB4 3.scad, line 365](365,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'difference' in file Balandin MB4 3.scad, line 363](363,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
What’s gone wrong?
Hi,
I want to add a threaded part to my Balandin engine using BOSL2. But when I add `include <BOSL2/std.scad>` to the code, the screen goes blank.
The threaded part appears as expected when the relevant snippet of code is used on its own with `include <BOSL2/std.scad>`.
It seems BOSL2 and the Balandin engine don’t get on. The following warnings pop up in the console:
[ERROR: Assertion 'is_vector(v)' failed: "Invalid vector" in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/vectors.scad, line 185](185,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/vectors.scad)
Line 185 is just \[0, 14\], a point in a polygon.
[TRACE: called by 'unit' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line 2504](2504,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad)
[TRACE: called by '_find_anchor' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line 2268](2268,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad)
[TRACE: called by '_attach_transform' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line 1760](1760,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad)
[TRACE: called by 'attachable' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 297](297,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad)
[TRACE: called by 'if' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 284](284,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad)
[TRACE: called by 'if' in file C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 273](273,C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad)
[TRACE: called by 'circle' in file Balandin MB4 3.scad, line 414](414,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'translate' in file Balandin MB4 3.scad, line 413](413,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'rotate_extrude' in file Balandin MB4 3.scad, line 412](412,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'translate' in file Balandin MB4 3.scad, line 411](411,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'union' in file Balandin MB4 3.scad, line 365](365,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
[TRACE: called by 'difference' in file Balandin MB4 3.scad, line 363](363,E:/Mot/CAD/Cpd Ecc/Balandin/Balandin MB4 3.scad)
What’s gone wrong?
AM
Adrian Mariano
Sun, Jul 13, 2025 2:41 AM
The problem on line 185 is at line 185 of BOSL2/vectors.scad, which isn't
really where the problem lies. You've somehow passed maybe an anchor value
to a BOSL2 object where that anchor is not a vector---so presumably
something is wrong with the circle() invocation on line 414 of "Balandin
MB4 3.scad". But that's a guess. A full code example is needed to
figure out what is wrong. (Probably better error handling is needed
somewhere in the library so the error is useful.)
On Sat, Jul 12, 2025 at 10:04 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
Hi,
I want to add a threaded part to my Balandin engine using BOSL2. But when
I add include <BOSL2/std.scad> to the code, the screen goes blank.
The threaded part appears as expected when the relevant snippet of code is
used on its own with include <BOSL2/std.scad>.
It seems BOSL2 and the Balandin engine don’t get on. The following
warnings pop up in the console:
ERROR: Assertion 'is_vector(v)' failed: "Invalid vector" in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/vectors.scad, line 185
Line 185 is just [0, 14], a point in a polygon.
TRACE: called by 'unit' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line
2504
TRACE: called by '_find_anchor' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line
2268
TRACE: called by '_attach_transform' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line
1760
TRACE: called by 'attachable' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 297
TRACE: called by 'if' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 284
TRACE: called by 'if' in file
C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 273
TRACE: called by 'circle' in file Balandin MB4 3.scad, line 414
TRACE: called by 'translate' in file Balandin MB4 3.scad, line 413
TRACE: called by 'rotate_extrude' in file Balandin MB4 3.scad, line 412
TRACE: called by 'translate' in file Balandin MB4 3.scad, line 411
TRACE: called by 'union' in file Balandin MB4 3.scad, line 365
TRACE: called by 'difference' in file Balandin MB4 3.scad, line 363
What’s gone wrong?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
The problem on line 185 is at line 185 of BOSL2/vectors.scad, which isn't
really where the problem lies. You've somehow passed maybe an anchor value
to a BOSL2 object where that anchor is not a vector---so presumably
something is wrong with the circle() invocation on line 414 of "Balandin
MB4 3.scad". But that's a guess. A full code example is needed to
figure out what is wrong. (Probably better error handling is needed
somewhere in the library so the error is useful.)
On Sat, Jul 12, 2025 at 10:04 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
> Hi,
>
> I want to add a threaded part to my Balandin engine using BOSL2. But when
> I add include <BOSL2/std.scad> to the code, the screen goes blank.
>
> The threaded part appears as expected when the relevant snippet of code is
> used on its own with include <BOSL2/std.scad>.
>
> It seems BOSL2 and the Balandin engine don’t get on. The following
> warnings pop up in the console:
>
> ERROR: Assertion 'is_vector(v)' failed: "Invalid vector" in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/vectors.scad, line 185
>
> Line 185 is just [0, 14], a point in a polygon.
>
> TRACE: called by 'unit' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line
> 2504
>
> TRACE: called by '_find_anchor' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line
> 2268
>
> TRACE: called by '_attach_transform' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/attachments.scad, line
> 1760
>
> TRACE: called by 'attachable' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 297
>
> TRACE: called by 'if' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 284
>
> TRACE: called by 'if' in file
> C:/Users/Admin/Documents/OpenSCAD/libraries/BOSL2/shapes2d.scad, line 273
>
> TRACE: called by 'circle' in file Balandin MB4 3.scad, line 414
>
> TRACE: called by 'translate' in file Balandin MB4 3.scad, line 413
>
> TRACE: called by 'rotate_extrude' in file Balandin MB4 3.scad, line 412
>
> TRACE: called by 'translate' in file Balandin MB4 3.scad, line 411
>
> TRACE: called by 'union' in file Balandin MB4 3.scad, line 365
>
> TRACE: called by 'difference' in file Balandin MB4 3.scad, line 363
>
> What’s gone wrong?
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
M
mikeonenine@web.de
Sun, Jul 13, 2025 3:44 AM
A good guess indeed! I had given the circle a value of 0 to hide it temporarily and then forgot about it. It works now with include <BOSL2/std.scad>
. Thanks.
A full code example is needed to figure out what is wrong.
Not necessary now, but here it is for anyone interested. It needs Stuff.scad to make it work.
Adrian Mariano wrote:
> But that's a guess.
A good guess indeed! I had given the circle a value of 0 to hide it temporarily and then forgot about it. It works now with `include <BOSL2/std.scad>`. Thanks.
> A full code example is needed to figure out what is wrong.
Not necessary now, but here it is for anyone interested. It needs Stuff.scad to make it work.
AM
Adrian Mariano
Sun, Jul 13, 2025 11:30 AM
So what actually created the error? The code you posted has tons of
warnings, but no error. Adding the BOSL2 include should not cause an
invocation of circle() that worked before to stop working, so that's a bug
that needs to be fixed.
Another comment: in OpenSCAD, "warnings" are really errors and typically
indicate that your code is bad or broken. I recommend writing code that
produces zero warnings and running with the "stop on first warning" feature
(Preferences->Advanced) enabled to prevent huge cascading lists of warning
messages.
On Sat, Jul 12, 2025 at 11:44 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
Adrian Mariano wrote:
But that's a guess.
A good guess indeed! I had given the circle a value of 0 to hide it
temporarily and then forgot about it. It works now with include
<BOSL2/std.scad>. Thanks.
A full code example is needed to figure out what is wrong.
Not necessary now, but here it is for anyone interested. It needs
Stuff.scad to make it work.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
So what actually created the error? The code you posted has tons of
warnings, but no error. Adding the BOSL2 include should not cause an
invocation of circle() that worked before to stop working, so that's a bug
that needs to be fixed.
Another comment: in OpenSCAD, "warnings" are really errors and typically
indicate that your code is bad or broken. I recommend writing code that
produces zero warnings and running with the "stop on first warning" feature
(Preferences->Advanced) enabled to prevent huge cascading lists of warning
messages.
On Sat, Jul 12, 2025 at 11:44 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
> Adrian Mariano wrote:
>
> But that's a guess.
>
> A good guess indeed! I had given the circle a value of 0 to hide it
> temporarily and then forgot about it. It works now with include
> <BOSL2/std.scad>. Thanks.
>
> A full code example is needed to figure out what is wrong.
>
> Not necessary now, but here it is for anyone interested. It needs
> Stuff.scad to make it work.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
M
mikeonenine@web.de
Sun, Jul 13, 2025 7:06 PM
So what actually created the error? The code you posted has tons of
warnings, but no error. Adding the BOSL2 include should not cause an
invocation of circle() that worked before to stop working, so that's a bug
that needs to be fixed.
As you rightly guessed, the error was in line 414 where the circle had a value of zero. As soon as I gave it a positive value, th eprogram worked. It worked with the zero when there was no include <BOSL2/std.scad>
. The “include” is legitimate and necessary. It just doesn’t like circles with a zero radius.
Another comment: in OpenSCAD, "warnings" are really errors and typically
indicate that your code is bad or broken. I recommend writing code that
produces zero warnings and running with the "stop on first warning" feature
(Preferences->Advanced) enabled to prevent huge cascading lists of warning
messages.
My codes do tend to generate rather a lot of warnings, but they work anyway - usually. If there is a genuine problem, it can be a little difficult to find amongst all that. It’s a bit like the child crying wolf.
Adrian Mariano wrote:
> So what actually created the error? The code you posted has tons of
> warnings, but no error. Adding the BOSL2 include should not cause an
> invocation of circle() that worked before to stop working, so that's a bug
> that needs to be fixed.
As you rightly guessed, the error was in line 414 where the circle had a value of zero. As soon as I gave it a positive value, th eprogram worked. It worked with the zero when there was no `include <BOSL2/std.scad>`. The “include” is legitimate and necessary. It just doesn’t like circles with a zero radius.
> Another comment: in OpenSCAD, "warnings" are really errors and typically
> indicate that your code is bad or broken. I recommend writing code that
> produces zero warnings and running with the "stop on first warning" feature
> (Preferences->Advanced) enabled to prevent huge cascading lists of warning
> messages.
My codes do tend to generate rather a lot of warnings, but they work anyway - usually. If there is a genuine problem, it can be a little difficult to find amongst all that. It’s a bit like the child crying wolf.
M
mikeonenine@web.de
Sun, Jul 13, 2025 7:21 PM
Not necessary now, but here it is for anyone interested. It needs Stuff.scad to make it work.
BTW the number of frames has to be set to 180 for the gears to rotate correctly. FPS very low to avoid missed frames.
mikeonenine@web.de wrote:
> Not necessary now, but here it is for anyone interested. It needs Stuff.scad to make it work.
BTW the number of frames has to be set to 180 for the gears to rotate correctly. FPS very low to avoid missed frames.
AM
Adrian Mariano
Sun, Jul 13, 2025 9:16 PM
Any use of circle() that works without including BOSL2 should also work and
produce identical results with BOSL2. Any exception to this is a bug that
we need to fix. In this case, it appears that you must be using an older
version of BOSL2, because circle(0) works fine for me with BOSL2.
In any other programming language, the things that are "warnings" in
OpenSCAD would be fatal errors. It's bad programming to write code that
generates warnings. Yes, you can do this and write code that works, but
I'm suggesting that you avoid doing that, especially if you plan to share
your code. Many people run with "stop on first warning" enabled, which
means they will have to change OpenSCAD settings to the unsafe mode in
order to run your program.
On Sun, Jul 13, 2025 at 3:07 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
Adrian Mariano wrote:
So what actually created the error? The code you posted has tons of
warnings, but no error. Adding the BOSL2 include should not cause an
invocation of circle() that worked before to stop working, so that's a bug
that needs to be fixed.
As you rightly guessed, the error was in line 414 where the circle had a
value of zero. As soon as I gave it a positive value, th eprogram worked.
It worked with the zero when there was no include <BOSL2/std.scad>. The
“include” is legitimate and necessary. It just doesn’t like circles with a
zero radius.
Another comment: in OpenSCAD, "warnings" are really errors and typically
indicate that your code is bad or broken. I recommend writing code that
produces zero warnings and running with the "stop on first warning" feature
(Preferences->Advanced) enabled to prevent huge cascading lists of warning
messages.
My codes do tend to generate rather a lot of warnings, but they work
anyway - usually. If there is a genuine problem, it can be a little
difficult to find amongst all that. It’s a bit like the child crying wolf.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Any use of circle() that works without including BOSL2 should also work and
produce identical results with BOSL2. Any exception to this is a bug that
we need to fix. In this case, it appears that you must be using an older
version of BOSL2, because circle(0) works fine for me with BOSL2.
In any other programming language, the things that are "warnings" in
OpenSCAD would be fatal errors. It's bad programming to write code that
generates warnings. Yes, you can do this and write code that works, but
I'm suggesting that you avoid doing that, especially if you plan to share
your code. Many people run with "stop on first warning" enabled, which
means they will have to change OpenSCAD settings to the unsafe mode in
order to run your program.
On Sun, Jul 13, 2025 at 3:07 PM Caddiy via Discuss <
discuss@lists.openscad.org> wrote:
> Adrian Mariano wrote:
>
> So what actually created the error? The code you posted has tons of
> warnings, but no error. Adding the BOSL2 include should not cause an
> invocation of circle() that worked before to stop working, so that's a bug
> that needs to be fixed.
>
> As you rightly guessed, the error was in line 414 where the circle had a
> value of zero. As soon as I gave it a positive value, th eprogram worked.
> It worked with the zero when there was no include <BOSL2/std.scad>. The
> “include” is legitimate and necessary. It just doesn’t like circles with a
> zero radius.
>
> Another comment: in OpenSCAD, "warnings" are really errors and typically
> indicate that your code is bad or broken. I recommend writing code that
> produces zero warnings and running with the "stop on first warning" feature
> (Preferences->Advanced) enabled to prevent huge cascading lists of warning
> messages.
>
> My codes do tend to generate rather a lot of warnings, but they work
> anyway - usually. If there is a genuine problem, it can be a little
> difficult to find amongst all that. It’s a bit like the child crying wolf.
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
M
mikeonenine@web.de
Sun, Jul 13, 2025 10:03 PM
, it appears that you must be using an older
version of BOSL2, because circle(0) works fine for me with BOSL2.
It was an older version. I installed the latest version only last night to get “texture”. It might be possible to use “rough” to get a surface like that of a casting. But that’s another subject.
In any other programming language, the things that are "warnings" in
OpenSCAD would be fatal errors. It's bad programming to write code that
generates warnings.
It did cross my mind to clean up the code and if it had been just a snippet I would have. It’s a good thing that OpenSCAD is so resilient to “fatal errors”.
Yes, you can do this and write code that works, but
I'm suggesting that you avoid doing that, especially if you plan to share
your code.
I’m watching out for any interest, but this is probably not the best place to share code. Also, I stop at virtual models while others print their models. What would I do with a plastic engine?
Adrian Mariano wrote:
> , it appears that you must be using an older
> version of BOSL2, because circle(0) works fine for me with BOSL2.
It was an older version. I installed the latest version only last night to get “texture”. It might be possible to use “rough” to get a surface like that of a casting. But that’s another subject.
> In any other programming language, the things that are "warnings" in
> OpenSCAD would be fatal errors. It's bad programming to write code that
> generates warnings.
It did cross my mind to clean up the code and if it had been just a snippet I would have. It’s a good thing that OpenSCAD is so resilient to “fatal errors”.
> Yes, you can do this and write code that works, but
> I'm suggesting that you avoid doing that, especially if you plan to share
> your code.
I’m watching out for any interest, but this is probably not the best place to share code. Also, I stop at virtual models while others print their models. What would I do with a plastic engine?
JB
Jordan Brown
Sun, Jul 13, 2025 11:26 PM
On 7/13/2025 12:21 PM, Caddiy via Discuss wrote:
BTW the number of frames has to be set to 180 for the gears to rotate
correctly. FPS very low to avoid missed frames.
OpenSCAD never misses frames. If it can't generate frames fast enough
for the specified FPS, then it just generates them slower. It always
generates the specified number of frames.
This is important when you save the frames as images and then feed them
into a converter to produce a video file, where the viewer can
maintain the desired frame rate.
On 7/13/2025 12:21 PM, Caddiy via Discuss wrote:
>
> BTW the number of frames has to be set to 180 for the gears to rotate
> correctly. FPS very low to avoid missed frames.
>
OpenSCAD never misses frames. If it can't generate frames fast enough
for the specified FPS, then it just generates them slower. It always
generates the specified number of frames.
This is important when you save the frames as images and then feed them
into a converter to produce a video file, where the viewer *can*
maintain the desired frame rate.
M
mikeonenine@web.de
Mon, Jul 14, 2025 12:25 AM
On 7/13/2025 12:21 PM, Caddiy via Discuss wrote:
BTW the number of frames has to be set to 180 for the gears to rotate
correctly. FPS very low to avoid missed frames.
OpenSCAD never misses frames.
My experience is that OpenScad can miss frames. Or it’s my computer. There is then a jump in the video when the converter works normally, or the converter finishes in an unusually short time and there is no video at all. With complex models, I set the FPS to 1 to avoid having to start all over again if it goes wrong.
Jordan Brown wrote:
> On 7/13/2025 12:21 PM, Caddiy via Discuss wrote:
>
> > BTW the number of frames has to be set to 180 for the gears to rotate
> > correctly. FPS very low to avoid missed frames.
>
> OpenSCAD never misses frames.
My experience is that OpenScad can miss frames. Or it’s my computer. There is then a jump in the video when the converter works normally, or the converter finishes in an unusually short time and there is no video at all. With complex models, I set the FPS to 1 to avoid having to start all over again if it goes wrong.