# Geodesic Maths for OpenScad - v0.1

## by WilliamAAdams, published

## Description

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 Comments

view allfunction clean(n) = (n

&

lt; 0) ? ((n

&

lt; -Cepsilon) ? 0 : n) :

(n

&

lt; Cepsilon) ? 0 : n;

Should be

function clean(n) = (n

&

lt; 0) ? ((n

&

lt; -Cepsilon) ? n : 0) :

(n

&

lt; Cepsilon) ? 0 : n;

Could you spot the change? At any rate, if you're using this function directly, you'll want to make this change.

## Tags

## Give a Shout Out

## Instructions

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.

Please Login to Comment

<p>Dear Adam,</p>

<p>Two sites provide much better calculators than Desert Dome which was a fantastic pioneer.</p>

<p>Try http://simplydifferently.org for other geometeries than icoshedron as well as optimided versions of icosahedron.</p>

<p>Also try the site domearama for its array of dome calculating tools as well as many interesting things on domes.</p>

<p>Did you know Hugh Kenner was a proffesor of English Litterature at Berekly!</p>

<p>There is a silly bug in the 'clean()' function:</p>

<p>function clean(n) = (n <br>&<br>lt; 0) ? ((n <br>&<br>lt; -Cepsilon) ? 0 : n) : </p>

<p> (n <br>&<br>lt; Cepsilon) ? 0 : n; </p>

<p>Should be</p>

<p>function clean(n) = (n <br>&<br>lt; 0) ? ((n <br>&<br>lt; -Cepsilon) ? n : 0) : </p>

<p> (n <br>&<br>lt; Cepsilon) ? 0 : n; </p>

<p>Could you spot the change? At any rate, if you're using this function directly, you'll want to make this change.</p>

<p>Unfortunately I never got around to fully comprehend the math behind it, despite several attempts to do so. Thanks for sharing this!</p>

<p>Sometimes it's easier to just use the tools at hand than understanding how they're made. I hope these are such tools. Just enough to make interesting things without you having to understand how they're put together.</p>

<p>Although, once you look at how they're put together, the mystery might disappear.</p>

Two sites provide much better calculators than Desert Dome which was a fantastic pioneer.

Try simplydifferently.org for other geometeries than icoshedron as well as optimided versions of icosahedron.

Also try the site domearama for its array of dome calculating tools as well as many interesting things on domes.

Did you know Hugh Kenner was a proffesor of English Litterature at Berekly!