#
# A cork blug.
#
#						Gershon Elber, Dec 1999
#
# Can you compute the volume of this thing!?
#

save_mat = view_mat;
view_mat = sc( 0.4 );

Cork = ruledSrf( pcircle( vector( 0, 0, 0 ), 1 ),
		 pcircle( vector( 0, 0, 0 ), 1 ) * sx( 0 ) * tz( 2 ) );

interact( list( view_mat,
	        Cork * rx( -90 )            * tx( -1.2 ) * ty(  0.4 ),
	        Cork                        * tx( -1.2 ) * ty( -1.2 ),
	        Cork * rx( -90 ) * ry( 90 ) * tx(  1.2 ) * ty(  0.4 ),
	        Cork * save_mat             * tx(  1.2 ) * ty( -1.8 ) ) );

save( "corkplug", Cork );


CorkCross = nth( prisa( Cork, 256, 1, COL, vector( 0, 0, 0 ), true ), 1 );
color( CorkCross, magenta );

CorkPrisa = prisa( Cork, 256, 1, COL, vector( 0, 0, 0 ), false );
color( CorkPrisa, red );


All = list( CorkPrisa * ty( -1.3 ), CorkCross * ty( 1 ) ) * sc( 0.35 );

interact( All );
save( "cork_prs", All );

free( Cork );
free( CorkCross );
free( CorkPrisa );
free( All );

view_mat = save_mat;
