cad.tcl 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # This script creates a model described at
  2. # http://www.caddd.org/2010/04/opencascade-challenge.html
  3. #Category: Modeling
  4. #Title: CAD shape
  5. pload MODELING VISUALIZATION
  6. # make base
  7. box b0 0 0 0 12 7 6
  8. explode b0 e
  9. blend b01 b0 1 b0_8
  10. blend b02 b01 1 b0_6
  11. # make cut at bottom
  12. box b1 3 -1 0 2 9 1.5
  13. bcut b2 b02 b1
  14. explode b2 e
  15. blend b3 b2 1 b2_27
  16. blend b4 b3 1 b2_30
  17. # make central cut
  18. box h1 3 -1 2.5 2 9 0.5
  19. box h2 3 -1 3 2 9 2
  20. plane p 4 -1 3 0 1 0
  21. pcylinder c p 1 9
  22. bcommon h3 h2 c
  23. bcut b5 b4 h1
  24. bcut b6 b5 h3
  25. # make side cut
  26. box b7 9 -1 1 2 9 4
  27. explode b7 e
  28. blend b71 b7 1 b7_6
  29. blend b72 b71 1 b7_8
  30. bcut b8 b6 b72
  31. # make box for inner cylindrical cut
  32. box bc1 -1 0 2 9 1 4
  33. box bc2 2 -1 2 4 3 3
  34. bcut bc3 bc1 bc2
  35. explode bc3 e
  36. blend bc4 bc3 1 bc3_20
  37. blend bc5 bc4 1 bc3_23
  38. blend bc6 bc5 1.99 bc3_21
  39. blend bc7 bc6 1.99 bc3_22
  40. # make inner cylindrical cut
  41. explode bc7 f
  42. revol r bc7_1 -1 0 6 1 0 0 100
  43. bcut b9 b8 r
  44. # make outer cylindrical cut
  45. plane p2 -1 0 6 1 0 0
  46. pcylinder c2 p2 6 15
  47. bcommon res b9 c2
  48. # show result
  49. donly res
  50. trotate res 0 0 0 0 0 1 90
  51. vinit View1
  52. vdisplay -dispMode 1 res
  53. vaspects res -setFaceBoundaryDraw 1 -setFaceBoundaryColor WHITE -isoontriangulation 1
  54. vfit