home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
graphic
/
irit
/
solid2h.irt
< prev
next >
Wrap
Text File
|
1992-07-26
|
2KB
|
84 lines
#
# This solid was taken from: Geometric Modeling,
# by Michael E. Mortenson page 441, figure 10.9
# Takes more than 13 minutes on my 12Mhz 286 with copro.
#
# Created by Gershon Elber, Apr 90
#
tm = time(true);
save_mat = view_mat;
view_mat = view_mat * scale(vector( 0.5, 0.5, 0.5 ));
save_res = resolution;
#
# Try it with coplanar = 0 for fun.
#
coplanar = 1;
# normal(TRUE, 0.1, RED);
T1 = BOX(vector( -2.0, -0.35, 0.0 ), 4, 0.7, 0.4 );
resolution = 80;
T2 = CYLIN(vector( 0.0, 0.0, 0.0 ), vector( 0.0, 0.0, 0.4 ), 1.4);
S1 = T1 * T2;
free(T1);
free(T2);
beep(800,200);
view(list(S1), true);
resolution = 40;
T3 = CYLIN(vector( 0.0, 0.0, 0.0 ), vector( 0.0, 0.0, 0.4 ), 0.9);
S2 = S1 + T3;
free(T3);
free(S1);
beep(800,200);
view(list(S2), true);
resolution = 80;
T4 = CYLIN(vector( 1.45, -0.5, 1.0 ), vector( 0.0, 1.0, 0.0 ), 0.8);
T5 = CYLIN(vector(-1.45, -0.5, 1.0 ), vector( 0.0, 1.0, 0.0 ), 0.8);
S3 = S2 - T4 - T5;
free(T4);
free(T5);
free(S2);
beep(800,200);
view(list(S3), true);
resolution = 20;
T6 = CYLIN(vector( 1.2, 0.0, -0.1), vector( 0.0, 0.0, 0.5), 0.1);
T7 = CYLIN(vector(-1.2, 0.0, -0.1), vector( 0.0, 0.0, 0.5), 0.1);
S4 = S3 - T6 - T7;
free(T6);
free(T7);
beep(1200,200);
view(list(S4), true);
resolution = 32;
T8 = CYLIN(vector( 0.0, 0.0, -0.2 ), vector( 0.0, 0.0, 0.9 ), 0.3);
T9 = BOX(vector( -0.6, -0.15,-0.1 ), 1.2, 0.3, 0.7 );
S5 = T8 + T9;
free(T8);
free(T9);
beep(1200,200);
view(list(S5), false);
S6 = S4 - S5;
free(S4);
free(S5);
final = convex(S6);
free(S6);
tm = time(false);
tm; # In Seconds
interact(list(final), false);
save("solid2h", list(view_mat,final));
free(final);
view_mat = save_mat;
resolution = save_res;