discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

What am I missing here?

J
jon
Sun, Dec 31, 2023 7:15 PM

This seems dead simple, but the translate() call produces this error
message:

WARNING: Unable to convert translate([undef, undef, 0]) parameter to a
vec3 or vec2 of numbers in file , line 4

I cannot fathom how "r1" is "undefined"

module External(r1, r2, r3, r4) {
    linear_extrude(4)
        hull() {
            translate([r1, r1, 0]) circle(r = r1);
            circle(r = r2);
            circle(r = r2);
            circle(r = r4);
            }
    }
External();

This seems dead simple, but the translate() call produces this error message: WARNING: Unable to convert translate([undef, undef, 0]) parameter to a vec3 or vec2 of numbers in file , line 4 I cannot fathom how "r1" is "undefined" module External(r1, r2, r3, r4) {     linear_extrude(4)         hull() {             translate([r1, r1, 0]) circle(r = r1);             circle(r = r2);             circle(r = r2);             circle(r = r4);             }     } External();
TP
Torsten Paul
Sun, Dec 31, 2023 7:18 PM

On 31.12.23 20:15, jon via Discuss wrote:

External();  ^^^^^^^^^^^

Nothing given as value to r1 and it has no default.

ciao,
Torsten.

On 31.12.23 20:15, jon via Discuss wrote: > External(); ^^^^^^^^^^^ Nothing given as value to r1 and it has no default. ciao, Torsten.
L
larry
Sun, Dec 31, 2023 7:26 PM

On Sun, 2023-12-31 at 14:15 -0500, jon via Discuss wrote:

This seems dead simple, but the translate() call produces this error
message:
WARNING: Unable to convert translate([undef, undef, 0]) parameter to
a vec3 or vec2 of numbers in file , line 4
I cannot fathom how "r1" is "undefined"

In all likelihood, it's because it has not been defined.
'undef' means that it has not been assigned a value.

You must either define it outside the model or call it using values in
all 4 positiions.

ie. External(1,2,3,4);

BTW, all but the first circle will be centred on 0,0.

 module External(r1, r2, r3, r4) {
     linear_extrude(4)
         hull() {
             translate([r1, r1, 0]) circle(r = r1);
             circle(r = r2);
             circle(r = r2);
             circle(r = r4);
             }
     }
 External();
 


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

On Sun, 2023-12-31 at 14:15 -0500, jon via Discuss wrote: > This seems dead simple, but the translate() call produces this error > message: > WARNING: Unable to convert translate([undef, undef, 0]) parameter to > a vec3 or vec2 of numbers in file , line 4 > I cannot fathom how "r1" is "undefined" In all likelihood, it's because it has not been defined. 'undef' means that it has not been assigned a value. You must either define it outside the model or call it using values in all 4 positiions. ie. External(1,2,3,4); BTW, all but the first circle will be centred on 0,0. >  module External(r1, r2, r3, r4) { >      linear_extrude(4) >          hull() { >              translate([r1, r1, 0]) circle(r = r1); >              circle(r = r2); >              circle(r = r2); >              circle(r = r4); >              } >      } >  External(); >   > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
J
jon
Sun, Dec 31, 2023 7:28 PM

I knew I was doing something stupid; I just did not know what.

Thank you

Jon

On 12/31/2023 2:18 PM, Torsten Paul via Discuss wrote:

On 31.12.23 20:15, jon via Discuss wrote:

External();   ^^^^^^^^^^^

Nothing given as value to r1 and it has no default.

ciao,
  Torsten.


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

I knew I was doing something stupid; I just did not know what. Thank you Jon On 12/31/2023 2:18 PM, Torsten Paul via Discuss wrote: > On 31.12.23 20:15, jon via Discuss wrote: >> External();   ^^^^^^^^^^^ > > Nothing given as value to r1 and it has no default. > > ciao, >   Torsten. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org