home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / 3d / irit / scripts / gearbox.irt < prev    next >
Encoding:
Text File  |  1994-06-23  |  2.5 KB  |  88 lines

  1. #
  2. # This is the DtoP custom designed Gearbox 'EndPlate'
  3. #             Designed by Andy Bray <A.D.Bray@lut.ac.uk> 1992
  4. #
  5.  
  6. time(true);
  7.  
  8. save_mat = view_mat;
  9. view_mat = view_mat * scale(vector( 0.13, 0.13, 0.13 ));
  10. save_res = resolution;
  11.  
  12. iritstate("coplanar", true); # Try it with 'iritstate("coplanar", false);'
  13.  
  14. Box1 = BOX(vector( 0.0, 0.0, 1.0), 7.8, 10.4, 1.6);
  15. #If the line below is uncommented, then the file fails at the first operation
  16. #most other resolutions work without problem. This could be because
  17. #coincidentally something approximates colinear when it is not, but in that
  18. #case a resultion of 50 or 20 might do it, and do not.
  19. #resolution = 10;
  20. Hole1 = CYLIN(vector( 1.0, 1.0, 2.601), vector( 0.0, 0.0, -1.6015), 0.3);
  21. Solid1 = Box1 - Hole1;
  22. free(Hole1);
  23. #free(Box1);
  24. view(list(view_mat, Solid1), true);
  25.  
  26. #resolution = 20;
  27. Hole2 = CYLIN(vector( 6.8, 1.0, 2.601), vector( 0.0, 0.0, -1.6015), 0.3);
  28. Solid2 = Solid1 - Hole2;
  29. free(Hole2);
  30. #free(Solid1);
  31. view(Solid2, true);
  32.  
  33. Hole3 = CYLIN(vector( 1.0, 9.4, 2.601), vector( 0.0, 0.0, -1.6015), 0.3);
  34. Solid3 = Solid2 - Hole3;
  35. free(Hole3);
  36. #free(Solid2);
  37. view(Solid3, true);
  38.  
  39. Hole4 = CYLIN(vector( 6.8, 9.4, 2.601), vector( 0.0, 0.0, -1.6015), 0.3);
  40. Solid4 = Solid3 - Hole4;
  41. free(Hole4);
  42. #free(Solid3);
  43. view(Solid4, true);
  44.  
  45. Pocket1 = CYLIN(vector( 3.9, 3.9, 2.601), vector( 0.0, 0.0, -0.501), 2.4);
  46. Pocket2 = CYLIN(vector( 3.9, 6.5, 2.601), vector( 0.0, 0.0, -0.501), 1.4);
  47. view(list(Pocket1, Pocket2), true);
  48. Pockets = Pocket1 + Pocket2;
  49. free(Pocket1);
  50. free(Pocket2);
  51.  
  52. intsolid5 = Solid4 - Pockets;
  53. solid5 = convex(intsolid5);
  54. free(pockets);
  55. free(intsolid5);
  56.  
  57. resolution = save_res;
  58.  
  59. Hole5 = CYLIN(vector( 3.91, 3.91, 2.602), vector( 0.0, 0.0, -2.603), 0.3);
  60. Solid6 = Solid5 - Hole5;
  61. free(Hole5);
  62. #free(Solid5);
  63. view(Solid6, true);
  64.  
  65. # This hole passes straight through the centre of pocket2. If pocket2 and this
  66. #hole are moved away from pocket1, then the error passes.  Unless I am
  67. #mistaken, (I have been messing around with this) pocket1 does not pass
  68. #through the centre of hole6, and they do not (quite) have colinear surfaces
  69. #Even if quite big variations are tries, it still seems to fail.  I have got
  70. #irit to draw this component by changing some of the values by 4 or 5, but
  71. #small order numbers appear to have little effect.  
  72. Hole6 = CYLIN(vector( 3.9, 6.5, 2.602), vector( 0.0, 0.0, -2.603), 0.3);
  73. Solid7 = Solid6 - Hole6;
  74. free(Hole6);
  75. #free(Solid5);
  76. view(Solid7, true);
  77. resolution = save_res;
  78.  
  79. interact(Solid7);
  80.  
  81. cnvx7 = CONVEX( Solid7 );
  82.  
  83. view(cnvx7, true);
  84. save("end_plate2", cnvx7);
  85.  
  86. view_mat = save_mat;
  87. resolution = save_res;
  88.