|
|
// DONE WITH POVRAY FOR WINDOWS ( FREEWARE ) //
/* HERE IS THE SOURCE OF THE TABLE I SENDED ON THE IMAGES.BINARIES
FORUM, YESTERDAY. I WILL NOT PUT THE ENVIRONNEMENT CODE HERE,
CAUSE THAT KIND OF STUFF WOULD BE TOO LONG AND ANYBODY CAN
DO THAT BY HIMSELF...
THE FIRST PART OF THE TABLE IS :
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
////////////
////////
//////////// object { pillar_system texture { any_metal_texture }}
//////////
////////////
////////
////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
THE TOP OF THE TABLE IS :
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
////////////
/////////
//////////// object { smoked_glass texture { any_glass_texture }}
///////////
////////////
/////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
THE UNION OF BOTH OBJECTS IS SUPPOSED TO FIT THE RIGHT WAY,
I MEAN, THE SCALE AND TRANSLATE PARAMETERS ARE SUPPOSED TO
PROPERLY FIT AS A NICE WHOLE, on a ground y,0.. !
SO, HERE IS THE CODE.... */
////////////////////////////////////////////////////////////
///////////// T O R U S M A C R O ////////////////////
////////////////////////////////////////////////////////////
#macro flex_o_tor ( long_rad, small_rad, rot_plan1, rot_plan2 )
difference {
torus { long_rad, small_rad rotate -90*x }
plane { +y, 0 rotate rot_plan1*z }
plane { +y, 0 rotate rot_plan2*z }
}
#end
////////////////////////////////////////////////////////////
// BEGINNING OF THE TOP SURFACE OF THE TABLE ///////////////
#declare thickness_table = 0.30; // how thick is the top of the table...
// segm a to h = big radius of each tor segment... //
#declare segma = 4; #declare segmb = 4; #declare segmc = 7;
#declare segmd = 6.5;
#declare segme = 4; #declare segmf = 18.75; #declare segmh = 16;
// rot a to f = degrees of rotation used to cut the tor' with planes...
//
#declare rota = 30; #declare rotb = 90; #declare rotc =45;
#declare rotd = 30; #declare rotdd = 0; #declare rote = 90; #declare
rotf =45;
#declare smoked_glass_temp =
merge {
merge {
flex_o_tor ( segma, thickness_table, -45, rota )
}
cylinder { <0,-thickness_table,0>,<0,+thickness_table,0>,segma rotate
+90*x }
///////////////////////////////////////////////////////////////
#declare xx = (segmh-segma)*cos(radians(45));
#declare yy = -(segmh-segma)*sin(radians(45));
merge { flex_o_tor ( segmh, thickness_table, -rote, 45 ) rotate 90*z
translate < xx, yy, 0 >
}
difference {
cylinder { <0,-thickness_table,0>,<0,+thickness_table,0>,segmh
rotate -90*x }
plane { +y, 0 } plane {+y,0 rotate 135*z}
cylinder { <0,-15,0>,<0,+15,0>,1 rotate +90*x }
translate < xx,yy,0 >
}
///////////////////////////////////////////////////////////////
#declare x1 = (segma+segmb)*cos(radians(rota));
#declare y1 = (segma+segmb)*sin(radians(rota));
merge { flex_o_tor ( segmb, thickness_table, -rotb, rota ) rotate
180*z
translate < x1, y1, 0 >
}
difference {
cylinder { <0,0,-thickness_table>,<0,0,+thickness_table>,segmb
inverse }
cylinder { <0,0,-15>,<0,0,+15>,11 inverse }
plane { -x, 0 } plane { -y, 0 rotate +30*z }
plane { -z, 0 translate +(thickness_table-0.0001) } plane { +z, 0
translate -(thickness_table-0.0001) }
translate < x1,y1,0 >
}
#declare x2 = x1; #declare y2 = y1-(segmb+segmc);
merge { flex_o_tor ( segmc, thickness_table, 0, +rotc ) rotate -90*z
translate < x2, y2, 0 >
}
cylinder { <0,-thickness_table,0>,<0,+thickness_table,0>,segmc rotate
+90*x translate < x2,y2,0 >
}
#declare x3 = (segmc+segmd)*cos(radians(rotc))+x2;
#declare y3 = -(segmc+segmd)*sin(radians(rotc))+y2;
merge { flex_o_tor ( segmd, thickness_table, -rotd, rotc ) rotate 90*z
translate < x3, y3, 0 >
}
difference {
cylinder { <0,0,-thickness_table>,<0,0,+thickness_table>,segmd
inverse }
cylinder { <0,0,-15>,<0,0,+15>,11 inverse }
plane { +y, 0 rotate -30*z } plane { +y, 0 rotate +45*z }
plane { -z, 0 translate +(thickness_table-0.0001) } plane { +z, 0
translate -(thickness_table-0.0001) }
rotate 90*z
translate < x3,y3,0 >
}
#declare x4 = -(segmd+segme)*sin(radians(rotd))+x3;
#declare y4 = -(segmd+segme)*cos(radians(rotd))+y3;
merge { flex_o_tor ( segme, thickness_table, -rotd, rotdd ) rotate
-90*z
translate < x4, y4, 0 >
}
difference {
cylinder { <0,-thickness_table,0>,<0,+thickness_table,0>,segme
rotate +90*x }
plane { +y, 0 } rotate -90*z translate < x4,y4,0 >
}
#declare x5 = x4;
#declare y5 = y4+segmf-segme;
merge { flex_o_tor ( segmf, thickness_table, -rote, rotdd ) rotate
180*z
translate < x5, y5, 0 >
}
difference {
cylinder { <0,-thickness_table,0>,<0,+thickness_table,0>,segmf
rotate +90*x }
plane { +y, 0 } plane {+x,0}
cylinder { <0,-15,0>,<0,+15,0>,11 rotate +90*x }
rotate 180*z translate < x5,y5,0 >
}
#declare xbout = x5-segmf; #declare ybout = y5;
cylinder { <0,0,0>, <0,2.5,0>, thickness_table
translate < xbout, ybout, 0 >
}
box { <0,0,-thickness_table>, <12,2.5,thickness_table> translate <
xbout, ybout, 0 > }
box { <-4,-7,-thickness_table+0.00001>,
<+5,+7,thickness_table-0.00001> translate < x2-5, y2-8, 0 >
} // the last two boxes are to fill up the whole left in the middle of
the table... //
}
///////////// ///////////////// end of : smoked_glass
///////////////////////
///////////// /////////////////
///////////// /////////////////
///////////// /////////////////
///////////// /////////////////
///////////// /////////////////
// SOURCE OF THE SHAPE SUPPORTING THE TOP SURFACE
// ( IN FACT, THE SAME SHAPE IS USED DOWN THE CROSS-BARS... )
#declare tube_rad = 0.6; // radius of the tubular shape...
#declare segma = 2; #declare segmb = 6; #declare segmc = 5;
#declare segmd = 8.5;
#declare segme = 2; #declare segmf = 16.75; #declare segmh = 14;
#declare rota = 30; #declare rotb = 90; #declare rotc =45;
#declare rotd = 30; #declare rotdd = 0; #declare rote = 90; #declare
rotf =45;
#declare frame_design =
union {
union {
flex_o_tor ( segma, tube_rad, -45, rota )
}
///////////////////////////////////////////////////////////////
#declare xx = (segmh-segma)*cos(radians(45));
#declare yy = -(segmh-segma)*sin(radians(45));
union { flex_o_tor ( segmh, tube_rad, -rote, 45 ) rotate 90*z
translate < xx, yy, 0 >
}
///////////////////////////////////////////////////////////////
#declare x1 = (segma+segmb)*cos(radians(rota));
#declare y1 = (segma+segmb)*sin(radians(rota));
union { flex_o_tor ( segmb, tube_rad, -rotb, rota ) rotate 180*z
translate < x1, y1, 0 >
}
#declare x2 = x1; #declare y2 = y1-(segmb+segmc);
union { flex_o_tor ( segmc, tube_rad, 0, +rotc ) rotate -90*z
translate < x2, y2, 0 >
}
#declare x3 = (segmc+segmd)*cos(radians(rotc))+x2;
#declare y3 = -(segmc+segmd)*sin(radians(rotc))+y2;
union { flex_o_tor ( segmd, tube_rad, -rotd, rotc ) rotate 90*z
translate < x3, y3, 0 >
}
#declare x4 = -(segmd+segme)*sin(radians(rotd))+x3;
#declare y4 = -(segmd+segme)*cos(radians(rotd))+y3;
union { flex_o_tor ( segme, tube_rad, -rotd, rotdd ) rotate -90*z
translate < x4, y4, 0 >
}
#declare x5 = x4;
#declare y5 = y4+segmf-segme;
union { flex_o_tor ( segmf, tube_rad, -rote, rotdd ) rotate 180*z
translate < x5, y5, 0 >
}
#declare xbout = x5-segmf; #declare ybout = y5;
cylinder { <0,0,0>, <0,2.5,0>, tube_rad
translate < xbout, ybout, 0 >
}
}
/////////////////// end of : first part of the support ///
/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
// HERE IS THE SOURCE OF THE CROSS-BARS LINKING BOTH THE LOWER
// AND THE UPPER PART OF THE SUPPORT...
#declare tube_rad = 0.400; // radius of the tubular shape...
// ... A BIT SMALLER THAN THE REST OF THE
SHAPE...
#declare A = 0;
#declare B = 15;
#declare C = 30; // A TO H = the degrees of rotation of each
cross-bars.
#declare D = 45;
#declare E = 60;
#declare F = 75;
#declare G = 90;
#declare H = 105;
#declare segma = 2; #declare segmb = 6; #declare segmc = 5; #declare
segmd = 8.5;
#declare segme = 2; #declare segmf = 16.75; #declare segmh = 14;
#declare rota = 30; #declare rotb = 90; #declare rotc =45;
#declare rotd = 30; #declare rotdd = 0; #declare rote = 90; #declare
rotf =45;
#declare ray_tige = 2.925; #declare cut1 = 45;
#declare translat1 = 0.1; #declare cut2 = 0;
// SOURCE OF ONE SIMPLE CROSS_BAR WITH A NICE DESIGN
/////////////////////////
#declare cross_bar =
union {
cylinder { <0,0,0>,<0,-translat1, 0>, tube_rad
}
#declare xa = ray_tige; #declare ya = translat1;
difference {
torus { ray_tige, tube_rad rotate -90*x }
plane { -y, 0 } plane { -x, 0 rotate -cut1*z }
translate < xa, -ya, 0 >
}
#declare xaa = -(ray_tige*2)*cos(radians(cut1))+xa;
#declare yaa = -(ray_tige*2)*sin(radians(cut1))-ya;
difference {
torus { ray_tige, tube_rad rotate -90*x }
plane { +x, 0 rotate cut1*z } plane { +x, 0 rotate -cut1*z }
translate < xaa, yaa, 0 >
}
#declare xb = +(ray_tige*2)*cos(radians(cut1))+xaa;
#declare yb = -(ray_tige*2)*sin(radians(cut1))+yaa;
difference {
torus { ray_tige, tube_rad rotate -90*x }
plane { +y, 0 } plane { -x, 0 rotate +cut1*z }
translate < xb, yb, 0 >
}
#declare xbb = (ray_tige)*cos(radians(180))+xb;
#declare ybb = +(ray_tige)*sin(radians(0))+yb;
cylinder { <0,0,0>,<0,-translat1, 0>, tube_rad translate < xbb, ybb, 0
>
}
translate -0.95*y rotate -90*x
}
#declare cross_bar1 = object { cross_bar rotate -90*z }
#declare cross_bar2 = object { cross_bar rotate 180*z }
#declare whole_bars =
union {
#declare x1 = (segma+segmb)*cos(radians(rota));
#declare y1 = (segma+segmb)*sin(radians(rota));
union {
object { cross_bar1 translate -segmb*y rotate -A*z }
object { cross_bar1 translate -segmb*y rotate -B*z }
object { cross_bar1 translate -segmb*y rotate -C*z }
object { cross_bar1 translate -segmb*y rotate -D*z }
translate < x1, y1, 0 >
}
#declare x3 = (segmc+segmd)*cos(radians(rotc))+x2;
#declare y3 = -(segmc+segmd)*sin(radians(rotc))+y2;
union {
object { cross_bar2 translate -segmd*x rotate +(A/8.5*6)*z }
object { cross_bar2 translate -segmd*x rotate +(B/8.5*6)*z }
object { cross_bar2 translate -segmd*x rotate +(C/8.5*6)*z }
object { cross_bar2 translate -segmd*x rotate +(D/8.5*6)*z }
translate < x3, y3, 0 >
}
#declare x5 = x4;
#declare y5 = y4+segmf-segme;
union {
object { cross_bar translate -segmf*x rotate +(A/14*6)*z }
object { cross_bar translate -segmf*x rotate +(B/14*6)*z }
object { cross_bar translate -segmf*x rotate +(C/14*6)*z }
object { cross_bar translate -segmf*x rotate +(D/14*6)*z }
rotate +10*z
translate < x5, y5, 0 >
}
}
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
// BOTH PART 1 AND 2 OF THE WHOLE TABLE...
// WITH THE EXACT SCALING AND TRANSLATING NEEDED...
#declare smoked_glass =
object { smoked_glass_temp rotate 90*x translate < -5, -0.05, +12 >
translate +10*y rotate 90*y
}
#declare pillar_system = union {
object { frame_design rotate 90*x translate < -5, -0.95, +12 >
}
object { frame_design rotate 90*x translate < -5, -9.4, +12 >
}
object { whole_bars rotate 90*x translate -5*x translate +12*z
}
translate +10*y rotate 90*y
}
////// E N D O F T H E S O U R C E
////////////////////////////////
////// A L E X P I L O T E
////////////////////////////////
////// SOFTWARE : PERSISTENCE OF VISION RAYTRACER
////////////////////
www3.sympatico.ca/floral.audet/index.html
Post a reply to this message
|
|