Hello OpenSCAD,
The text shows if I use Echo and it shows if quoted, but not if I reference it as Text[i]
So it doesn't know that is a string?
Thank you;
// Planer Info
// Bob Roos
// December 6, 2021
Size = 10;
Space = 12;
H = 90;
T = 3;
W = 90;
Text = [
["Max Width -- 15in "],
["Max Thickness -- 6in "],
["Min Length -- 6in "],
["Min Thickness -- 3/16in "],
["1 turn = 2mm -- recommended 1/2 turn per pass" ],
["Vary use of sides and middle to spread wear"],
["NO plywood, particle board, endgrain, mesquite"]
];
for (i = [0:len(Text)-1]){
// echo(Text[i]);
translate([0,i*Space,0]) linear_extrude(T) text(Text[i],size=Size);
}
linear_extrude(T) text(size=10,"Text[1]");
--
Best regards,
Bob mailto:roosbob@wybatap.com
Hi Bob,
Yes, it did not know that was a string until you tell it:
str(Text[i])
Thanks
Monday, December 6, 2021, 10:26:55 PM, you wrote:
Hello OpenSCAD,
The text shows if I use Echo and it shows if quoted, but not if I reference it as Text[i]
So it doesn't know that is a string?
Thank you;
// Planer Info
// Bob Roos
// December 6, 2021
Size = 10;
Space = 12;
H = 90;
T = 3;
W = 90;
Text = [
["Max Width -- 15in "],
["Max Thickness -- 6in "],
["Min Length -- 6in "],
["Min Thickness -- 3/16in "],
["1 turn = 2mm -- recommended 1/2 turn per pass" ],
["Vary use of sides and middle to spread wear"],
["NO plywood, particle board, endgrain, mesquite"]
];
for (i = [0:len(Text)-1]){
// echo(Text[i]);
translate([0,i*Space,0]) linear_extrude(T) text(Text[i],size=Size);
}
linear_extrude(T) text(size=10,"Text[1]");
--
have Fun,
Bob mailto:roosbob@wybatap.com
Your Text is a vector, with 7 elements, each element is a vector of length 1, containing the
string.
[ // start outside vector
["string1"], // a vector containing a string
"string2" // just a string
] // end of outside vector
You probably want a vector of strings, like so:
Text = [
"Max Width -- 15in ",
"Max Thickness -- 6in ",
"Min Length -- 6in ",
"Min Thickness -- 3/16in ],
"1 turn = 2mm -- recommended 1/2 turn per pass",
"Vary use of sides and middle to spread wear",
"NO plywood, particle board, endgrain, mesquite"
];
When, with your original Text vector of vectors, str(Text[i]) returns
a vector of length one containing a string, not the '[' & ']' in the output,
that is str() formatting the text to represent a vector.
-----Original Message-----
From: Bob Roos [mailto:roosbob@wybatap.com]
Sent: Tue, 7 Dec 2021 14:33
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: Why doesn't my text show up?
Hi Bob,
Yes, it did not know that was a string until you tell it:
str(Text[i])
Thanks
Monday, December 6, 2021, 10:26:55 PM, you wrote:
Hello OpenSCAD,
The text shows if I use Echo and it shows if quoted, but not if I reference it as
Text[i]
So it doesn't know that is a string?
Thank you;
// Planer Info
// Bob Roos
// December 6, 2021
Size = 10;
Space = 12;
H = 90;
T = 3;
W = 90;
Text = [
["Max Width -- 15in "],
["Max Thickness -- 6in "],
["Min Length -- 6in "],
["Min Thickness -- 3/16in "],
["1 turn = 2mm -- recommended 1/2 turn per pass" ],
["Vary use of sides and middle to spread wear"],
["NO plywood, particle board, endgrain, mesquite"]
];
for (i = [0:len(Text)-1]){
// echo(Text[i]);
translate([0,i*Space,0]) linear_extrude(T) text(Text[i],size=Size);
}
linear_extrude(T) text(size=10,"Text[1]");
--
have Fun,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG.
https://www.avg.com
Sorry, badly phrased, make that
When, with your original Text vector of vectors, Text[i] returns
a vector of length one containing a string, then str() formats that
vector into a string, note the '[' & ']' in the output,
that is str() formatting it to represent a vector.
With str("string") it would not have '[' & ']'.
-----Original Message-----
From: MichaelAtOz [mailto:oz.at.michael@gmail.com]
Sent: Tue, 7 Dec 2021 16:23
To: 'OpenSCAD general discussion'
Subject: [OpenSCAD] Re: Why doesn't my text show up?
Your Text is a vector, with 7 elements, each element is a vector of length 1, containing
the
string.
[ // start outside vector
["string1"], // a vector containing a string
"string2" // just a string
] // end of outside vector
You probably want a vector of strings, like so:
Text = [
"Max Width -- 15in ",
"Max Thickness -- 6in ",
"Min Length -- 6in ",
"Min Thickness -- 3/16in ],
"1 turn = 2mm -- recommended 1/2 turn per pass",
"Vary use of sides and middle to spread wear",
"NO plywood, particle board, endgrain, mesquite"
];
When, with your original Text vector of vectors, str(Text[i]) returns
a vector of length one containing a string, not the '[' & ']' in the output,
that is str() formatting the text to represent a vector.
-----Original Message-----
From: Bob Roos [mailto:roosbob@wybatap.com]
Sent: Tue, 7 Dec 2021 14:33
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: Why doesn't my text show up?
Hi Bob,
Yes, it did not know that was a string until you tell it:
str(Text[i])
Thanks
Monday, December 6, 2021, 10:26:55 PM, you wrote:
Hello OpenSCAD,
The text shows if I use Echo and it shows if quoted, but not if I reference it as
Text[i]
So it doesn't know that is a string?
Thank you;
// Planer Info
// Bob Roos
// December 6, 2021
Size = 10;
Space = 12;
H = 90;
T = 3;
W = 90;
Text = [
["Max Width -- 15in "],
["Max Thickness -- 6in "],
["Min Length -- 6in "],
["Min Thickness -- 3/16in "],
["1 turn = 2mm -- recommended 1/2 turn per pass" ],
["Vary use of sides and middle to spread wear"],
["NO plywood, particle board, endgrain, mesquite"]
];
for (i = [0:len(Text)-1]){
// echo(Text[i]);
translate([0,i*Space,0]) linear_extrude(T) text(Text[i],size=Size);
}
linear_extrude(T) text(size=10,"Text[1]");
--
have Fun,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Hi Michael,
Yes, Thank you. I learned the hard way when I could finally see my text on image.
I love OpenSCAD and there is so much to learn!
One problem is that I keep putting semicolons at the end of lines in y other programming language. ;)
Bob
Tuesday, December 7, 2021, 12:34:25 AM, you wrote:
Sorry, badly phrased, make that
When, with your original Text vector of vectors, Text[i] returns
a vector of length one containing a string, then str() formats that
vector into a string, note the '[' & ']' in the output,
that is str() formatting it to represent a vector.
With str("string") it would not have '[' & ']'.
-----Original Message-----
From: MichaelAtOz [mailto:oz.at.michael@gmail.com]
Sent: Tue, 7 Dec 2021 16:23
To: 'OpenSCAD general discussion'
Subject: [OpenSCAD] Re: Why doesn't my text show up?
Your Text is a vector, with 7 elements, each element is a vector of length 1, containing
the
string.
[ // start outside vector
["string1"], // a vector containing a string
"string2" // just a string
] // end of outside vector
You probably want a vector of strings, like so:
Text = [
"Max Width -- 15in ",
"Max Thickness -- 6in ",
"Min Length -- 6in ",
"Min Thickness -- 3/16in ],
"1 turn = 2mm -- recommended 1/2 turn per pass",
"Vary use of sides and middle to spread wear",
"NO plywood, particle board, endgrain, mesquite"
];
When, with your original Text vector of vectors, str(Text[i]) returns
a vector of length one containing a string, not the '[' & ']' in the output,
that is str() formatting the text to represent a vector.
-----Original Message-----
From: Bob Roos [mailto:roosbob@wybatap.com]
Sent: Tue, 7 Dec 2021 14:33
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: Why doesn't my text show up?
Hi Bob,
Yes, it did not know that was a string until you tell it:
str(Text[i])
Thanks
Monday, December 6, 2021, 10:26:55 PM, you wrote:
Hello OpenSCAD,
The text shows if I use Echo and it shows if quoted, but not if I reference it as
Text[i]
So it doesn't know that is a string?
Thank you;
// Planer Info
// Bob Roos
// December 6, 2021
Size = 10;
Space = 12;
H = 90;
T = 3;
W = 90;
Text = [
["Max Width -- 15in "],
["Max Thickness -- 6in "],
["Min Length -- 6in "],
["Min Thickness -- 3/16in "],
["1 turn = 2mm -- recommended 1/2 turn per pass" ],
["Vary use of sides and middle to spread wear"],
["NO plywood, particle board, endgrain, mesquite"]
];
for (i = [0:len(Text)-1]){
// echo(Text[i]);
translate([0,i*Space,0]) linear_extrude(T) text(Text[i],size=Size);
}
linear_extrude(T) text(size=10,"Text[1]");
--
have Fun,
Bob mailto:roosbob@wybatap.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
This email has been checked for viruses by AVG.
https://www.avg.com
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Virus-free. www.avg.com
--
have Fun,
Bob mailto:roosbob@wybatap.com