M
mikeonenine@web.de
Sun, Nov 24, 2024 8:58 PM
Just in case anyone in the programming and 3D printing fraternity should get the urge to produce a technical drawing, yes, it can be done with OpenSCAD!
And it can be animated too!
R=30;
n=25;
t=2.5;
// Pseudo-involute gear
module pigear(num, radii)
{
function r(a) = (floor(a/ 10) % 2) ? 10:8;
polygon([
for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])
[r*cos(a), r*sin(a)]
]);
}
module gear()
{
pigear(n*6, [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t]);
}
rotate([0, 0, -$t*360/5])
{
// Gear
color("black")
offset(+0.3)
gear();
translate([0, 0, 0.1])
color([1.3, 1.3, 1.13])
offset(-0.3)
gear();
// Shaft (cross-section)
translate([0, 0, 5.1])
{
color("black")
offset(0.3)
circle(12);
translate([0, 0, 0.1])
color([1.3, 1.3, 1.13])
difference()
{
offset(-0.3)
circle(12);
rotate([0, 0, 45])
for (i=[-15:3:15])
translate([0, i])
square([30, 0.4], center=true);
}}}
Just in case anyone in the programming and 3D printing fraternity should get the urge to produce a technical drawing, yes, it can be done with OpenSCAD!
And it can be animated too!
`R=30;`
`n=25;`
`t=2.5;`
`// Pseudo-involute gear`
`module pigear(num, radii) `
`{`
`function r(a) = (floor(a/ 10) % 2) ? 10:8;`
`polygon([`
`for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)]) `
`[r*cos(a), r*sin(a)]`
`]);`
`}`
`module gear()`
`{`
`pigear(n*6, [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t]);`
`}`
`rotate([0, 0, -$t*360/5])`
`{`
`// Gear`
`color("black")`
`offset(+0.3)`
`gear();`
`translate([0, 0, 0.1])`
`color([1.3, 1.3, 1.13])`
`offset(-0.3)`
`gear();`
`// Shaft (cross-section)`
`translate([0, 0, 5.1])`
`{`
`color("black")`
`offset(0.3)`
`circle(12);`
`translate([0, 0, 0.1])`
`color([1.3, 1.3, 1.13])`
`difference()`
`{`
`offset(-0.3)`
`circle(12);`
`rotate([0, 0, 45])`
`for (i=[-15:3:15])`
`translate([0, i])`
`square([30, 0.4], center=true);`
`}}}`
JB
Jon Bondy
Sun, Nov 24, 2024 9:19 PM
From my perspective, a technical drawing would include dimensions.
That said, your animation is very nice
Jon
On 11/24/2024 3:58 PM, Caddiy via Discuss wrote:
Just in case anyone in the programming and 3D printing fraternity
should get the urge to produce a technical drawing, yes, it can be
done with OpenSCAD!
And it can be animated too!
|R=30;|
|n=25;|
|t=2.5;|
|// Pseudo-involute gear|
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
From my perspective, a technical drawing would include dimensions.
That said, your animation is very nice
Jon
On 11/24/2024 3:58 PM, Caddiy via Discuss wrote:
>
> Just in case anyone in the programming and 3D printing fraternity
> should get the urge to produce a technical drawing, yes, it can be
> done with OpenSCAD!
>
> And it can be animated too!
>
> |R=30;|
>
> |n=25;|
>
> |t=2.5;|
>
> |// Pseudo-involute gear|
>
--
This email has been checked for viruses by AVG antivirus software.
www.avg.com
JB
Jordan Brown
Sun, Nov 24, 2024 9:28 PM
On 11/24/2024 1:19 PM, Jon Bondy via Discuss wrote:
From my perspective, a technical drawing would include dimensions.
That said, your animation is very nice.
Drawing dimension lines and labeling them is not very hard. The problem
is in figuring out where the endpoints go.
(And then as your drawings get complex it gets harder to keep the
dimension lines from interfering with one another.)
When I needed to, I've drawn dimension lines, with results like so:
But there it is easy to know where the endpoints are.
On 11/24/2024 1:19 PM, Jon Bondy via Discuss wrote:
>
> From my perspective, a technical drawing would include dimensions.
> That said, your animation is very nice.
>
Drawing dimension lines and labeling them is not very hard. The problem
is in figuring out where the endpoints go.
(And then as your drawings get complex it gets harder to keep the
dimension lines from interfering with one another.)
When I needed to, I've drawn dimension lines, with results like so:
But there it is easy to know where the endpoints are.
JD
John David
Mon, Nov 25, 2024 5:27 PM
@Jon Bondy, I was about to say the same thing, and then got to thinking
that having not only the dimensions on the drawing, but also a line showing
the rotation speed as the gear is turning would be cool. Probably useless,
but cool non the less ;-)
On Sun, Nov 24, 2024 at 4:29 PM Jordan Brown via Discuss <
discuss@lists.openscad.org> wrote:
On 11/24/2024 1:19 PM, Jon Bondy via Discuss wrote:
From my perspective, a technical drawing would include dimensions. That
said, your animation is very nice.
Drawing dimension lines and labeling them is not very hard. The problem
is in figuring out where the endpoints go.
(And then as your drawings get complex it gets harder to keep the
dimension lines from interfering with one another.)
When I needed to, I've drawn dimension lines, with results like so:
But there it is easy to know where the endpoints are.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
@Jon Bondy, I was about to say the same thing, and then got to thinking
that having not only the dimensions on the drawing, but also a line showing
the rotation speed as the gear is turning would be cool. Probably useless,
but cool non the less ;-)
On Sun, Nov 24, 2024 at 4:29 PM Jordan Brown via Discuss <
discuss@lists.openscad.org> wrote:
> On 11/24/2024 1:19 PM, Jon Bondy via Discuss wrote:
>
> From my perspective, a technical drawing would include dimensions. That
> said, your animation is very nice.
>
>
> Drawing dimension lines and labeling them is not very hard. The problem
> is in figuring out where the endpoints go.
>
> (And then as your drawings get complex it gets harder to keep the
> dimension lines from interfering with one another.)
>
> When I needed to, I've drawn dimension lines, with results like so:
>
>
> But there it is easy to know where the endpoints are.
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
M
mikeonenine@web.de
Mon, Nov 25, 2024 9:28 PM
a line showing the rotation speed as the gear is turning would be cool.
There are lines in the middle that show the rotation speed.
John David wrote:
> a line showing the rotation speed as the gear is turning would be cool.
There are lines in the middle that show the rotation speed.
> Probably useless,
Definitely useless.
M
mikeonenine@web.de
Tue, Nov 26, 2024 12:36 AM
It would have been neater to produce the gear with one module instead of two. I tried combining them in various ways, but don’t get that higher programming stuff. If you get just one comma wrong, it doesn’t work.
It must be possible. Can someone tell me how?
R=30;
n=25;
t=2.5;
// Pseudo-involute gear
module pigear(num, radii)
{
function r(a) = (floor(a/ 10) % 2) ? 10:8;
polygon([
for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])
[r*cos(a), r*sin(a)]
]);
}
module gear()
{
pigear(n*6, [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t]);
}
gear();
It would have been neater to produce the gear with one module instead of two. I tried combining them in various ways, but don’t get that higher programming stuff. If you get just one comma wrong, it doesn’t work.
It must be possible. Can someone tell me how?
`R=30;`
`n=25;`
`t=2.5;`
`// Pseudo-involute gear`
`module pigear(num, radii)`
`{`
`function r(a) = (floor(a/ 10) % 2) ? 10:8;`
`polygon([`
`for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])`
`[r*cos(a), r*sin(a)]`
`]);`
`}`
`module gear()`
`{`
`pigear(n*6, [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t]);`
`}`
`gear();`
JB
Jordan Brown
Tue, Nov 26, 2024 12:59 AM
On 11/25/2024 4:36 PM, Caddiy via Discuss wrote:
It would have been neater to produce the gear with one module instead
of two. I tried combining them in various ways, but don’t get that
higher programming stuff. If you get just one comma wrong, it doesn’t
work.
It must be possible. Can someone tell me how?
|R=30;|
|n=25;|
|t=2.5;|
|// Pseudo-involute gear|
|module pigear(num, radii)|
|{|
|function r(a) = (floor(a/ 10) % 2) ? 10:8;|
|polygon([|
|for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])|
|[rcos(a), rsin(a)]|
|]);|
|}|
|module gear()|
|{|
|pigear(n6, [0.99R-t,0.99R+0.10t,0.99R+t,
0.99R+t,0.99R+0.10t,0.99*R-t]);|
|}|
|gear();|
I'm not quite sure what you're asking. That program seems to work fine.
Or are you asking how to modify it so that there's only one module?
Sure, just move the parameters to being assignments. But note that you
lose the ability to have callers define different gears. You can
still modify the gear using the Customizer, but cannot (for instance)
make it have a different tooth profile.
R=30;
n=25;
t=2.5;
// Pseudo-involute gear
module gear()
{
num = n*6;
radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
function r(a) = (floor(a/ 10) % 2) ? 10:8;
polygon([
for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])
[r*cos(a), r*sin(a)]
]);
}
gear();
By the way: maybe num should be set to n * len(radii), so that it
automatically picks up the number of points in the tooth profile.
On 11/25/2024 4:36 PM, Caddiy via Discuss wrote:
>
> It would have been neater to produce the gear with one module instead
> of two. I tried combining them in various ways, but don’t get that
> higher programming stuff. If you get just one comma wrong, it doesn’t
> work.
>
> It must be possible. Can someone tell me how?
>
> |R=30;|
>
> |n=25;|
>
> |t=2.5;|
>
> |// Pseudo-involute gear|
>
> |module pigear(num, radii)|
>
> |{|
>
> |function r(a) = (floor(a/ 10) % 2) ? 10:8;|
>
> |polygon([|
>
> |for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])|
>
> |[r*cos(a), r*sin(a)]|
>
> |]);|
>
> |}|
>
> |module gear()|
>
> |{|
>
> |pigear(n*6, [0.99*R-t,0.99*R+0.10*t,0.99*R+t,
> 0.99*R+t,0.99*R+0.10*t,0.99*R-t]);|
>
> |}|
>
> |gear();|
>
I'm not quite sure what you're asking. That program seems to work fine.
Or are you asking how to modify it so that there's only one module?
Sure, just move the parameters to being assignments. But note that you
lose the ability to have callers define *different* gears. You can
still modify the gear using the Customizer, but cannot (for instance)
make it have a different tooth profile.
R=30;
n=25;
t=2.5;
// Pseudo-involute gear
module gear()
{
num = n*6;
radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
function r(a) = (floor(a/ 10) % 2) ? 10:8;
polygon([
for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])
[r*cos(a), r*sin(a)]
]);
}
gear();
By the way: maybe num should be set to n * len(radii), so that it
automatically picks up the number of points in the tooth profile.
M
mikeonenine@web.de
Tue, Nov 26, 2024 2:42 AM
I'm not quite sure what you're asking. That program seems to work fine.
Or are you asking how to modify it so that there's only one module?
Yes, the program works fine, but it is a bit untidy having two parts.
By the way: maybe num should be set to n * len(radii), so that it
automatically picks up the number of points in the tooth profile.
You mean in line 3 of the code? I tried that, but it didn’t work. But that doesn’t matter as 6 points for each tooth is fine for my purposes. You have to look closely to see that the profile is not involute.
I am not (yet?) into printing and preview is faster than with true involute gears out of BOSL2. Faster preview makes it easier to check the program repeatedly during development.
With your code, the parameters can also be put between the brackets in gear();
The program can now go in my stuff-I-always -use-library.
Thanx for your help.
Jordan Brown wrote:
> I'm not quite sure what you're asking. That program seems to work fine.
>
> Or are you asking how to modify it so that there's only one module?
Yes, the program works fine, but it is a bit untidy having two parts.
> By the way: maybe num should be set to n \* len(radii), so that it \
> automatically picks up the number of points in the tooth profile.
You mean in line 3 of the code? I tried that, but it didn’t work. But that doesn’t matter as 6 points for each tooth is fine for my purposes. You have to look closely to see that the profile is not involute.
I am not (yet?) into printing and preview is faster than with true involute gears out of BOSL2. Faster preview makes it easier to check the program repeatedly during development.
With your code, the parameters can also be put between the brackets in gear();
The program can now go in my stuff-I-always -use-library.
Thanx for your help.
JB
Jordan Brown
Tue, Nov 26, 2024 3:01 AM
On 11/25/2024 6:42 PM, Caddiy via Discuss wrote:
You mean in line 3 of the code? I tried that, but it didn’t work. But
that doesn’t matter as 6 points for each tooth is fine for my
purposes. You have to look closely to see that the profile is not
involute.
No, down inside the module, replacing the 6 with len(radii) and
rearranging so that radii is defined first:
module gear()
{
radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
num = n*len(radii);
...
With your code, the parameters can also be put between the brackets in
gear();
Huh? I don't immediately see how. Or, rather, you can make those be
the default values, yes. I moved the default radii out to be a global
like the default n.
R = 30;
n = 25;
t = 2.5;
radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
// Pseudo-involute gear
module gear(n=n, radii=radii)
{
num = n*len(radii);
function r(a) = (floor(a/ 10) % 2) ? 10:8;
polygon([
for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])
[r*cos(a), r*sin(a)]
]);
}
gear();
Allowing the user to pass either radii or R and/or t is a little
trickier and is left as an exercise for the reader. Hint: is_undef()
is your friend.
On 11/25/2024 6:42 PM, Caddiy via Discuss wrote:
>
> You mean in line 3 of the code? I tried that, but it didn’t work. But
> that doesn’t matter as 6 points for each tooth is fine for my
> purposes. You have to look closely to see that the profile is not
> involute.
>
No, down inside the module, replacing the 6 with len(radii) and
rearranging so that radii is defined first:
module gear()
{
radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
num = n*len(radii);
...
> With your code, the parameters can also be put between the brackets in
> gear();
>
Huh? I don't immediately see how. Or, rather, you can make those be
the default values, yes. I moved the default radii out to be a global
like the default n.
R = 30;
n = 25;
t = 2.5;
radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
// Pseudo-involute gear
module gear(n=n, radii=radii)
{
num = n*len(radii);
function r(a) = (floor(a/ 10) % 2) ? 10:8;
polygon([
for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])
[r*cos(a), r*sin(a)]
]);
}
gear();
Allowing the user to pass either radii or R and/or t is a little
trickier and is left as an exercise for the reader. Hint: is_undef()
is your friend.
M
mikeonenine@web.de
Tue, Nov 26, 2024 3:37 AM
On 11/25/2024 6:42 PM, Caddiy via Discuss wrote:
You mean in line 3 of the code? I tried that, but it didn’t work. But
that doesn’t matter as 6 points for each tooth is fine for my
purposes. You have to look closely to see that the profile is not
involute.
No, down inside the module, replacing the 6 with len(radii) and
rearranging so that radii is defined first:
module gear()
{
radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
num = n*len(radii);
...
With your code, the parameters can also be put between the brackets in
gear();
Huh? I don't immediately see how. Or, rather, you can make those be
the default values, yes. I moved the default radii out to be a global
like the default n.
R = 30;
n = 25;
t = 2.5;
radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
// Pseudo-involute gear
module gear(n=n, radii=radii)
{
num = n*len(radii);
function r(a) = (floor(a/ 10) % 2) ? 10:8;
polygon([
for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])
[r*cos(a), r*sin(a)]
]);
}
gear();
Allowing the user to pass either radii or R and/or t is a little
trickier and is left as an exercise for the reader. Hint: is_undef()
is your friend.
Need to get an early start in the morning. Will be back later.
Jordan Brown wrote:
> On 11/25/2024 6:42 PM, Caddiy via Discuss wrote:
>
> > You mean in line 3 of the code? I tried that, but it didn’t work. But
> > that doesn’t matter as 6 points for each tooth is fine for my
> > purposes. You have to look closely to see that the profile is not
> > involute.
>
> No, down inside the module, replacing the 6 with len(radii) and
> rearranging so that radii is defined first:
>
> ```
> module gear()
> {
> radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
> num = n*len(radii);
> ...
> ```
>
> > With your code, the parameters can also be put between the brackets in
> > gear();
>
> Huh? I don't immediately see how. Or, rather, you can make those be
> the default values, yes. I moved the default radii out to be a global
> like the default n.
>
> ```
> R = 30;
> n = 25;
> t = 2.5;
> radii = [0.99*R-t,0.99*R+0.10*t,0.99*R+t, 0.99*R+t,0.99*R+0.10*t,0.99*R-t];
>
> // Pseudo-involute gear
>
> module gear(n=n, radii=radii)
> {
> num = n*len(radii);
> function r(a) = (floor(a/ 10) % 2) ? 10:8;
> polygon([
> for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])
> [r*cos(a), r*sin(a)]
> ]);
> }
>
> gear();
> ```
>
> Allowing the user to pass either radii or R and/or t is a little
> trickier and is left as an exercise for the reader. Hint: is_undef()
> is your friend.
Need to get an early start in the morning. Will be back later.