home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
graphic
/
irit
/
solid4.irt
< prev
next >
Wrap
Text File
|
1991-11-18
|
1KB
|
68 lines
#
# This solid was taken from: Geometric Modeling,
# by Michael E. Mortenson page 468, figure 10.34
#
# Created by Gershon Elber, Feb 89
#
# Be patient - this one takes about 15 minutes on my 12Mhz 286 with co-pro.
#
tm = time(true);
save_mat = view_mat;
save_res = resolution;
# normal(TRUE, 0.1, RED);
resolution = 8;
T1 = CYLIN(vector( -1.1, 0.0, 0.0), vector( 2.2, 0.0, 0.0), 0.1);
T2 = CYLIN(vector( -0.8, 0.0, 0.0), vector( 0.05, 0.0, 0.0), 0.15);
T3 = CYLIN(vector( 0.8, 0.0, 0.0), vector(-0.05, 0.0, 0.0), 0.15);
S1 = T1 + T2 + T3;
free(T1);
free(T2);
free(T3);
S1 = convex(S1);
beep(800,200);
view(list(S1), true);
S2 = S1 * roty(90);
S3 = S1 * rotz(90);
beep(800,200);
view(list(S2, S3), false);
S4 = S1 + S2 + S3;
free(S1);
free(S2);
free(S3);
beep(800,200);
view(list(S4), true);
resolution = 20;
T4 = sphere(vector(0.0, 0.0, 0.0), 1.0);
S5 = T4 - S4;
free(S4);
free(T4);
final = convex(S5);
free(S5);
tm = time(false);
tm; # In Seconds
interact(list(final), false);
save("solid4", list(view_mat,final));
# Now make the box cut out of it:
T5 = box(vector(-0.01, -0.01, -0.01), 1.5, 1.5, 1.5);
cut = final - T5;
cut = convex(cut);
save("solid4c", list(view_mat,cut));
view_mat = save_mat;
resolution = save_res;