home *** CD-ROM | disk | FTP | other *** search
- #
- # The most common example of wireframe ambiguity. See for example:
- # Geometric Modeling by Michael E. Mortenson, page 4...
- #
-
- save_res = resolution;
- save_view = view_mat;
-
- view_mat = view_mat * scale(vector(0.6, 0.6, 0.6)) * rotx(30) * roty(20);
-
- A = box(vector(-0.5, -0.5, -0.55), 1.0, 1.0, 1.1);
-
- resolution = 4; # To create 4 sided pyramids from cones...
- C1 = cone(vector(0.0, 0.0, -0.6), vector(0.0, 0.0, 0.6), 0.6 * sqrt(2.0)) *
- rotz(45);
- C2 = cone(vector(0.0, 0.0, 0.6), vector(0.0, 0.0, -0.6), 0.6 * sqrt(2.0)) *
- rotz(45);
-
- A = A - C1 - C2;
- free(C1);
- free(C2);
- view(list(A), 1);
-
- B = box(vector(-0.3, -0.3, -1.0), 0.6, 0.6, 2.0);
- C = A - B;
- free(A);
- free(B);
-
- final = convex(C);
- free(C);
-
- beep(1000,100);
- interact(list(final), 0);
-
- save("ambiguit", list(view_mat,final));
- free(final);
-
- view_mat = save_view;
- resolution = save_res;
-