Metropoli BBS
VIEWER: contours.irt MODE: TEXT (ASCII)
#
# Intersection of cone and a cylinder:
# Try this one with resolution equal 20 - slower, but much nicer!
#
#			Created by Gershon Elber,	Jan. 89
#

save_mat = view_mat;
view_mat = view_mat * scale(vector(0.2, 0.2, 0.2));
save_res = resolution;
resolution = 8;

cone1 = con2(vector(0,0,-1),vector(0,0,4),2,1);
cylin1= cylin(vector(0,3,0),vector(0,-6,2),0.7);

a = cone1+cylin1;
free(cylin1);
free(cone1);
beep(500,300);
interact(list(a), false);

intercrv = true;
#
# Currently variables can not be introduced in a loop (except the iteration
# vairable), so we prepare all variables in advance.
#
p = circpoly(vector(0.0, 0.0, 1.0), vector( 0.0, 0.0, -0.9), 6.0);
c = cntrs = a * p;
view(list(cntrs), false);
for ( (i = -0.7), 0.2, 2.9,
        (
          (p = circpoly(vector(0.0, 0.0, 1.0), vector( 0.0, 0.0, i), 6.0)):
	  (c = a * p):
	  view(list(c), false):
	  (cntrs = cntrs + c)
        )
    );
intercrv = false;

save("contours", list(view_mat,cntrs));
free(a);
free(p);
free(c);
free(cntrs);

resolution = save_res;
view_mat = save_mat;



[ RETURN TO DIRECTORY ]