Found coordinates for DODECAHEDRON... close but no cigar

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Found coordinates for DODECAHEDRON... close but no cigar

Bob Crimmins
I located a site that has the x/y/z coordinates for the vertices of a dodecahedron (and some other shapes) and have modified the example001.scad code to punch holes in a sphere corresponding to those vertices.  It required a couple of other modes to the example file and it sort of works, i.e., it's punching holes in what appear to be some of the right places but a few of the holes seem to overlap and so there aren't enough holes.  So, while promising, the results don't quite get there.  I think it may have something to do with the way the rotateI() function works but I'm not familar enough with they way OpenSCAD treats rotations.  Anyone got any ideas?  I've included the modified example001 code below.

BTW, here's the site with the x/y/z coordinates in case anyone is looking for coordinates for other shapes: http://people.sc.fsu.edu/~jburkardt/data/xyzl/xyzl.html

=====================================

module example001()

{

function r_from_dia(d) = d / 2;


module rotcy(rot, r, h) {

rotate(180, rot)

cylinder(r = r, h = h, center = false);

}


difference() {

sphere(r = r_from_dia(size));


rotcy([ -0.577350, -0.577350, 0.577350], cy_r, cy_h);

rotcy([ 0.934172, 0.356822, 0.000000], cy_r, cy_h);

rotcy([ 0.934172, -0.356822, 0.000000], cy_r, cy_h);

rotcy([ -0.934172, 0.356822, 0.000000], cy_r, cy_h);

rotcy([ -0.934172, -0.356822, 0.000000], cy_r, cy_h);

rotcy([ 0.000000, 0.934172, 0.356822], cy_r, cy_h);

rotcy([ 0.000000, 0.934172, -0.356822], cy_r, cy_h);

rotcy([ 0.356822, 0.000000, -0.934172], cy_r, cy_h);

rotcy([ -0.356822, 0.000000, -0.934172], cy_r, cy_h);

rotcy([ 0.000000, -0.934172, -0.356822], cy_r, cy_h);

rotcy([ 0.000000, -0.934172, 0.356822], cy_r, cy_h);

rotcy([ 0.356822, 0.000000, 0.934172], cy_r, cy_h);

rotcy([ -0.356822, 0.000000, 0.934172], cy_r, cy_h);

rotcy([ 0.577350, 0.577350, -0.577350], cy_r, cy_h);

rotcy([ 0.577350, 0.577350, 0.577350], cy_r, cy_h);

rotcy([ -0.577350, 0.577350, -0.577350], cy_r, cy_h);

rotcy([ -0.577350, 0.577350, 0.577350], cy_r, cy_h);

rotcy([ 0.577350, -0.577350, -0.577350], cy_r, cy_h);

rotcy([ 0.577350, -0.577350, 0.577350], cy_r, cy_h);

rotcy([ -0.57735, -0.57735, -0.57735], cy_r, cy_h);


}


size = 100;

hole = 10;


cy_r = r_from_dia(hole);

cy_h = r_from_dia(size * 1);

}


example001();