GH
gene heskett
Sat, Feb 18, 2023 1:02 AM
When I make nut for this screw, I have a routine that engraves some text
of a side of the nut the size being trimmed by a variable named diatrim.
So first I setup a var:
ver="TOOTH=V5.5 D=+diatrim";
then converted into text by:
module ver_txt(s,t)
{
linear_extrude(height=t)text(ver,font = "Liberation
Sans:style=Bold",size=s,halign="center" );
}; //places poor text on mating faces of nuts to indicate tooth version
and size of nut
and later its differenced by this:
translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
tooth ver(sion) & size trim
unfortunately, that gets me the var's name, diatrim, in the engraving
How do I get it to use the value of the var named diatrim as text?
Thanks all. Take care & stay well.
Cheers, Gene Heskett.
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
When I make nut for this screw, I have a routine that engraves some text
of a side of the nut the size being trimmed by a variable named diatrim.
So first I setup a var:
ver="TOOTH=V5.5 D=+diatrim";
then converted into text by:
module ver_txt(s,t)
{
linear_extrude(height=t)text(ver,font = "Liberation
Sans:style=Bold",size=s,halign="center" );
}; //places poor text on mating faces of nuts to indicate tooth version
and size of nut
and later its differenced by this:
translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
tooth ver(sion) & size trim
unfortunately, that gets me the var's name, diatrim, in the engraving
How do I get it to use the value of the var named diatrim as text?
Thanks all. Take care & stay well.
Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>
JB
Jordan Brown
Sat, Feb 18, 2023 1:19 AM
On 2/17/2023 5:02 PM, gene heskett wrote:
When I make nut for this screw, I have a routine that engraves some
text of a side of the nut the size being trimmed by a variable named
diatrim.
So first I setup a var:
ver="TOOTH=V5.5 D=+diatrim";
then converted into text by:
module ver_txt(s,t)
{
linear_extrude(height=t)text(ver,font = "Liberation
Sans:style=Bold",size=s,halign="center" );
}; //places poor text on mating faces of nuts to indicate tooth
version and size of nut
and later its differenced by this:
translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
tooth ver(sion) & size trim
unfortunately, that gets me the var's name, diatrim, in the engraving
I don't see a variable named "diatrim" anywhere in that - I see a string
that includes that word, but no variables.
How do I get it to use the value of the var named diatrim as text?
You probably want the str() function. It will do two things for you:
it will turn non-strings (like numbers) into strings, and it will
concatenate one string with another.
So for instance you might want
ver = "V5.5";
diatrim = 10;
label = str(ver, " ", diatrim);
linear_extrude(height=1) text(label);
to produce a label that said "V5.5 10".
Unfortunately, there is currently no way to control the formatting when
a number is converted into a string. You cannot, for instance, easily
make it be one digit after the decimal point.
On 2/17/2023 5:02 PM, gene heskett wrote:
> When I make nut for this screw, I have a routine that engraves some
> text of a side of the nut the size being trimmed by a variable named
> diatrim.
> So first I setup a var:
> ver="TOOTH=V5.5 D=+diatrim";
> then converted into text by:
>
> module ver_txt(s,t)
> {
> linear_extrude(height=t)text(ver,font = "Liberation
> Sans:style=Bold",size=s,halign="center" );
> }; //places poor text on mating faces of nuts to indicate tooth
> version and size of nut
>
>
> and later its differenced by this:
> translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
> tooth ver(sion) & size trim
>
> unfortunately, that gets me the var's name, diatrim, in the engraving
I don't see a variable named "diatrim" anywhere in that - I see a string
that includes that word, but no variables.
> How do I get it to use the value of the var named diatrim as text?
You probably want the str() function. It will do two things for you:
it will turn non-strings (like numbers) into strings, and it will
concatenate one string with another.
So for instance you might want
ver = "V5.5";
diatrim = 10;
label = str(ver, " ", diatrim);
linear_extrude(height=1) text(label);
to produce a label that said "V5.5 10".
Unfortunately, there is currently no way to control the formatting when
a number is converted into a string. You cannot, for instance, easily
make it be one digit after the decimal point.
GH
gene heskett
Sat, Feb 18, 2023 2:41 AM
On 2/17/23 20:20, Jordan Brown wrote:
On 2/17/2023 5:02 PM, gene heskett wrote:
When I make nut for this screw, I have a routine that engraves some
text of a side of the nut the size being trimmed by a variable named
diatrim.
So first I setup a var:
ver="TOOTH=V5.5 D=+diatrim";
then converted into text by:
module ver_txt(s,t)
{
linear_extrude(height=t)text(ver,font = "Liberation
Sans:style=Bold",size=s,halign="center" );
}; //places poor text on mating faces of nuts to indicate tooth
version and size of nut
and later its differenced by this:
translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
tooth ver(sion) & size trim
unfortunately, that gets me the var's name, diatrim, in the engraving
I don't see a variable named "diatrim" anywhere in that - I see a string
that includes that word, but no variables.
How do I get it to use the value of the var named diatrim as text?
You probably want the str() function. It will do two things for you:
it will turn non-strings (like numbers) into strings, and it will
concatenate one string with another.
So for instance you might want
ver = "V5.5";
diatrim = 10;
label = str(ver, " ", diatrim);
linear_extrude(height=1) text(label);
to produce a label that said "V5.5 10".
Unfortunately, there is currently no way to control the formatting when
a number is converted into a string. You cannot, for instance, easily
make it be one digit after the decimal point.
The str dumps the rest to /dev/null on finding the decimal point?
Maybe there is a good reason for it but IMO it should continue till it
finds the terminator char.
if it can be made into two pieces, each only one char.
Or even using the echo(diatrim) return as it makes a proper string out
of a number even if its an f.p number. It will never be more than 2
digits with a . between them
something like text=echo(diatrim); ??
Thanks Jordan. Take care & stay well.
Cheers, Gene Heskett.
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
On 2/17/23 20:20, Jordan Brown wrote:
> On 2/17/2023 5:02 PM, gene heskett wrote:
>> When I make nut for this screw, I have a routine that engraves some
>> text of a side of the nut the size being trimmed by a variable named
>> diatrim.
>> So first I setup a var:
>> ver="TOOTH=V5.5 D=+diatrim";
>> then converted into text by:
>>
>> module ver_txt(s,t)
>> {
>> linear_extrude(height=t)text(ver,font = "Liberation
>> Sans:style=Bold",size=s,halign="center" );
>> }; //places poor text on mating faces of nuts to indicate tooth
>> version and size of nut
>>
>>
>> and later its differenced by this:
>> translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
>> tooth ver(sion) & size trim
>>
>> unfortunately, that gets me the var's name, diatrim, in the engraving
>
> I don't see a variable named "diatrim" anywhere in that - I see a string
> that includes that word, but no variables.
>
>> How do I get it to use the value of the var named diatrim as text?
>
> You probably want the str() function. It will do two things for you:
> it will turn non-strings (like numbers) into strings, and it will
> concatenate one string with another.
>
> So for instance you might want
>
> ver = "V5.5";
> diatrim = 10;
> label = str(ver, " ", diatrim);
> linear_extrude(height=1) text(label);
>
> to produce a label that said "V5.5 10".
>
> Unfortunately, there is currently no way to control the formatting when
> a number is converted into a string. You cannot, for instance, easily
> make it be one digit after the decimal point.
>
The str dumps the rest to /dev/null on finding the decimal point?
Maybe there is a good reason for it but IMO it should continue till it
finds the terminator char.
if it can be made into two pieces, each only one char.
Or even using the echo(diatrim) return as it makes a proper string out
of a number even if its an f.p number. It will never be more than 2
digits with a . between them
something like text=echo(diatrim); ??
Thanks Jordan. Take care & stay well.
Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>
FH
Father Horton
Sat, Feb 18, 2023 2:50 AM
echo() always returns undef.
On Fri, Feb 17, 2023 at 8:41 PM gene heskett gheskett@shentel.net wrote:
On 2/17/23 20:20, Jordan Brown wrote:
On 2/17/2023 5:02 PM, gene heskett wrote:
When I make nut for this screw, I have a routine that engraves some
text of a side of the nut the size being trimmed by a variable named
diatrim.
So first I setup a var:
ver="TOOTH=V5.5 D=+diatrim";
then converted into text by:
module ver_txt(s,t)
{
linear_extrude(height=t)text(ver,font = "Liberation
Sans:style=Bold",size=s,halign="center" );
}; //places poor text on mating faces of nuts to indicate tooth
version and size of nut
and later its differenced by this:
translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
tooth ver(sion) & size trim
unfortunately, that gets me the var's name, diatrim, in the engraving
I don't see a variable named "diatrim" anywhere in that - I see a string
that includes that word, but no variables.
How do I get it to use the value of the var named diatrim as text?
You probably want the str() function. It will do two things for you:
it will turn non-strings (like numbers) into strings, and it will
concatenate one string with another.
So for instance you might want
ver = "V5.5";
diatrim = 10;
label = str(ver, " ", diatrim);
linear_extrude(height=1) text(label);
to produce a label that said "V5.5 10".
Unfortunately, there is currently no way to control the formatting when
a number is converted into a string. You cannot, for instance, easily
make it be one digit after the decimal point.
The str dumps the rest to /dev/null on finding the decimal point?
Maybe there is a good reason for it but IMO it should continue till it
finds the terminator char.
if it can be made into two pieces, each only one char.
Or even using the echo(diatrim) return as it makes a proper string out
of a number even if its an f.p number. It will never be more than 2
digits with a . between them
something like text=echo(diatrim); ??
Thanks Jordan. Take care & stay well.
Cheers, Gene Heskett.
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
echo() always returns undef.
On Fri, Feb 17, 2023 at 8:41 PM gene heskett <gheskett@shentel.net> wrote:
> On 2/17/23 20:20, Jordan Brown wrote:
> > On 2/17/2023 5:02 PM, gene heskett wrote:
> >> When I make nut for this screw, I have a routine that engraves some
> >> text of a side of the nut the size being trimmed by a variable named
> >> diatrim.
> >> So first I setup a var:
> >> ver="TOOTH=V5.5 D=+diatrim";
> >> then converted into text by:
> >>
> >> module ver_txt(s,t)
> >> {
> >> linear_extrude(height=t)text(ver,font = "Liberation
> >> Sans:style=Bold",size=s,halign="center" );
> >> }; //places poor text on mating faces of nuts to indicate tooth
> >> version and size of nut
> >>
> >>
> >> and later its differenced by this:
> >> translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
> >> tooth ver(sion) & size trim
> >>
> >> unfortunately, that gets me the var's name, diatrim, in the engraving
> >
> > I don't see a variable named "diatrim" anywhere in that - I see a string
> > that includes that word, but no variables.
> >
> >> How do I get it to use the value of the var named diatrim as text?
> >
> > You probably want the str() function. It will do two things for you:
> > it will turn non-strings (like numbers) into strings, and it will
> > concatenate one string with another.
> >
> > So for instance you might want
> >
> > ver = "V5.5";
> > diatrim = 10;
> > label = str(ver, " ", diatrim);
> > linear_extrude(height=1) text(label);
> >
> > to produce a label that said "V5.5 10".
> >
> > Unfortunately, there is currently no way to control the formatting when
> > a number is converted into a string. You cannot, for instance, easily
> > make it be one digit after the decimal point.
> >
> The str dumps the rest to /dev/null on finding the decimal point?
>
> Maybe there is a good reason for it but IMO it should continue till it
> finds the terminator char.
>
> if it can be made into two pieces, each only one char.
> Or even using the echo(diatrim) return as it makes a proper string out
> of a number even if its an f.p number. It will never be more than 2
> digits with a . between them
> something like text=echo(diatrim); ??
>
> Thanks Jordan. Take care & stay well.
>
> Cheers, Gene Heskett.
> --
> "There are four boxes to be used in defense of liberty:
> soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author, 1940)
> If we desire respect for the law, we must first make the law respectable.
> - Louis D. Brandeis
> Genes Web page <http://geneslinuxbox.net:6309/>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
GH
gene heskett
Sat, Feb 18, 2023 3:52 AM
On 2/17/23 21:51, Father Horton wrote:
echo() always returns undef.
So I found, insert descriptive expletive string.
But I did get it, had to play with ver_text() rather heavily. which
slows things boringly as it takes around 3 minutes to render this, per
retry. With the latest AppImage yet. See attached. It complex as all
get out as it right renders the bolt to the selected size, then diffs it
from the pivoting block that is a half nut. LARGE woodworkers bench vise
screw. No one has made any new ones in 100+ years and no one has ever
made one with buttress threads. Screw is nominally 50mm in diameter and
about 500mm long. Carved on my customized 6040 milling machine from a
2x2x23" stick of hard maple. I wrote that g-code too.
Now I'm going to make 2 of these in white PETG and see if its the right
size for any of the screws I've already made. I feel a lot better about
making changes to fit the screw when I only have one place to edit to
make the size change globally. This size did fit the last 3 screws I made.
One other question I should ask. I bought a couple rolls of ABS, would
that be a better material than PETG? I chose it because you can pick up
a pop bobble from the roadside ditch that's been there for 40 years, and
its still a good bottle. But I see a lot of stuff being made from ABS.
Comments on the relative long life of each welcome.
Thanks again for a great bit to software I can understand.
Cheers, Gene Heskett.
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
On 2/17/23 21:51, Father Horton wrote:
> echo() always returns undef.
So I found, insert descriptive expletive string.
But I did get it, had to play with ver_text() rather heavily. which
slows things boringly as it takes around 3 minutes to render this, per
retry. With the latest AppImage yet. See attached. It complex as all
get out as it right renders the bolt to the selected size, then diffs it
from the pivoting block that is a half nut. LARGE woodworkers bench vise
screw. No one has made any new ones in 100+ years and no one has ever
made one with buttress threads. Screw is nominally 50mm in diameter and
about 500mm long. Carved on my customized 6040 milling machine from a
2x2x23" stick of hard maple. I wrote that g-code too.
Now I'm going to make 2 of these in white PETG and see if its the right
size for any of the screws I've already made. I feel a lot better about
making changes to fit the screw when I only have one place to edit to
make the size change globally. This size did fit the last 3 screws I made.
One other question I should ask. I bought a couple rolls of ABS, would
that be a better material than PETG? I chose it because you can pick up
a pop bobble from the roadside ditch that's been there for 40 years, and
its still a good bottle. But I see a lot of stuff being made from ABS.
Comments on the relative long life of each welcome.
Thanks again for a great bit to software I can understand.
Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>
AM
Adrian Mariano
Sat, Feb 18, 2023 4:32 AM
No, echo() returns whatever expression you give it: its syntax (as a
function) is "echo(text) expression". If you don't give it an expression
then it will return undef...because you didn't give it anything!
So for example:
a = echo("hello")3;
assigns 3 to a. If you did a=echo("hello")sin(17); then a would be the
sine of 17.
There is code in BOSL2 to do controlled formatting of numbers to text
strings, if anybody is looking for that.
On Fri, Feb 17, 2023 at 9:51 PM Father Horton fatherhorton@gmail.com
wrote:
echo() always returns undef.
On Fri, Feb 17, 2023 at 8:41 PM gene heskett gheskett@shentel.net wrote:
On 2/17/23 20:20, Jordan Brown wrote:
On 2/17/2023 5:02 PM, gene heskett wrote:
When I make nut for this screw, I have a routine that engraves some
text of a side of the nut the size being trimmed by a variable named
diatrim.
So first I setup a var:
ver="TOOTH=V5.5 D=+diatrim";
then converted into text by:
module ver_txt(s,t)
{
linear_extrude(height=t)text(ver,font = "Liberation
Sans:style=Bold",size=s,halign="center" );
}; //places poor text on mating faces of nuts to indicate tooth
version and size of nut
and later its differenced by this:
translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
tooth ver(sion) & size trim
unfortunately, that gets me the var's name, diatrim, in the engraving
I don't see a variable named "diatrim" anywhere in that - I see a
that includes that word, but no variables.
How do I get it to use the value of the var named diatrim as text?
You probably want the str() function. It will do two things for you:
it will turn non-strings (like numbers) into strings, and it will
concatenate one string with another.
So for instance you might want
ver = "V5.5";
diatrim = 10;
label = str(ver, " ", diatrim);
linear_extrude(height=1) text(label);
to produce a label that said "V5.5 10".
Unfortunately, there is currently no way to control the formatting when
a number is converted into a string. You cannot, for instance, easily
make it be one digit after the decimal point.
The str dumps the rest to /dev/null on finding the decimal point?
Maybe there is a good reason for it but IMO it should continue till it
finds the terminator char.
if it can be made into two pieces, each only one char.
Or even using the echo(diatrim) return as it makes a proper string out
of a number even if its an f.p number. It will never be more than 2
digits with a . between them
something like text=echo(diatrim); ??
Thanks Jordan. Take care & stay well.
Cheers, Gene Heskett.
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
No, echo() returns whatever expression you give it: its syntax (as a
function) is "echo(text) expression". If you don't give it an expression
*then* it will return undef...because you didn't give it anything!
So for example:
a = echo("hello")3;
assigns 3 to a. If you did a=echo("hello")sin(17); then a would be the
sine of 17.
There is code in BOSL2 to do controlled formatting of numbers to text
strings, if anybody is looking for that.
On Fri, Feb 17, 2023 at 9:51 PM Father Horton <fatherhorton@gmail.com>
wrote:
> echo() always returns undef.
>
> On Fri, Feb 17, 2023 at 8:41 PM gene heskett <gheskett@shentel.net> wrote:
>
>> On 2/17/23 20:20, Jordan Brown wrote:
>> > On 2/17/2023 5:02 PM, gene heskett wrote:
>> >> When I make nut for this screw, I have a routine that engraves some
>> >> text of a side of the nut the size being trimmed by a variable named
>> >> diatrim.
>> >> So first I setup a var:
>> >> ver="TOOTH=V5.5 D=+diatrim";
>> >> then converted into text by:
>> >>
>> >> module ver_txt(s,t)
>> >> {
>> >> linear_extrude(height=t)text(ver,font = "Liberation
>> >> Sans:style=Bold",size=s,halign="center" );
>> >> }; //places poor text on mating faces of nuts to indicate tooth
>> >> version and size of nut
>> >>
>> >>
>> >> and later its differenced by this:
>> >> translate([.96,29,25])rotate([0,90,180]) ver_txt(); // place text of
>> >> tooth ver(sion) & size trim
>> >>
>> >> unfortunately, that gets me the var's name, diatrim, in the engraving
>> >
>> > I don't see a variable named "diatrim" anywhere in that - I see a
>> string
>> > that includes that word, but no variables.
>> >
>> >> How do I get it to use the value of the var named diatrim as text?
>> >
>> > You probably want the str() function. It will do two things for you:
>> > it will turn non-strings (like numbers) into strings, and it will
>> > concatenate one string with another.
>> >
>> > So for instance you might want
>> >
>> > ver = "V5.5";
>> > diatrim = 10;
>> > label = str(ver, " ", diatrim);
>> > linear_extrude(height=1) text(label);
>> >
>> > to produce a label that said "V5.5 10".
>> >
>> > Unfortunately, there is currently no way to control the formatting when
>> > a number is converted into a string. You cannot, for instance, easily
>> > make it be one digit after the decimal point.
>> >
>> The str dumps the rest to /dev/null on finding the decimal point?
>>
>> Maybe there is a good reason for it but IMO it should continue till it
>> finds the terminator char.
>>
>> if it can be made into two pieces, each only one char.
>> Or even using the echo(diatrim) return as it makes a proper string out
>> of a number even if its an f.p number. It will never be more than 2
>> digits with a . between them
>> something like text=echo(diatrim); ??
>>
>> Thanks Jordan. Take care & stay well.
>>
>> Cheers, Gene Heskett.
>> --
>> "There are four boxes to be used in defense of liberty:
>> soap, ballot, jury, and ammo. Please use in that order."
>> -Ed Howdershelt (Author, 1940)
>> If we desire respect for the law, we must first make the law respectable.
>> - Louis D. Brandeis
>> Genes Web page <http://geneslinuxbox.net:6309/>
>> _______________________________________________
>> 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
>
GH
gene heskett
Sat, Feb 18, 2023 6:21 AM
On 2/17/23 23:33, Adrian Mariano wrote:
No, echo() returns whatever expression you give it: its syntax (as a
function) is "echo(text) expression". If you don't give it an
expression then it will return undef...because you didn't give it
anything!
So for example:
a = echo("hello")3;
assigns 3 to a. If you did a=echo("hello")sin(17); then a would be the
sine of 17.
There is code in BOSL2 to do controlled formatting of numbers to text
strings, if anybody is looking for that.
On Fri, Feb 17, 2023 at 9:51 PM Father Horton <fatherhorton@gmail.com
mailto:fatherhorton@gmail.com> wrote:
echo() always returns undef.
On Fri, Feb 17, 2023 at 8:41 PM gene heskett <gheskett@shentel.net
<mailto:gheskett@shentel.net>> wrote:
On 2/17/23 20:20, Jordan Brown wrote:
On 2/17/2023 5:02 PM, gene heskett wrote:
When I make nut for this screw, I have a routine that
text of a side of the nut the size being trimmed by a
diatrim.
So first I setup a var:
ver="TOOTH=V5.5 D=+diatrim";
then converted into text by:
module ver_txt(s,t)
{
linear_extrude(height=t)text(ver,font = "Liberation
Sans:style=Bold",size=s,halign="center" );
}; //places poor text on mating faces of nuts to indicate tooth
version and size of nut
and later its differenced by this:
translate([.96,29,25])rotate([0,90,180]) ver_txt(); //
tooth ver(sion) & size trim
unfortunately, that gets me the var's name, diatrim, in the
I don't see a variable named "diatrim" anywhere in that - I
that includes that word, but no variables.
My error in copy/paste, its 3 lines above the start of the paste. in the
form of:
diatrim=4.9; in this case.
How do I get it to use the value of the var named diatrim as
You probably want the str() function. It will do two things
it will turn non-strings (like numbers) into strings, and it
concatenate one string with another.
So for instance you might want
ver = "V5.5";
diatrim = 10;
label = str(ver, " ", diatrim);
linear_extrude(height=1) text(label);
to produce a label that said "V5.5 10".
Unfortunately, there is currently no way to control the
a number is converted into a string. You cannot, for
make it be one digit after the decimal point.
The str dumps the rest to /dev/null on finding the decimal point?
Maybe there is a good reason for it but IMO it should continue
till it
finds the terminator char.
if it can be made into two pieces, each only one char.
Or even using the echo(diatrim) return as it makes a proper
string out
of a number even if its an f.p number. It will never be more than 2
digits with a . between them
something like text=echo(diatrim); ??
Thanks Jordan. Take care & stay well.
What I actually had to do, was treat it as two separate linear_extrudes:
module ver_txt(s,t)
{
translate([-8,0,0])linear_extrude(height=t)text(ver,font =
"Liberation Sans:style=Bold",size=s,halign="center" );
translate([22,0,0])linear_extrude(height=t)text(tdia,font="Liberation
Sans:style=Bold",size=s,halign="center");
}; //places poor text on mating faces of nuts to indicate tooth version
and size of nut
Adding the translates in front of each to make it look like one single
printout. Is also old comment, not enough room there, so it was moved to
both sides. See the png I posted. This way, in the unlikely case of a
stripped/broken nut, the buyer can advise me of the text, and I can then
make another exact replacement. (If my printer is well calibrated.)
Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law
respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/
<http://geneslinuxbox.net:6309/>>
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
<mailto:discuss-leave@lists.openscad.org>
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
<mailto:discuss-leave@lists.openscad.org>
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Cheers, Gene Heskett.
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
On 2/17/23 23:33, Adrian Mariano wrote:
> No, echo() returns whatever expression you give it: its syntax (as a
> function) is "echo(text) expression". If you don't give it an
> expression *then* it will return undef...because you didn't give it
> anything!
>
> So for example:
>
> a = echo("hello")3;
>
> assigns 3 to a. If you did a=echo("hello")sin(17); then a would be the
> sine of 17.
>
> There is code in BOSL2 to do controlled formatting of numbers to text
> strings, if anybody is looking for that.
>
>
> On Fri, Feb 17, 2023 at 9:51 PM Father Horton <fatherhorton@gmail.com
> <mailto:fatherhorton@gmail.com>> wrote:
>
> echo() always returns undef.
>
> On Fri, Feb 17, 2023 at 8:41 PM gene heskett <gheskett@shentel.net
> <mailto:gheskett@shentel.net>> wrote:
>
> On 2/17/23 20:20, Jordan Brown wrote:
> > On 2/17/2023 5:02 PM, gene heskett wrote:
> >> When I make nut for this screw, I have a routine that
> engraves some
> >> text of a side of the nut the size being trimmed by a
> variable named
> >> diatrim.
> >> So first I setup a var:
> >> ver="TOOTH=V5.5 D=+diatrim";
> >> then converted into text by:
> >>
> >> module ver_txt(s,t)
> >> {
> >> linear_extrude(height=t)text(ver,font = "Liberation
> >> Sans:style=Bold",size=s,halign="center" );
> >> }; //places poor text on mating faces of nuts to indicate tooth
> >> version and size of nut
> >>
> >>
> >> and later its differenced by this:
> >> translate([.96,29,25])rotate([0,90,180]) ver_txt(); //
> place text of
> >> tooth ver(sion) & size trim
> >>
> >> unfortunately, that gets me the var's name, diatrim, in the
> engraving
> >
> > I don't see a variable named "diatrim" anywhere in that - I
> see a string
> > that includes that word, but no variables.
My error in copy/paste, its 3 lines above the start of the paste. in the
form of:
diatrim=4.9; in this case.
> >
> >> How do I get it to use the value of the var named diatrim as
> text?
> >
> > You probably want the str() function. It will do two things
> for you:
> > it will turn non-strings (like numbers) into strings, and it
> will
> > concatenate one string with another.
> >
> > So for instance you might want
> >
> > ver = "V5.5";
> > diatrim = 10;
> > label = str(ver, " ", diatrim);
> > linear_extrude(height=1) text(label);
> >
> > to produce a label that said "V5.5 10".
> >
> > Unfortunately, there is currently no way to control the
> formatting when
> > a number is converted into a string. You cannot, for
> instance, easily
> > make it be one digit after the decimal point.
> >
> The str dumps the rest to /dev/null on finding the decimal point?
>
> Maybe there is a good reason for it but IMO it should continue
> till it
> finds the terminator char.
>
> if it can be made into two pieces, each only one char.
> Or even using the echo(diatrim) return as it makes a proper
> string out
> of a number even if its an f.p number. It will never be more than 2
> digits with a . between them
> something like text=echo(diatrim); ??
>
> Thanks Jordan. Take care & stay well.
What I actually had to do, was treat it as two separate linear_extrudes:
module ver_txt(s,t)
{
translate([-8,0,0])linear_extrude(height=t)text(ver,font =
"Liberation Sans:style=Bold",size=s,halign="center" );
translate([22,0,0])linear_extrude(height=t)text(tdia,font="Liberation
Sans:style=Bold",size=s,halign="center");
}; //places poor text on mating faces of nuts to indicate tooth version
and size of nut
Adding the translates in front of each to make it look like one single
printout. Is also old comment, not enough room there, so it was moved to
both sides. See the png I posted. This way, in the unlikely case of a
stripped/broken nut, the buyer can advise me of the text, and I can then
make another exact replacement. (If my printer is well calibrated.)
>
> Cheers, Gene Heskett.
> --
> "There are four boxes to be used in defense of liberty:
> soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author, 1940)
> If we desire respect for the law, we must first make the law
> respectable.
> - Louis D. Brandeis
> Genes Web page <http://geneslinuxbox.net:6309/
> <http://geneslinuxbox.net:6309/>>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
> <mailto:discuss-leave@lists.openscad.org>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
> <mailto:discuss-leave@lists.openscad.org>
>
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>
RW
Raymond West
Sat, Feb 18, 2023 11:31 AM
On 18/02/2023 03:52, gene heskett wrote:
One other question I should ask. I bought a couple rolls of ABS, would
that be a better material than PETG? I chose it because you can pick
up a pop bobble from the roadside ditch that's been there for 40
years, and its still a good bottle. But I see a lot of stuff being
made from ABS.
Comments on the relative long life of each welcome.
On 18/02/2023 03:52, gene heskett wrote:
> One other question I should ask. I bought a couple rolls of ABS, would
> that be a better material than PETG? I chose it because you can pick
> up a pop bobble from the roadside ditch that's been there for 40
> years, and its still a good bottle. But I see a lot of stuff being
> made from ABS.
> Comments on the relative long life of each welcome.
A good comparison chart is at
https://www.simplify3d.com/resources/materials-guide/properties-table/
I prefer petg, easier to print than abs, warps less, and higher ultimate
strength.
NH
nop head
Sat, Feb 18, 2023 12:07 PM
I wish I could print PETG but it is too sticky, so when bridging the next
path rips up the previous one. Even small bridges over truncated teardrop
holes or sparse infill break up.
How does anybody get around that?
On Sat, 18 Feb 2023 at 11:31, Raymond West raywest@raywest.com wrote:
On 18/02/2023 03:52, gene heskett wrote:
One other question I should ask. I bought a couple rolls of ABS, would
that be a better material than PETG? I chose it because you can pick
up a pop bobble from the roadside ditch that's been there for 40
years, and its still a good bottle. But I see a lot of stuff being
made from ABS.
Comments on the relative long life of each welcome.
I wish I could print PETG but it is too sticky, so when bridging the next
path rips up the previous one. Even small bridges over truncated teardrop
holes or sparse infill break up.
How does anybody get around that?
On Sat, 18 Feb 2023 at 11:31, Raymond West <raywest@raywest.com> wrote:
>
> On 18/02/2023 03:52, gene heskett wrote:
> > One other question I should ask. I bought a couple rolls of ABS, would
> > that be a better material than PETG? I chose it because you can pick
> > up a pop bobble from the roadside ditch that's been there for 40
> > years, and its still a good bottle. But I see a lot of stuff being
> > made from ABS.
> > Comments on the relative long life of each welcome.
>
>
> A good comparison chart is at
> https://www.simplify3d.com/resources/materials-guide/properties-table/
>
> I prefer petg, easier to print than abs, warps less, and higher ultimate
> strength.
>
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
GH
gene heskett
Sat, Feb 18, 2023 12:20 PM
On 2/18/23 06:32, Raymond West wrote:
On 18/02/2023 03:52, gene heskett wrote:
One other question I should ask. I bought a couple rolls of ABS, would
that be a better material than PETG? I chose it because you can pick
up a pop bobble from the roadside ditch that's been there for 40
years, and its still a good bottle. But I see a lot of stuff being
made from ABS.
Comments on the relative long life of each welcome.
Very helpful. Since pla shatters so easily, I was surprised to see that
it was rated stronger, but that has sure not been my experience.
Bookmarked it this time, thanks Raymond.
They don't mention glass for beds, but some sort of painted glass is
exactly what I'm building on as its loose at room temps. Textured PEI is
a PITA, smooth needs a few scrubbings with comet or bkf to scratch it
up, but then it sticks too well. Ditto for plain glass, by the time
you've made a tooth in microscratches so it sticks hot, it takes glass
cookies with it when removing the cold part. If you get it to stick,
clean with 91% isa to remove greasy fingerprints & otherwise leave it be.
Cheers, Gene Heskett.
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
On 2/18/23 06:32, Raymond West wrote:
>
> On 18/02/2023 03:52, gene heskett wrote:
>> One other question I should ask. I bought a couple rolls of ABS, would
>> that be a better material than PETG? I chose it because you can pick
>> up a pop bobble from the roadside ditch that's been there for 40
>> years, and its still a good bottle. But I see a lot of stuff being
>> made from ABS.
>> Comments on the relative long life of each welcome.
>
>
> A good comparison chart is at
> https://www.simplify3d.com/resources/materials-guide/properties-table/
>
> I prefer petg, easier to print than abs, warps less, and higher ultimate
> strength.
>
Very helpful. Since pla shatters so easily, I was surprised to see that
it was rated stronger, but that has sure not been my experience.
Bookmarked it this time, thanks Raymond.
They don't mention glass for beds, but some sort of painted glass is
exactly what I'm building on as its loose at room temps. Textured PEI is
a PITA, smooth needs a few scrubbings with comet or bkf to scratch it
up, but then it sticks too well. Ditto for plain glass, by the time
you've made a tooth in microscratches so it sticks hot, it takes glass
cookies with it when removing the cold part. If you get it to stick,
clean with 91% isa to remove greasy fingerprints & otherwise leave it be.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
> .
Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>