# Geodesic Maths for OpenScad - v0.1

## by WilliamAAdams, published Aug 5, 2011

Geodesic Maths for OpenScad - v0.1 Aug 5, 2011

## 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: 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.

view all

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!
There is a silly bug in the 'clean()' function:

function 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.
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.

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

view all

## Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

## Instructions

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.

#### Size

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!
There is a silly bug in the 'clean()' function:

function 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.
Unfortunately I never got around to fully comprehend the math behind it, despite several attempts to do so. Thanks for sharing this!
Anonymous - in reply to justjoheinz
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.

Although, once you look at how they're put together, the mystery might disappear.
Thank you, I really appreciate, when people gets their hand dirty in pure math!:)
Top