|
|
David Fontaine <dav### [at] faricynet> wrote:
: Same way you made the other one but with different shape tiles?
You got it.
I tried the same idea with a triangular tile and noticed how organic-looking
the pipes became. Looked cool to me.
The source code, if anyone cares:
#declare R=.06;
#declare f60=sin(radians(60));
#declare Pipes=
union
{ torus { .25,R } torus { .5,R }
sphere { z*.75,R rotate y*30 }
torus { .125,R translate z*.375 rotate y*-30 translate x }
#declare d=.375*f60-.125;
union
{ torus
{ d,R clipped_by { box { <-d-R, -R-.01, 0><0, R+.01, d+R> } }
translate z*(.75-d)
}
cylinder { <-d, 0, .75-d><-d, 0, .3>,R }
rotate y*-30 translate x
}
union
{ torus { .125,R clipped_by { box { <-.25,-R-.01,-.25><.25,R+.01,0> } } }
cylinder { x*.125, <.125,0,.2>, R }
rotate y*-30 translate x*(.75-.125)
}
clipped_by
{ intersection
{ box { <0,-R-.01,0><1,R+.01,1> }
box { <0,-R-.01,0><1,R+.01,1> rotate y*30 }
box { <0,-R-.01,0><-1,R+.01,1> rotate y*-30 translate x }
}
}
}
#declare t30=tan(radians(30));
#declare Rseed=seed(4);
#macro PlacePipes(place, angleOffset)
object
{ Pipes
translate <-.5,0,-.5*t30> rotate y*(int(rand(Rseed)*3)*120+angleOffset)
translate place+z*(angleOffset?.5/cos(radians(30))-.5*t30:0)
}
#end
union
{ #declare indX=-2;
#while(indX<12)
#declare indZ=-2;
#while(indZ<12)
PlacePipes(<indX,0,indZ>, 0)
PlacePipes(<indX+.5,0,indZ>, 180)
PlacePipes(<indX,0,indZ+f60>, 180)
PlacePipes(<indX+.5,0,indZ+f60>, 0)
#declare indZ=indZ+f60*2;
#end
#declare indX=indX+1;
#end
pigment { rgb x/2+y } finish { specular .5 }
}
union
{ #declare indX=-2;
#while(indX<12)
#declare indZ=-2;
#while(indZ<12)
PlacePipes(<indX,-R*2,indZ>, 0)
PlacePipes(<indX+.5,-R*2,indZ>, 180)
PlacePipes(<indX,-R*2,indZ+f60>, 180)
PlacePipes(<indX+.5,-R*2,indZ+f60>, 0)
#declare indZ=indZ+f60*2;
#end
#declare indX=indX+1;
#end
pigment { rgb z+y/4 } finish { specular .5 }
}
camera { location <-2,1.5,-3> look_at 0 angle 45 }
light_source { <20,25,-10> 1 }
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|