Geodesic Maths for OpenScad - v0.1
by WilliamAAdams, published
A funny thing happened on my recent holiday. I built a nice 3V geodesic dome and covered it with a parachute, so me and the family could sleep mosquito free. Of course I used the Desert Domes calculator: http://www.desertdomes.com/ in order to calculate my chord factors so I could cut my wood dowels. But then I got to thinking...
The geodesic form of tesselation is certainly good for dome building, but it's probably also good for other modeling purposes as well.
This thing is a library of functions that will do geodesic calculations, written in OpenScad.
There's no pretty object to go with it. I'll have to use my handy dandy renderer and generate some domes. For now, it's the the raw routines.
First, there's some simple useful nuggets related to spherical coordinates: sph(long, lat, radius) sph_to_cart(s) - convert to cartesian sph_from_cart(s) - create spherical from cartesian sph_dist(c1, c2) - Calculate the chord distance of two points on a sphere
that right there is enough to do some fun geometry and GIS sorts of stuff. but wait, there's more!!
Pulling this book off the shelf: Geodesic Math and How to Use It
I went and created the following:
geo_freq() geo_tri2_tri3() octa_class1() octa_class2() icosa_class1() icosa_class2() tetra_class1() class1_icosa_chord_factor()
These are the basics. The last one is what you really actually use to figure out chord factors, then you use those factors, multiply for your radius, and you're done. For those in the know of geodesics, it's relatively easy going from there. If you're not so familiar, a much more handy geodesic() module will be forthcoming in a subsequent release.
As usual, why bother with all this nonsense? The web based calculator at Desert Domes is perfectly usable after all... Well, that calculator generates domes based on the Icosahedron, Class 1, Method 1 style. That's not the only form in which a dome can be constructed. There are the octahedron, and tetrahedron base forms, and what about elliptical shapes, and who can forget triacons!!?
At any rate, I figure if there's a ready made public domain library to start from, people can make more interesting dome construction models, so here it is! I think it would be rather nifty if OpenScad had native support for geodesics...
Future additions will include more interesting methods/classes and things such as elliptical and 'free form' sorts of things. Then it will get really interesting.
UPDATE: 08082011 Added a blog entry to go with this: http://williamaadams.wordpress.com/2011/08/08/geodesic-math-in-openscad-part-1-of-some/
UPDATE: 12082011 There is a bug in the 'clean()' function. So, if you're using the sph_to_cart() function, you'll get invalid numbers when you rotate past 90 degrees for your longitude. I'll update in a bit, but there's some other new functions coming as well.
Recent Commentsview all
Liked Byview all
Give a Shout Out
1) Download maths_geodesic.scad 2) Download test_geodesic.scad 3) Fiddle about with the various test routines to generate interesting numbers 4) Use those numbers to cut pieces of material to size 5) Assemble something 6) Rejoice!
There are numerous references to Dome building on the internet. I so happen to have picked up this very old book "Geodesic Math and How to Use It" because it was written in Berkeley, and had a writing style that appealed to me. You can use that book, or any other book, to follow along what's going on here.