home *** CD-ROM | disk | FTP | other *** search
- #
- # 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 = cone(vector(0,0,-1),vector(0,0,4),2);
- cylin1= cylin(vector(0,3,1),vector(0,-6,0),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 = plane(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.5,
- (
- (p = plane(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;
-
- gdump("contours", cntrs);
- mdump("contours", view_mat);
- free(a);
- free(p);
- free(c);
- free(cntrs);
-
- resolution = save_res;
- view_mat = save_mat;
-
-
-