home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
i
/
iritsm3s.zip
/
irit
/
cubes.irt
< prev
next >
Wrap
Text File
|
1991-11-05
|
1KB
|
48 lines
#
# Model from "Partitioning Polyhedral Objects into Nonintersecting parts'
# by mark Segal and Carlo H. Sequin, IEE CG&A, January 1988, pp 53-67.
#
b1 = box(vector( 0.2, 0.2, 0.2), 0.8, 0.8, 0.8);
b2 = box(vector( 0.2, 0.2, -0.2), 0.8, 0.8, -0.8);
b3 = box(vector( 0.2, -0.2, 0.2), 0.8, -0.8, 0.8);
b4 = box(vector( 0.2, -0.2, -0.2), 0.8, -0.8, -0.8);
b5 = box(vector( -0.2, 0.2, 0.2), -0.8, 0.8, 0.8);
b6 = box(vector( -0.2, 0.2, -0.2), -0.8, 0.8, -0.8);
b7 = box(vector( -0.2, -0.2, 0.2), -0.8, -0.8, 0.8);
b8 = box(vector( -0.2, -0.2, -0.2), -0.8, -0.8, -0.8);
cubes = b1 ^ b2 ^ b3 ^ b4 ^ b5 ^ b6 ^ b7 ^ b8;
free(b1); free(b2); free(b3); free(b4); free(b5); free(b6); free(b7); free(b8);
rot_cubes = cubes * rotx(30) * rotz(25);
intercrv = true;
crvs_cubes = cubes + rot_cubes;
# interact(list(crvs_cubes), 0);
interact(list(crvs_cubes, cubes, rot_cubes), 0);
free(crvs_cubes);
intercrv = false;
u_cubes = cubes + rot_cubes;
interact(list(u_cubes), 0);
i_cubes = cubes * rot_cubes;
interact(list(i_cubes), 0);
s_cubes = cubes - rot_cubes;
interact(list(s_cubes), 0);
view_mat = rotx(0);
u_cubes = convex(u_cubes);
i_cubes = convex(i_cubes);
s_cubes = convex(s_cubes);
save("cubes_u", list(view_mat, u_cubes));
save("cubes_i", list(view_mat, i_cubes));
save("cubes_s", list(view_mat, s_cubes));
free(u_cubes); free(i_cubes); free(s_cubes);
free(cubes);
free(rot_cubes);