Quantcast

Dodecahedron - Intersecting Tetrahedra - with Dodecahedron

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Dodecahedron - Intersecting Tetrahedra - with Dodecahedron

unkerjay
From:

https://trmm.net/Tetrahedron

I got the code for interlocking Tetrahedron (in color):

"
$fn=30;
v=[
        [+1,+1,+1],
        [+1,-1,-1],
        [-1,+1,-1],
        [-1,-1,+1],
];

colors=["red","green","blue","yellow","purple"];

module tetrahedron(len,thick)
{
        for(a=[0:2])
                for(b=[a+1:3])
                        hull() {
                                translate(v[a]*len) sphere(r=thick);
                                translate(v[b]*len) sphere(r=thick);
                        }
}

for(i=[0:4])
{
        color(colors[i])
        rotate([0,-atan(sqrt(5)/2-0.5), i*360/5])
        tetrahedron(20,2);
}
"

And elsewhere, I discovered it can also be done by connecting
the vertices of a dodecahedron.

What I'd like to do is add the dodecahedron (transparent) with
the interlocking tetrahedrons to be able to show just how the
vertices connect.

I tried doing it in Blender, but, I can't color the edges.

Without being able to color the edges, it's all black and there's
no clear way to determine easily which edges identify each
tetrahedron (as is shown here).

Anyone?

He also mentions adding the code:

"rotate($t*360)"

but is unclear as to where in the initial code that would go, to work.

Last line?  Maybe.

Thanx

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dodecahedron - Intersecting Tetrahedra - with Dodecahedron

unkerjay
Figured out, at least for this code, the rotation:

"
$fn=30;
v=[
        [+1,+1,+1],
        [+1,-1,-1],
        [-1,+1,-1],
        [-1,-1,+1],
];

colors=["red","green","blue","yellow","purple"];

module tetrahedron(len,thick)
{
        for(a=[0:2])
                for(b=[a+1:3])
                        hull() {
                                translate(v[a]*len) sphere(r=thick);
                                translate(v[b]*len) sphere(r=thick);
                        }
}

for(i=[0:4])
{
        color(colors[i])
        rotate([0,-atan(sqrt(5)/2-0.5), i*360/5])
        rotate([0,0,$t*360]) translate([0,0,0]) tetrahedron(20,.25);  // (diameter, stick size)
}
"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Dodecahedron - Intersecting Tetrahedra - with Dodecahedron

Ronaldo
Add this to your code:

%hull()
for(i=[0:4])
{
        rotate([0,-atan(sqrt(5)/2-0.5), i*360/5])
        rotate([0,0,$t*360]) translate([0,0,0])
        for(vi=v)
            translate(vi*20) sphere(.25);
}

Instead of spheres, you may use a cube for faster display.



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Loading...