#
# Intersection of two boxes:
#
#				Created by Gershon Elber,	Jan. 89
#
save_mat = view_mat;
view_mat = save_mat * scale( vector( 0.15, 0.15, 0.15 ) );

b1 = box( vector( -3, -2, -1 ), 6, 4, 2 );
b2 = box( vector( -4, -3, -2 ), 2, 2, 4 );

a1 = b2 + b1;
interact( list( view_mat, a1 ) );

a2 = b2 * b1;
interact( a2 );

a3 = b2 - b1;
interact( a3 );

a4 = b1 - b2;
interact( a4 );

ICrv = iritstate( "intercrv", true );
a5 = b2 * b1;
interact( list( a5, b1, b2 ) );
ICrv = iritstate( "intercrv", ICrv );
free( ICrv );

save( "box-box",
      list( a1, a2 * tx( 10 ), a3 * tx( 20 ), a4 * tx( 30 ), a5 * tx( 40 ) ) );

view_mat = save_mat;

free( a1 );
free( a2 );
free( a3 );
free( a4 );
free( a5 );

free( b1 );
free( b2 );

free( save_mat );
