POV-Ray : Newsgroups : povray.text.scene-files : source_table_design Server Time
1 Nov 2024 07:25:41 EDT (-0400)
  source_table_design (Message 1 to 4 of 4)  
From: Al Canada
Subject: source_table_design
Date: 2 May 2001 16:43:38
Message: <3AF0715E.5B663238@sympatico.ca>
// 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

From: yooper
Subject: Re: source_table_design
Date: 2 May 2001 20:37:17
Message: <3af0a83d@news.povray.org>
Thanks Alex . . .

  Didn't see if you specified what wood texture you used . . .
but will experiment anyway ;)


Y


Post a reply to this message

From: Al Canada
Subject: Re: source_table_design
Date: 2 May 2001 22:03:10
Message: <3AF0BC45.9BF0B224@sympatico.ca>


> Thanks Alex . . .
>
>   Didn't see if you specified what wood texture you used . . .
> but will experiment anyway ;)
>

> Y

This source is strictly the table source....  you don't have the source
for
the floor of the "everything_is_csg" image...  But may be I could
send you...
                            Alex
( take care,  if you experiment with the table,  you have to specify
a texture for the top,  and a texture for the support...  And, at the
of the source,  at the bottom page,  you have to erase my e-mail
address... I put it there by error... )


Post a reply to this message

From: yooper
Subject: Re: source_table_design
Date: 8 May 2001 01:52:40
Message: <3af789a8@news.povray.org>
thanks Alex . . .

haven't had time to play with it . . . work is taking up my play time ;(

Y


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.