|
Column_N
A column with N edges
general syntax:
object{ Column_N( N,
Radius,
Height
) //------
texture{ ... }
} // end of object -
|
N >2 = the number of edges,
Radius = incircle radius,
Height = total height in y.
Column_N_AB
object{ Column_N_AB(
N,
Point_A, Point_B,
Radius,
) //--------------
texture{ ... }
} // end of object -
|
|
|
Pyramid_N
A pyramid with N edges
general syntax:
object{ Pyramid_N( N,
Radius1,
Radius2,
Height
) //------
texture{ ... }
} // end of object -- |
N >2 = the number of edges,
Radius1 = base incircle radius,
Radius2 = top incircle radius,
Height = total height in y.
Pyramid_N_AB
object{ Pyramid_N_AB(
N,
Point_A, Radius_A,
Point_B, Radius_B,
) //---------------
texture{ ... }
} // end of object -- |
|
Example:
#include "shapes3.inc"
object{ Column_N( 14, 1.8, 1.30 )
texture{ pigment{color rgb<1,1,1>}
finish {phong 1}
} // end of texture
} // end of object ---------------- |
#include "shapes3.inc"
//------------------ N,Point_A,Point_B,R
object{ Column_N_AB(
8,<0,0.5,-1>,<1.5,1.5,-0.5>,0.45)
texture{
pigment{ color rgbt<1,1,1,0.6>}
normal { bumps 0.5 scale 0.005}
finish { phong 1}
} // end texture
scale<1,1,1>
rotate<0,0,0>
translate<0,0,0>
} // end of object ---------------- |
|
Example:
#include "shapes3.inc"
object{ Pyramid_N( 14, 1.8, 1.30, 1.00 )
texture{ pigment{color rgb<1,1,1> }
finish {phong 1}
} // end of texture
} // end of object ---------------- |
#include "shapes3.inc"
//------------------ N,Point_A,Point_B,R
object{ Pyramid_N_AB(
8,<0,1,-1>,0.5,<1.5,1.5,-0.5>,0.25)
texture{
pigment{ color rgbt<1,1,1,0.6>}
normal { bumps 0.5 scale 0.005}
finish { phong 1}
} // end texture
scale<1,1,1>
rotate<0,0,0>
translate<0,0,0>
} // end of object ---------------- |
|
Macros in detail
//------------------------------------- Pyramid_N()
#macro Pyramid_N (N, Radius1, Radius2, Height)
//------------------------------------------------
#local D= 0.00001;
intersection{
#local Nr = 0; // start
#local EndNr = N; // end
#while (Nr < EndNr)
// linear prism in z-direction:
prism{ -2.00 ,2.00 , 5 //------------------------
<-2.00, 0.00>, < 1.00, 0.00>,
< 0.00+Radius2/Radius1,1.00>,
<-2.00,1.00>, <-2.00, 0.00>
//turns prism in z direction:
rotate<-90,0,0> scale<1,1,-1>
scale <Radius1+Nr*D,Height+Nr*D,Radius1+Nr*D>
rotate<0,Nr * 360/EndNr,0>
} // end of prism -----------------------------
#local Nr = Nr + 1; // next Nr
#end // ---------------- end of loop
} // end of intersection
#end // ------------------------------ end of macro |
If we start this macro with N = 1 the result will be a
degenerated intersection out of just one prism.
So, all we have to do, is turn around the y axis these elements by 360/N
and intersect them all:
|
N = 1, Radius1 = 1.70, Radius2 = 1.10, Height= 1.50
|
N = 11, Radius1 = 1.70, Radius2 = 1.10, Height= 1.50
|
A Column with N edges is nothing else, than a truncated pyramid with
top radius = base radius, so the following macro will work together with the above macro:
//----------------------------------- Column_N()
#macro Column_N (N, Radius, Height )
//---------------------------------------------
object{ Pyramid_N (N, Radius, Radius, Height )}
#end //--------------------------- end of macro |
|
N = 3, Radius = 1.00, Height= 0.50 |
N = 14, Radius = 1.80, Height= 1.30 |
|
N = 7, Radius = 2.00, Height= 1.00 |
N = 7, Radius1 = 2.00, Height= 1.00 |
|
|