M
mikeonenine@web.de
Mon, Feb 9, 2026 3:39 PM
As I understand it, you can always define a parameter list with default
values. Is this a module that you wrote, or one that you want to use
from another author?
That sounds interesting. Do the parameters have to be given default values individually, or can it be done globally for a whole code? Tell me more.
Most of the modules are my own, the one given above was kindly written 3-4 years ago by someone on this forum/mailing list. Regrettably, I forget who it was.
Jon Bondy wrote:
> As I understand it, you can always define a parameter list with default
> values. Is this a module that you wrote, or one that you want to use
> from another author?
That sounds interesting. Do the parameters have to be given default values individually, or can it be done globally for a whole code? Tell me more.
Most of the modules are my own, the one given above was kindly written 3-4 years ago by someone on this forum/mailing list. Regrettably, I forget who it was.
JB
Jon Bondy
Mon, Feb 9, 2026 4:02 PM
Jon Bondy wrote:
As I understand it, you can always define a parameter list with
default values. Is this a module that you wrote, or one that you
want to use from another author?
That sounds interesting. Do the parameters have to be given default
values individually, or can it be done globally for a whole code? Tell
me more.
Most of the modules are my own, the one given above was kindly written
3-4 years ago by someone on this forum/mailing list. Regrettably, I
forget who it was.
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
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-Defined_Functions_and_Modules#Modules
On 2/9/2026 10:39 AM, Caddiy via Discuss wrote:
>
> Jon Bondy wrote:
>
> As I understand it, you can always define a parameter list with
> default values. Is this a module that you wrote, or one that you
> want to use from another author?
>
> That sounds interesting. Do the parameters have to be given default
> values individually, or can it be done globally for a whole code? Tell
> me more.
>
> Most of the modules are my own, the one given above was kindly written
> 3-4 years ago by someone on this forum/mailing list. Regrettably, I
> forget who it was.
>
>
> _______________________________________________
> 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
M
mikeonenine@web.de
Mon, Feb 9, 2026 4:42 PM
Jon Bondy wrote:
As I understand it, you can always define a parameter list with
default values. Is this a module that you wrote, or one that you
want to use from another author?
That sounds interesting. Do the parameters have to be given default
values individually, or can it be done globally for a whole code? Tell
me more.
Most of the modules are my own, the one given above was kindly written
3-4 years ago by someone on this forum/mailing list. Regrettably, I
forget who it was.
“Parameters can be assigned default values, to use in case they are omitted in the call. Parameter names are local and do not conflict with external variables of the same name.”
That’s nice to know!
Jon Bondy wrote:
> https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-Defined_Functions_and_Modules#Modules
>
> On 2/9/2026 10:39 AM, Caddiy via Discuss wrote:
>
> > Jon Bondy wrote:
> >
> > ```
> > As I understand it, you can always define a parameter list with
> > default values. Is this a module that you wrote, or one that you
> > want to use from another author?
> > ```
> >
> > That sounds interesting. Do the parameters have to be given default
> > values individually, or can it be done globally for a whole code? Tell
> > me more.
> >
> > Most of the modules are my own, the one given above was kindly written
> > 3-4 years ago by someone on this forum/mailing list. Regrettably, I
> > forget who it was.
“Parameters can be assigned default values, to use in case they are omitted in the call. Parameter names are local and do not conflict with external variables of the same name.”
That’s nice to know!
AM
Adrian Mariano
Mon, Feb 9, 2026 5:32 PM
An input of the wrong type like a radius of “hello” is garbage. There is no
wiggle room. This is not about what a person “sees” but about the meaning
of radius, which is a number not a vector or string or Boolean or function
literal.
Values like infinity, nan and negatives are also meaningless. Relying on
the program to do something other then producing and error for such inputs
is a mistake and you shouldn’t be surprised if your program stops working
if you do that. And openscad should not be constrained to continue its old
behavior for these inputs.
On Mon, Feb 9, 2026 at 09:44 Caddiy via Discuss discuss@lists.openscad.org
wrote:
Adrian Mariano wrote:
I would argue that if somebody is depending on garbage parameters doing
something useful that's their mistake and not our problem.
That sounds sensible, though what one person sees as garbage might in some
cases not be seen as such by another.
This possibility should not stand in the way of improving OpenSCAD's error
handling.
I would welcome that. I personally find it tedious entering stuff that is
zero, like X=0, Y=0, Z=0, and it clutters up the code, when an
undefined/absent parameter could simply be understood to be zero by
default. Would it be a big deal to implement that?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
An input of the wrong type like a radius of “hello” is garbage. There is no
wiggle room. This is not about what a person “sees” but about the meaning
of radius, which is a number not a vector or string or Boolean or function
literal.
Values like infinity, nan and negatives are also meaningless. Relying on
the program to do something other then producing and error for such inputs
is a mistake and you shouldn’t be surprised if your program stops working
if you do that. And openscad should not be constrained to continue its old
behavior for these inputs.
On Mon, Feb 9, 2026 at 09:44 Caddiy via Discuss <discuss@lists.openscad.org>
wrote:
> Adrian Mariano wrote:
>
> I would argue that if somebody is depending on garbage parameters doing
> something useful that's their mistake and not our problem.
>
> That sounds sensible, though what one person sees as garbage might in some
> cases not be seen as such by another.
>
> This possibility should not stand in the way of improving OpenSCAD's error
> handling.
>
> I would welcome that. I personally find it tedious entering stuff that is
> zero, like X=0, Y=0, Z=0, and it clutters up the code, when an
> undefined/absent parameter could simply be understood to be zero by
> default. Would it be a big deal to implement that?
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
M
mikeonenine@web.de
Mon, Feb 9, 2026 7:33 PM
An input of the wrong type like a radius of “hello” is garbage. There is no
wiggle room. This is not about what a person “sees” but about the meaning
of radius, which is a number not a vector or string or Boolean or function
literal.
Values like infinity, nan and negatives are also meaningless. Relying on
the program to do something other then producing and error for such inputs
is a mistake and you shouldn’t be surprised if your program stops working
if you do that. And openscad should not be constrained to continue its old
behavior for these inputs.
On Mon, Feb 9, 2026 at 09:44 Caddiy via Discuss discuss@lists.openscad.org
wrote:
Adrian Mariano wrote:
I would argue that if somebody is depending on garbage parameters doing
something useful that's their mistake and not our problem.
That sounds sensible, though what one person sees as garbage might in some
cases not be seen as such by another.
This possibility should not stand in the way of improving OpenSCAD's error
handling.
I would welcome that. I personally find it tedious entering stuff that is
zero, like X=0, Y=0, Z=0, and it clutters up the code, when an
undefined/absent parameter could simply be understood to be zero by
default. Would it be a big deal to implement that?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Garbage: Some things are obviously ridiculous, but I think there are other things that elicit disapproval but nevertheless produce the desired result without doing any harm.
Zero as default: That would be a great help. Unfortunately, as I have seen again and again elsewhere in IT literature, the OpenSCAD_User_Manual (many thanks to Jon Bondy above) says that it can be done (great!), but not how, which seems rather inadequate for something that calls itself a user manual. At least, that’s what I found, when I searched the page for “default”.
The question is also, at what level default zero could be specified - individual functions and modules (which could be fiddly), a whole script, or globally for everything in OpenSCAD.
But for starters, could someone please clue me up on how to apply default zero to functions and modules?
Adrian Mariano wrote:
> An input of the wrong type like a radius of “hello” is garbage. There is no
> wiggle room. This is not about what a person “sees” but about the meaning
> of radius, which is a number not a vector or string or Boolean or function
> literal.
>
> Values like infinity, nan and negatives are also meaningless. Relying on
> the program to do something other then producing and error for such inputs
> is a mistake and you shouldn’t be surprised if your program stops working
> if you do that. And openscad should not be constrained to continue its old
> behavior for these inputs.
>
> On Mon, Feb 9, 2026 at 09:44 Caddiy via Discuss [discuss@lists.openscad.org](mailto:discuss@lists.openscad.org)
> wrote:
>
> > Adrian Mariano wrote:
> >
> > I would argue that if somebody is depending on garbage parameters doing
> > something useful that's their mistake and not our problem.
> >
> > That sounds sensible, though what one person sees as garbage might in some
> > cases not be seen as such by another.
> >
> > This possibility should not stand in the way of improving OpenSCAD's error
> > handling.
> >
> > I would welcome that. I personally find it tedious entering stuff that is
> > zero, like X=0, Y=0, Z=0, and it clutters up the code, when an
> > undefined/absent parameter could simply be understood to be zero by
> > default. Would it be a big deal to implement that?
> >
> > ---
> >
> > OpenSCAD mailing list
> > To unsubscribe send an email to discuss-leave@lists.openscad.org
Garbage: Some things are obviously ridiculous, but I think there are other things that elicit disapproval but nevertheless produce the desired result without doing any harm.
Zero as default: That would be a great help. Unfortunately, as I have seen again and again elsewhere in IT literature, the [OpenSCAD_User_Manual](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-Defined_Functions_and_Modules#Modules) (many thanks to Jon Bondy above) says that it can be done (great!), but not how, which seems rather inadequate for something that calls itself a user manual. At least, that’s what I found, when I searched the page for “default”.
The question is also, at what level default zero could be specified - individual functions and modules (which could be fiddly), a whole script, or globally for everything in OpenSCAD.
But for starters, could someone please clue me up on how to apply default zero to functions and modules?
AM
Adrian Mariano
Mon, Feb 9, 2026 8:01 PM
In a formal system things don’t “elicit disapproval”. Things are either
valid or invalid. Making invalid inputs produce output other than an error
is a recipe for pain and confusion when you are trying to debug anything
nontrivial. The problem is that usually invalid input results from a
mistake. So plunging ahead means you hide the origin of the mistake.
You cannot change defaults in builtins or impose them on existing code
without changing the code. To make a module with a default do
module foo(x=0)
Then x has a zero default. You could make a new version of an existing
module with a wrapper that adds a default.
On Mon, Feb 9, 2026 at 14:34 Caddiy via Discuss discuss@lists.openscad.org
wrote:
Adrian Mariano wrote:
An input of the wrong type like a radius of “hello” is garbage. There is
no wiggle room. This is not about what a person “sees” but about the
meaning of radius, which is a number not a vector or string or Boolean or
function literal.
Values like infinity, nan and negatives are also meaningless. Relying on
the program to do something other then producing and error for such inputs
is a mistake and you shouldn’t be surprised if your program stops working
if you do that. And openscad should not be constrained to continue its old
behavior for these inputs.
On Mon, Feb 9, 2026 at 09:44 Caddiy via Discuss discuss@lists.openscad.org
wrote:
Adrian Mariano wrote:
I would argue that if somebody is depending on garbage parameters doing
something useful that's their mistake and not our problem.
That sounds sensible, though what one person sees as garbage might in some
cases not be seen as such by another.
This possibility should not stand in the way of improving OpenSCAD's error
handling.
I would welcome that. I personally find it tedious entering stuff that is
zero, like X=0, Y=0, Z=0, and it clutters up the code, when an
undefined/absent parameter could simply be understood to be zero by
default. Would it be a big deal to implement that?
OpenSCAD mailing list To unsubscribe send an email to
discuss-leave@lists.openscad.org
Garbage: Some things are obviously ridiculous, but I think there are other
things that elicit disapproval but nevertheless produce the desired result
without doing any harm.
Zero as default: That would be a great help. Unfortunately, as I have seen
again and again elsewhere in IT literature, the OpenSCAD_User_Manual
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-Defined_Functions_and_Modules#Modules
(many thanks to Jon Bondy above) says that it can be done (great!), but not
how, which seems rather inadequate for something that calls itself a user
manual. At least, that’s what I found, when I searched the page for
“default”.
The question is also, at what level default zero could be specified -
individual functions and modules (which could be fiddly), a whole script,
or globally for everything in OpenSCAD.
But for starters, could someone please clue me up on how to apply default
zero to functions and modules?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
In a formal system things don’t “elicit disapproval”. Things are either
valid or invalid. Making invalid inputs produce output other than an error
is a recipe for pain and confusion when you are trying to debug anything
nontrivial. The problem is that usually invalid input results from a
mistake. So plunging ahead means you hide the origin of the mistake.
You cannot change defaults in builtins or impose them on existing code
without changing the code. To make a module with a default do
module foo(x=0)
Then x has a zero default. You could make a new version of an existing
module with a wrapper that adds a default.
On Mon, Feb 9, 2026 at 14:34 Caddiy via Discuss <discuss@lists.openscad.org>
wrote:
> Adrian Mariano wrote:
>
> An input of the wrong type like a radius of “hello” is garbage. There is
> no wiggle room. This is not about what a person “sees” but about the
> meaning of radius, which is a number not a vector or string or Boolean or
> function literal.
>
> Values like infinity, nan and negatives are also meaningless. Relying on
> the program to do something other then producing and error for such inputs
> is a mistake and you shouldn’t be surprised if your program stops working
> if you do that. And openscad should not be constrained to continue its old
> behavior for these inputs.
>
> On Mon, Feb 9, 2026 at 09:44 Caddiy via Discuss discuss@lists.openscad.org
> wrote:
>
> Adrian Mariano wrote:
>
> I would argue that if somebody is depending on garbage parameters doing
> something useful that's their mistake and not our problem.
>
> That sounds sensible, though what one person sees as garbage might in some
> cases not be seen as such by another.
>
> This possibility should not stand in the way of improving OpenSCAD's error
> handling.
>
> I would welcome that. I personally find it tedious entering stuff that is
> zero, like X=0, Y=0, Z=0, and it clutters up the code, when an
> undefined/absent parameter could simply be understood to be zero by
> default. Would it be a big deal to implement that?
> ------------------------------
>
> OpenSCAD mailing list To unsubscribe send an email to
> discuss-leave@lists.openscad.org
>
> Garbage: Some things are obviously ridiculous, but I think there are other
> things that elicit disapproval but nevertheless produce the desired result
> without doing any harm.
>
> Zero as default: That would be a great help. Unfortunately, as I have seen
> again and again elsewhere in IT literature, the OpenSCAD_User_Manual
> <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-Defined_Functions_and_Modules#Modules>
> (many thanks to Jon Bondy above) says that it can be done (great!), but not
> how, which seems rather inadequate for something that calls itself a user
> manual. At least, that’s what I found, when I searched the page for
> “default”.
>
> The question is also, at what level default zero could be specified -
> individual functions and modules (which could be fiddly), a whole script,
> or globally for everything in OpenSCAD.
>
> But for starters, could someone please clue me up on how to apply default
> zero to functions and modules?
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jon Bondy
Mon, Feb 9, 2026 8:04 PM
Adrian Mariano wrote:
An input of the wrong type like a radius of “hello” is garbage.
There is no wiggle room. This is not about what a person “sees”
but about the meaning of radius, which is a number not a vector or
string or Boolean or function literal.
Values like infinity, nan and negatives are also meaningless.
Relying on the program to do something other then producing and
error for such inputs is a mistake and you shouldn’t be surprised
if your program stops working if you do that. And openscad should
not be constrained to continue its old behavior for these inputs.
On Mon, Feb 9, 2026 at 09:44 Caddiy via Discuss
discuss@lists.openscad.org wrote:
Adrian Mariano wrote:
I would argue that if somebody is depending on garbage
parameters doing something useful that's their mistake and not
our problem.
That sounds sensible, though what one person sees as garbage
might in some cases not be seen as such by another.
This possibility should not stand in the way of improving
OpenSCAD's error handling.
I would welcome that. I personally find it tedious entering
stuff that is zero, like X=0, Y=0, Z=0, and it clutters up the
code, when an undefined/absent parameter could simply be
understood to be zero by default. Would it be a big deal to
implement that?
------------------------------------------------------------------------
OpenSCAD mailing list To unsubscribe send an email to
discuss-leave@lists.openscad.org
Garbage: Some things are obviously ridiculous, but I think there are
other things that elicit disapproval but nevertheless produce the
desired result without doing any harm.
Zero as default: That would be a great help. Unfortunately, as I have
seen again and again elsewhere in IT literature, the
OpenSCAD_User_Manual
https://urldefense.proofpoint.com/v2/url?u=https-3A__en.wikibooks.org_wiki_OpenSCAD-5FUser-5FManual_User-2DDefined-5FFunctions-5Fand-5FModules-23Modules&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=_TgyW6QNLifXt4vyT0w6MKG2d1sgFeTwcIHwFjOB8EQgueQnD_-EBKiLTXXo-77p&s=x7bwggcrvWDXCZ5jOqqo7IXteD4n_RzJWd6S_8uYsXU&e=
(many thanks to Jon Bondy above) says that it can be done (great!),
but not how, which seems rather inadequate for something that calls
itself a user manual. At least, that’s what I found, when I searched
the page for “default”.
The question is also, at what level default zero could be specified -
individual functions and modules (which could be fiddly), a whole
script, or globally for everything in OpenSCAD.
But for starters, could someone please clue me up on how to apply
default zero to functions and modules?
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
Caddiy:
"the OpenSCAD_User_Manual
<https://urldefense.proofpoint.com/v2/url?u=https-3A__en.wikibooks.org_wiki_OpenSCAD-5FUser-5FManual_User-2DDefined-5FFunctions-5Fand-5FModules-23Modules&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=_TgyW6QNLifXt4vyT0w6MKG2d1sgFeTwcIHwFjOB8EQgueQnD_-EBKiLTXXo-77p&s=x7bwggcrvWDXCZ5jOqqo7IXteD4n_RzJWd6S_8uYsXU&e=>
(many thanks to Jon Bondy above) says that it can be done (great!), but
not how"
It says RIGHT THERE how to do the defaults, WITH EXAMPLES.
This is getting needlessly tedious.
Jon
On 2/9/2026 2:33 PM, Caddiy via Discuss wrote:
>
> Adrian Mariano wrote:
>
> An input of the wrong type like a radius of “hello” is garbage.
> There is no wiggle room. This is not about what a person “sees”
> but about the meaning of radius, which is a number not a vector or
> string or Boolean or function literal.
>
> Values like infinity, nan and negatives are also meaningless.
> Relying on the program to do something other then producing and
> error for such inputs is a mistake and you shouldn’t be surprised
> if your program stops working if you do that. And openscad should
> not be constrained to continue its old behavior for these inputs.
>
> On Mon, Feb 9, 2026 at 09:44 Caddiy via Discuss
> discuss@lists.openscad.org wrote:
>
> Adrian Mariano wrote:
>
> I would argue that if somebody is depending on garbage
> parameters doing something useful that's their mistake and not
> our problem.
>
> That sounds sensible, though what one person sees as garbage
> might in some cases not be seen as such by another.
>
> This possibility should not stand in the way of improving
> OpenSCAD's error handling.
>
> I would welcome that. I personally find it tedious entering
> stuff that is zero, like X=0, Y=0, Z=0, and it clutters up the
> code, when an undefined/absent parameter could simply be
> understood to be zero by default. Would it be a big deal to
> implement that?
>
> ------------------------------------------------------------------------
>
> OpenSCAD mailing list To unsubscribe send an email to
> discuss-leave@lists.openscad.org
>
> Garbage: Some things are obviously ridiculous, but I think there are
> other things that elicit disapproval but nevertheless produce the
> desired result without doing any harm.
>
> Zero as default: That would be a great help. Unfortunately, as I have
> seen again and again elsewhere in IT literature, the
> OpenSCAD_User_Manual
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__en.wikibooks.org_wiki_OpenSCAD-5FUser-5FManual_User-2DDefined-5FFunctions-5Fand-5FModules-23Modules&d=DwMFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=AsrE-c7ZR7B2Kyr3qgfvvppkCEBVsNmwEMndcrRSuOI&m=_TgyW6QNLifXt4vyT0w6MKG2d1sgFeTwcIHwFjOB8EQgueQnD_-EBKiLTXXo-77p&s=x7bwggcrvWDXCZ5jOqqo7IXteD4n_RzJWd6S_8uYsXU&e=>
> (many thanks to Jon Bondy above) says that it can be done (great!),
> but not how, which seems rather inadequate for something that calls
> itself a user manual. At least, that’s what I found, when I searched
> the page for “default”.
>
> The question is also, at what level default zero could be specified -
> individual functions and modules (which could be fiddly), a whole
> script, or globally for everything in OpenSCAD.
>
> But for starters, could someone please clue me up on how to apply
> default zero to functions and modules?
>
>
> _______________________________________________
> 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
M
mikeonenine@web.de
Mon, Feb 9, 2026 8:19 PM
This is getting needlessly tedious.
Jon Bondy wrote:
> This is getting needlessly tedious.
Yes, I agree.
M
mikeonenine@web.de
Mon, Feb 9, 2026 9:09 PM
You cannot change defaults in builtins or impose them on existing code
without changing the code. To make a module with a default do
module foo(x=0)
Then x has a zero default. You could make a new version of an existing
module with a wrapper that adds a default.
module foo(x=0) will greatly reduce the number of error messages I get - thanks.
Adrian Mariano wrote:
> You cannot change defaults in builtins or impose them on existing code
> without changing the code. To make a module with a default do
>
> module foo(x=0)
>
> Then x has a zero default. You could make a new version of an existing
> module with a wrapper that adds a default.
module foo(x=0) will greatly reduce the number of error messages I get - thanks.
AM
Adrian Mariano
Mon, Feb 9, 2026 9:31 PM
nop head, setting "check parameter range for builtin modules" checks the
range when you give a number but doesn't change the behavior when you give
entirely the wrong type. So a radius has to be positive and finite. You
get a not entirely clear warning if you're out of bounds:
WARNING: cylinder(r1=-0.1, r2=-0.1, ...) in file test3a.scad, line 2
<2,/home/adrian/scad/test3a.scad>
TRACE: called by 'cylinder' in file test3a.scad, line 2
<2,/home/adrian/scad/test3a.scad>
On Mon, Feb 9, 2026 at 9:17 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:
Also "check the parameter range for builtin modules" is an option in
preferences, so I would expect any garbage ones to be rejected when that
option is set.
On Mon, 9 Feb 2026 at 12:14, Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:
I agree with Adrian.
On 2/9/2026 6:17 AM, Adrian Mariano via Discuss wrote:
I would argue that if somebody is depending on garbage parameters doing
something useful that's their mistake and not our problem. This
possibility should not stand in the way of improving OpenSCAD's error
handling.
On Mon, Feb 9, 2026 at 2:12 AM Jordan Brown <
openscad@jordan.maileater.net> wrote:
On 2/8/2026 5:25 PM, Adrian Mariano via Discuss wrote:
Ideally any code that works without BOSL2 should work with it. But
there may be edge cases where this isn't working. If you give garbage
parameters to OpenSCAD modules it often gives a warning and then does
something anyway. (I think this is terrible behavior on the part of
OpenSCAD.
Sadly, there are a number of cases where you can give garbage parameters
and it doesn't give a warning, and then does something anyway.
cylinder(h="hello");
cube(10, center="hello");
The cube would be sort of OK if there was a general rule that boolean
arguments got the usual "if not empty/zero/false" behavior. But it
doesn't; the result is equivalent to omitting "center". I'm not at all
sure that such a rule would be a good idea; I'm not even sure that it's a
good idea for "if" and "?:".
Of course, for every such case there is somebody somewhere who is
depending on it, whose model will break if you make it yield a warning.
nop head, setting "check parameter range for builtin modules" checks the
range when you give a number but doesn't change the behavior when you give
entirely the wrong type. So a radius has to be positive and finite. You
get a not entirely clear warning if you're out of bounds:
WARNING: cylinder(r1=-0.1, r2=-0.1, ...) in file test3a.scad, line 2
<2,/home/adrian/scad/test3a.scad>
TRACE: called by 'cylinder' in file test3a.scad, line 2
<2,/home/adrian/scad/test3a.scad>
On Mon, Feb 9, 2026 at 9:17 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:
> Also "check the parameter range for builtin modules" is an option in
> preferences, so I would expect any garbage ones to be rejected when that
> option is set.
>
> On Mon, 9 Feb 2026 at 12:14, Jon Bondy via Discuss <
> discuss@lists.openscad.org> wrote:
>
>> I agree with Adrian.
>> On 2/9/2026 6:17 AM, Adrian Mariano via Discuss wrote:
>>
>> I would argue that if somebody is depending on garbage parameters doing
>> something useful that's their mistake and not our problem. This
>> possibility should not stand in the way of improving OpenSCAD's error
>> handling.
>>
>> On Mon, Feb 9, 2026 at 2:12 AM Jordan Brown <
>> openscad@jordan.maileater.net> wrote:
>>
>>> On 2/8/2026 5:25 PM, Adrian Mariano via Discuss wrote:
>>>
>>> Ideally any code that works without BOSL2 should work with it. But
>>> there may be edge cases where this isn't working. If you give garbage
>>> parameters to OpenSCAD modules it often gives a warning and then does
>>> something anyway. (I think this is terrible behavior on the part of
>>> OpenSCAD.
>>>
>>>
>>> Sadly, there are a number of cases where you can give garbage parameters
>>> and it *doesn't* give a warning, and then does something anyway.
>>>
>>> cylinder(h="hello");
>>>
>>> cube(10, center="hello");
>>>
>>> The cube would be sort of OK if there was a general rule that boolean
>>> arguments got the usual "if not empty/zero/false" behavior. But it
>>> doesn't; the result is equivalent to omitting "center". I'm not at all
>>> sure that such a rule would be a good idea; I'm not even sure that it's a
>>> good idea for "if" and "?:".
>>>
>>> Of course, for every such case there is somebody somewhere who is
>>> depending on it, whose model will break if you make it yield a warning.
>>>
>>>
>>>
>> _______________________________________________
>> 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_-6939774784482399376_m_-6038624002298776710_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>> _______________________________________________
>> 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