If you want to do a set of sun and planet gears, you might want a carrier for the planets. This code gives polygons with convex or concave sides as well as some wierd stuff, if you like that sort of thing.
$fn=100;
n=4; // number of sides
module squircle()
{
polygon([
for(i = [0:2:360])
[R*r*sin(i)+r*cos((n-1)*i), R*r*cos(i)+r*sin((n-1)*i)],
]);
}
module carr()
offset(-6)
offset(6)
difference()
{
union()
{
rotate([0, 0, 22.5])
offset(-6)
difference()
{
squircle(R=6.1, r=11.2);
squircle(R=14.3, r=2.5);
}
for (i=[0:90:270])
rotate([0, 0, i])
translate([60, 0])
circle(d+5);
}
for (i=[0:90:270])
rotate([0, 0, i])
translate([60, 0])
circle(d);
}
module carrier()
rotate([0,0,90-$t*360])
translate([0,e,0])
rotate([0,0,-90+$t*360])
{
difference()
{
linear_extrude(10, center=true, convexity=3)
carr(d=9);
translate([0, 0, 3.1])
linear_extrude(4, center=true)
offset(2)
offset(-5)
carr(d=11);
translate([0, 0, -3.1])
linear_extrude(4, center=true)
offset(2)
offset(-5)
carr(d=11);
}}
rotate([0,0,$t*90])
carrier();
Have fun adjusting the parameters!
But I’m not quite sure if it is possible to animate sun and planet gears. Has anyone done it?
Nice model.
Huh. I didn't know that formal parameter specifications were optional.
module x() { echo(a); }
x(a=5);
works, to my surprise.
But still you might want to add the formal parameters (R, r for
squircle() and d for carr()). to avoid the warning messages.
You have an undefined variable "e" used in the translate in carrier().
Jordan Brown wrote:
Nice model.
Huh. I didn't know that formal parameter specifications were optional.
But still you might want to add the formal parameters (R, r for
squircle() and d for carr()). to avoid the warning messages.
Ah, so that’s what they are for. I never bothered with them in the past, as they didn’t seem to do anything, and ignored the error messages - if the code works, that’s good enough for me. But now I know where all the error messages come from!
You have an undefined variable "e" used in the translate in carrier().
Oh yes, thank you. That must have crept in from another project. In fact all 3 of those animation lines are superfluous. The animaton comes at the end, but should probably read rotate([0,0,$t*360/n]) for this particular application.
Insert rotate([0,0,75/n -14-n]) in the squircle module and the carrier always comes out with one corner at the top, whatever the number of sides - well, more or less. I derived that from a plot of rotation against number of sides, not by calculation from first principles.
BTW I like center=true. It’s very handy e.g. for cutouts: once you have worked out the correct depth on one side, the other side is the same but with the opposite sign (see code above). Should be possible to select it as the default value.
Many people run with "stop on first warning" which means if your program
produces any yellow warning messages, it won't work. I recommend not
distributing models that produce warnings. Also, without those formal
parameter specifications, another user can't tell how to use your code.
Has anybody animated sun and planet gears? Of course.
https://github.com/BelfrySCAD/BOSL2/wiki/gears.scad#functionmodule-spur_gear
See the spur gear module, section 8 above. Be warned that the gears code
is under development right now. It was found to be producing invalid
gears, and the fixes may not yet be entirely complete.
On Wed, Aug 2, 2023 at 1:36 AM mikeonenine@web.de wrote:
Jordan Brown wrote:
Nice model.
Huh. I didn't know that formal parameter specifications were optional.
But still you might want to add the formal parameters (R, r for squircle()
and d for carr()). to avoid the warning messages.
Ah, so that’s what they are for. I never bothered with them in the past,
as they didn’t seem to do anything, and ignored the error messages - if the
code works, that’s good enough for me. But now I know where all the error
messages come from!
You have an undefined variable "e" used in the translate in carrier().
Oh yes, thank you. That must have crept in from another project. In fact
all 3 of those animation lines are superfluous. The animaton comes at the
end, but should probably read rotate([0,0,$t*360/n]) for this particular
application.
Insert rotate([0,0,75/n -14-n]) in the squircle module and the carrier
always comes out with one corner at the top, whatever the number of sides -
well, more or less. I derived that from a plot of rotation against number
of sides, not by calculation from first principles.
BTW I like center=true. It’s very handy e.g. for cutouts: once you have
worked out the correct depth on one side, the other side is the same but
with the opposite sign (see code above). Should be possible to select it as
the default value.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On 8/2/23 01:37, mikeonenine@web.de wrote:
Jordan Brown wrote:
Nice model.
Huh. I didn't know that formal parameter specifications were optional.
But still you might want to add the formal parameters (R, r for
squircle() and d for carr()). to avoid the warning messages.
Ah, so that’s what they are for. I never bothered with them in the past,
as they didn’t seem to do anything, and ignored the error messages - if
the code works, that’s good enough for me. But now I know where all the
error messages come from!
You have an undefined variable "e" used in the translate in carrier().
Oh yes, thank you. That must have crept in from another project. In fact
all 3 of those animation lines are superfluous. The animaton comes at
the end, but should probably read rotate([0,0,$t*360/n]) for this
particular application.
Insert rotate([0,0,75/n -14-n]) in the squircle module and the carrier
always comes out with one corner at the top, whatever the number of
sides - well, more or less. I derived that from a plot of rotation
against number of sides, not by calculation from first principles.
BTW I like center=true. It’s very handy e.g. for cutouts: once you have
worked out the correct depth on one side, the other side is the same but
with the opposite sign (see code above). Should be possible to select it
as the default value.
+50 Since I discovered that a year+ back up the log, I have not written
a line of 3d code w/o it. center=true s/b the default. Unforch, it
would break at least half the code ever written. I'd settle for once at
the top of the file so its global in scope. Or does that work now? No.
"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 8/2/23 06:36, Adrian Mariano wrote:
Many people run with "stop on first warning" which means if your program
produces any yellow warning messages, it won't work. I recommend not
distributing models that produce warnings. Also, without those formal
parameter specifications, another user can't tell how to use your code.
Has anybody animated sun and planet gears? Of course.
https://github.com/BelfrySCAD/BOSL2/wiki/gears.scad#functionmodule-spur_gear https://github.com/BelfrySCAD/BOSL2/wiki/gears.scad#functionmodule-spur_gear
very very impressive Adrian. Thank you. But, I don't see any examples of
a buttress thread.
So I've hand edited a 6 point polygon, following 1 of the 4 variatons of
buttress threading. then 3d'd it, then used that as the tooth form
wrapped around a cylinder as the mandrel in a 2 start form making it
.45mm bigger to compensate for printer nozzle size as it then
difference()ed half its overall diameter with a cube to make the half
nuts. Render time is not speedy but still many times faster than the
printer, or my rebuilt 6040 mill carving the screw from a 22" long hard
maple 2x2. With a 1/16" round nosed SC tool, and no tool changer to do
the roughing cuts, its about 2 days a screw. And about 2 weeks per
screw to print the rest of it so its a ready to install on your
workbench product. So printer speed is the major time waster. I'm
currently mid project of making a B axis for a bigger mill to do the
roughing/rounding of that stick, which should put me up to three sticks
a day.
Could this 6 point 2d polygon be used by your library as a tooth form?
See the spur gear module, section 8 above. Be warned that the gears
code is under development right now. It was found to be producing
invalid gears, and the fixes may not yet be entirely complete.
On Wed, Aug 2, 2023 at 1:36 AM <mikeonenine@web.de
mailto:mikeonenine@web.de> wrote:
Jordan Brown wrote:
Nice model.
Huh. I didn't know that formal parameter specifications were
optional.
But still you might want to add the formal parameters (R, r for
squircle() and d for carr()). to avoid the warning messages.
Ah, so that’s what they are for. I never bothered with them in the
past, as they didn’t seem to do anything, and ignored the error
messages - if the code works, that’s good enough for me. But now I
know where all the error messages come from!
You have an undefined variable "e" used in the translate in
carrier().
Oh yes, thank you. That must have crept in from another project. In
fact all 3 of those animation lines are superfluous. The animaton
comes at the end, but should probably read rotate([0,0,$t*360/n])
for this particular application.
Insert rotate([0,0,75/n -14-n]) in the squircle module and the
carrier always comes out with one corner at the top, whatever the
number of sides - well, more or less. I derived that from a plot of
rotation against number of sides, not by calculation from first
principles.
BTW I like center=true. It’s very handy e.g. for cutouts: once you
have worked out the correct depth on one side, the other side is the
same but with the opposite sign (see code above). Should be possible
to select it as the default value.
_______________________________________________
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
"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 8/1/2023 10:36 PM, mikeonenine@web.de wrote:
Huh. I didn't know that formal parameter specifications were
optional.
But still you might want to add the formal parameters (R, r for
squircle() and d for carr()). to avoid the warning messages.
Ah, so that’s what they are for. I never bothered with them in the
past, as they didn’t seem to do anything, and ignored the error
messages - if the code works, that’s good enough for me. But now I
know where all the error messages come from!
In addition to the documentation aspect that Adrian mentions, declaring
the formal parameters, and warning when you supply an argument that
isn't declared, catches typos.
module foo(center) {
... do something with center ...
}
foo(centre=true);
Without the formal parameter and the associated warning, the error would
be silently ignored.
Also... ignoring warnings makes it much harder to notice the warnings
that you actually care about.
Yes, there's a good argument that center should be the default. There's
also good arguments against it. For better or worse, it can't be
changed now. (You could maybe imagine a $center that would supply the
default for subsequent calls, but you would then be unable to use any
existing library.)
However, it's easy enough to work around:
module ccube(size, center=true) {
cube(size=size, center=center);
}
I personally use a "justified cube" function jcube() that accepts a vec3
of justification values, justifying independently in each of the three
axes. -1 puts the cube on the negative side of the origin, 0 centers,
and +1 puts it on the positive side.
(I started to build a full set of justified functions, but it's
surprisingly unobvious how justified circles should work.)
Gene, not sure what's wrong with these buttress thread examples:
https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad#module-buttress_threaded_rod
If you want arbitrary threads you can build your own thread profile as a
point list and pass it to the generic threading code:
https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad#module-generic_threaded_rod
On Wed, Aug 2, 2023 at 1:07 PM gene heskett gheskett@shentel.net wrote:
On 8/2/23 06:36, Adrian Mariano wrote:
Many people run with "stop on first warning" which means if your program
produces any yellow warning messages, it won't work. I recommend not
distributing models that produce warnings. Also, without those formal
parameter specifications, another user can't tell how to use your code.
Has anybody animated sun and planet gears? Of course.
https://github.com/BelfrySCAD/BOSL2/wiki/gears.scad#functionmodule-spur_gear
<
https://github.com/BelfrySCAD/BOSL2/wiki/gears.scad#functionmodule-spur_gear
very very impressive Adrian. Thank you. But, I don't see any examples of
a buttress thread.
So I've hand edited a 6 point polygon, following 1 of the 4 variatons of
buttress threading. then 3d'd it, then used that as the tooth form
wrapped around a cylinder as the mandrel in a 2 start form making it
.45mm bigger to compensate for printer nozzle size as it then
difference()ed half its overall diameter with a cube to make the half
nuts. Render time is not speedy but still many times faster than the
printer, or my rebuilt 6040 mill carving the screw from a 22" long hard
maple 2x2. With a 1/16" round nosed SC tool, and no tool changer to do
the roughing cuts, its about 2 days a screw. And about 2 weeks per
screw to print the rest of it so its a ready to install on your
workbench product. So printer speed is the major time waster. I'm
currently mid project of making a B axis for a bigger mill to do the
roughing/rounding of that stick, which should put me up to three sticks
a day.
Could this 6 point 2d polygon be used by your library as a tooth form?
See the spur gear module, section 8 above. Be warned that the gears
code is under development right now. It was found to be producing
invalid gears, and the fixes may not yet be entirely complete.
On Wed, Aug 2, 2023 at 1:36 AM <mikeonenine@web.de
mailto:mikeonenine@web.de> wrote:
Jordan Brown wrote:
Nice model.
Huh. I didn't know that formal parameter specifications were
optional.
But still you might want to add the formal parameters (R, r for
squircle() and d for carr()). to avoid the warning messages.
Ah, so that’s what they are for. I never bothered with them in the
past, as they didn’t seem to do anything, and ignored the error
messages - if the code works, that’s good enough for me. But now I
know where all the error messages come from!
You have an undefined variable "e" used in the translate in
carrier().
Oh yes, thank you. That must have crept in from another project. In
fact all 3 of those animation lines are superfluous. The animaton
comes at the end, but should probably read rotate([0,0,$t*360/n])
for this particular application.
Insert rotate([0,0,75/n -14-n]) in the squircle module and the
carrier always comes out with one corner at the top, whatever the
number of sides - well, more or less. I derived that from a plot of
rotation against number of sides, not by calculation from first
principles.
BTW I like center=true. It’s very handy e.g. for cutouts: once you
have worked out the correct depth on one side, the other side is the
same but with the opposite sign (see code above). Should be possible
to select it as the default value.
_______________________________________________
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
"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
On 8/2/23 15:59, Adrian Mariano wrote:
Gene, not sure what's wrong with these buttress thread examples:
https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad#module-buttress_threaded_rod https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad#module-buttress_threaded_rod
TBT, nothing once I'd read the docs. And I had no idea BOSL2 could do that.
Obviously I'd have to learn how to use it but all the vars are there. My
version uses the 7 degree face on the load face and cheats a wee bit on
the rest because of the available tool shape. The 7 degree load face
encourages the self centering aspect, evening the load per sq on the
thread, and tool shape is 1/16" rn tool with .25" LOC. I get the 7
degrees from a tapered pad under the spindle motor, so my polygon is
indeed flat faced.
Bookmarked FFR, I'll have to check it out, thank you very much Adrian.
What I have now is so close I'm using the shrinkage factor in Cura to
fine tune the plastic so all 14 engaged teeth carry the load. Equ to
speccing the pitch to about 5 or 6 places right of the decimal point.
If you want arbitrary threads you can build your own thread profile as a
point list and pass it to the generic threading code:
https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad#module-generic_threaded_rod https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad#module-generic_threaded_rod
"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.
Jordan Brown wrote:
However, it's easy enough to work around:
module ccube(size, center=true) {
cube(size=size, center=center);
}
Yes, that will be useful. It works for cubes with different side lengths in square brackets too:
module ccube(size, center=true)
{
cube(size=size, center=center);
}
ccube([20, 30, 40]);
What is a vec3 of justification values? A "translate([x,y,z])" in the module, where x, y and z are 0 or the negative side length?