Results 11 to 18 of 18
Thread: Printing Spheres
-
05-29-2015, 10:23 AM #11
couple of things that should make it easier.
You can use diameters instead of radii. This means that you don't have to mentally double the size of a sphere or cylinder every time you want one.
That and putting a module before you've defined it - make no sense to me :-)
I'm not a programmer, so a lot of the ways other people use openscad just strikes me as confusing and the wrong way round.
But that's the beauty of openscad - everyone can use it the way that makes sense to them.
Also for a rounder shape use a higher '$fn=' value.
I usually use the max: $fn-100;
Which gives you very round things. Takes a little longer to f6 render. But the models are better.
Another thing you can do is to use variables to create parametric objects.
$fn=100;
sd=10; //sphere diameter
wt=2; // thickness of sphere wall
hs=3; // hole size
difference() {
sphere(d=sd); //create sphere with diameter set by sd
sphere(d=sd-(2*wt)); //remove sphere from centre of original sphere - size defined by wt
translate([0,0,-sd/2])cylinder(d=hs,h=wt*4); // remove hole from bottom of sphere - diameter defined by hs
}
Also for printing you want the sphere to be hole down.
The other thing that I find essential is to put a lot of coments into a script.
// can be put anywhere to write a comment to explain what you've done. Otherwise you'll come back to a script and it won't make any sense at all :-)
I know the maths can probably be improved - but the above script does work :-)Last edited by curious aardvark; 05-29-2015 at 10:37 AM.
-
06-03-2015, 01:26 AM #12
- Join Date
- May 2015
- Posts
- 8
howdy folks,
sorry for the delay in responding. thank you for everyone's input.
thank you, curious aardvark, for your suggestions. i was about to post where i had gotten to when i saw your post and knew i should
rework my approach. using variables as you did makes it easier to enter the variables that one uses and receives from the formula.
also creating the sphere upside down. thanx...
there are two sphere types i am concerned with. one with just a sound hole and one with a hollow cylindrical neck as a sound hole.
here is the scad code for the first one, adapted with your help.
// Spherical Resonator
// The formula below can be entered into a
// calculator that can do expressions, like google,
// and the result will be the diameter of the sphere in meters.
// 17.87*((d/(f^2))^(1/3))
// Where:
// d= diameter of sound hole in meters
// f= frequency(Hz)
// Example: A 220Hz
// in millimeters
$fn=100;
sd=143.38; //sphere diameter
wt=2; // thickness of sphere wall
hs=25; // hole size
difference() {
sphere(d=sd); //create sphere with diameter set by sd
sphere(d=sd-(2*wt)); //remove sphere from centre of original sphere - size defined by wt
translate([0,0,-sd/2])cylinder(d=hs,h=wt*2); // remove hole from bottom of sphere - diameter defined by hs
}
// Spherical Resonator With Neck
// The formula below can be entered into any
// calculator that can do expressions, like google, and the
// result will be the diameter of the sphere in meters.
// ((3*(d^2)*(343.59^2))/(8*L*(f^2)*(3.14^2)))^(1/3)
// Where:
// d= diameter of sound hole in meters
// L= length of the neck in meters
// f= frequency(Hz)
// Example: A 220Hz
// in millimeters
//Sphere
difference() {
sphere(r=68.24, $fn=40);
sphere(r=66.24, $fn=40); // The radius of the second sphere is the target radius
cylinder(r=12.5, h=68.24, $fn=50); // The height of the cylinder is the radius of the first sphere
}
//Neck
difference() {
translate([0,0,66.24]) // Cylinders are translated the radius of the second sphere.
cylinder(r=14.5, h=25, $fn=50);
translate([0,0,66.24])
cylinder(r=12.5, h=25, $fn=50); // Second cylinder radius is the target radius.
}
$fn=100;
sd=132.48; //sphere diameter
wt=2; // thickness of sphere wall
hs=25; // hole size
ln=25; // length of neck
//Sphere
difference() {
sphere(d=sd); //create sphere with diameter set by sd
sphere(d=sd-(2*wt)); //remove sphere from centre of original sphere - size defined by wt
translate([0,0,-sd/2])cylinder(d=hs,h=wt*2); // remove hole from bottom of sphere - diameter defined by hs
}
//Neck
difference() {
translate([0,0,-sd/2])cylinder(d=hs+wt,h=ln);
translate([0,0,-sd/2])cylinder(d=hs,h=ln);
}
"most magic tricks are easy once you know the secret"
-marshall broudienLast edited by urglik; 06-03-2015 at 01:44 AM.
-
06-03-2015, 05:55 AM #13
I see what you mean the neck shouldn't be that hard to fit to the hole.
Right try this:
$fn=100;
sd=132.48; //sphere diameter
wt=2; // thickness of sphere wall
hs=25; // hole size
ln=25; // length of neck
//Sphere
%difference() {
sphere(d=sd); //create sphere with diameter set by sd
sphere(d=sd-(2*wt)); //remove sphere from centre of original sphere - size defined by wt
translate([0,0,-sd/2])cylinder(d=hs,h=wt*2); // remove hole from bottom of sphere - diameter defined by hs
}
//Neck
difference() {
translate([0,0,-ln-(sd/2)+wt])cylinder(d=hs+wt,h=ln);
translate([0,0,-ln-(sd/2)+wt])cylinder(d=hs,h=ln);
}
But you must remove the '%' before f6 rendering, otherwise it ignores everything with % in front of it.
so final renderable script:
$fn=100;
sd=132.48; //sphere diameter
wt=2; // thickness of sphere wall
hs=25; // hole size
ln=29; // length of neck
//Sphere
difference() {
sphere(d=sd); //create sphere with diameter set by sd
sphere(d=sd-(2*wt)); //remove sphere from centre of original sphere - size defined by wt
translate([0,0,-sd/2])cylinder(d=hs,h=wt*2); // remove hole from bottom of sphere - diameter defined by hs
}
//Neck
difference() {
translate([0,0,-ln-(sd/2)+wt])cylinder(d=hs+wt,h=ln);
translate([0,0,-ln-(sd/2)+wt])cylinder(d=hs,h=ln);
}
Looks like a classic anarchist's bomb All we need is a plug, some black powder and a fuse :-)
Also looks like the gourd Asterix carries his magic potion in :-)
-
06-03-2015, 05:15 PM #14
- Join Date
- May 2015
- Posts
- 8
reminds me of the bombs in the game stratego and of course these two instruments
balifon
balafon+frame+1+copy.jpg
timbila with an unseen necked sound hole and a membrane covered trumpet
5b8d6a15a38361dda3b3829f0f993bbf.jpg
tanx eh?
oh, and i haven't met this asterix individual of which you speak.
-
06-04-2015, 12:16 AM #15
- Join Date
- May 2015
- Posts
- 8
a couple thoughts came to mind.
the inner diameter of the sphere is the target diameter.
so i added twice the wall thickness to the diameter of the first sphere.
also, if a 25mm long neck is placed on top of a 2mm thick sphere
the effective length of the neck will be 27mm. so i tried
subtracting the wall thickness from neck length for the cylinder height.
seems functional.
also, aren't variables actually constants? sorta like constant variables...
// Example: A 220Hz
$fn=100; // fragment number
sd=132.48; // sphere diameter from formula
wt=2; // wall thickness
hd=25; // sound hole diameter
nl=25; // neck length
// Sphere
difference() {
sphere(d=sd+(2*wt)); // create sphere to be hollowed
sphere(d=sd); // hollow the sphere to diameter from formula
translate([0,0,-(sd/2)-wt])cylinder(d=hd,h=wt*2); // create sound hole
}
// Neck
difference() {
translate([0,0,-nl-(sd/2)+wt])cylinder(d=hd+(2*wt),h=nl-wt);
translate([0,0,-nl-(sd/2)+wt])cylinder(d=hd,h=nl-wt);
}
-
06-04-2015, 05:49 AM #16
yeah if you want to be pedantic they're not what programmers call variables. I call them variables because you can vary them and I'm not a programmer and couldn't give a rats arse what the technical term should or shouldn't be:-)
length of neck would probably be 25mm.
You have to embed the neck into the shell to form a solid join. It doesn't actually sit directly on top of the hole. It wouldn't seal if you did that.
Seriously you've never heard of Asterix The Gaul ?
https://en.wikipedia.org/wiki/Asterix_%28character%29Last edited by curious aardvark; 06-04-2015 at 08:24 AM.
-
06-04-2015, 12:55 PM #17
One of the big 'flaws' in OpenScad was the fact symbols could not change value. The current version has addressed this issue. I'm not sure the OpenScad people would call those 'variables', but they are getting pretty close to that now.
-
06-07-2015, 03:05 PM #18
it's not a flaw if you're not a programmer :-)
The biggest issue with the new version I've got is it can't render more than about 6 facets (okay maybe 6,000).
Trying to make a golf ball (I have my reasons lol) and it just crashes long before I even get close to a decent number of dimples.
Worse than the pinboard.
Just signed up for the openscad 'forum' - not a frigging forum it's a bloody mailing list.
I really don't want a thousand bloody emails a day from openscad. And from what I've seen I can't post without signing up to the poxy mailing list.
Think I'm going to reinstall an older version and see if it can handle basic iterations.
Printer will print perfect...
06-14-2024, 10:44 AM in Tips, Tricks and Tech Help