logo2019.tcl 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # The following example constructs a 3D object looking like new OCC logo on top view.
  2. #
  3. #Category: Modeling
  4. #Title: OCC Logo 2019
  5. pload MODELING VISUALIZATION XDE OCAF
  6. # spheric body
  7. psphere s 1
  8. box b 0 0 -2 1.5 1.5 4
  9. bcut sb s b
  10. # toroidal handle
  11. ptorus t 1 0.5
  12. trotate t 0 0 0 0 0 1 -90
  13. ttranslate t 1.5 1.5 0
  14. bcut tb t b
  15. pcylinder p1 0.5 0.5
  16. trotate p1 0 0 0 0 0 1 180
  17. trotate p1 0 0 0 1 0 0 90
  18. ttranslate p1 0.5 1.5 0
  19. pcylinder p2 0.5 0.5
  20. trotate p2 0 0 0 0 0 1 180
  21. trotate p2 0 0 0 1 0 0 90
  22. trotate p2 0 0 0 0 0 1 90
  23. ttranslate p2 1 0.5 0
  24. bfuse tp tb p1
  25. bfuse tp tp p2
  26. # intermediate part
  27. # - get surfaces and edges on half of spheric and toroidal parts for filling
  28. box b -2 -2 -2 4 4 2
  29. bcut sbh sb b
  30. bcut tph tp b
  31. unset b
  32. explode sbh f
  33. renamevar sbh_1 sbf
  34. explode sbf e
  35. explode tph f
  36. renamevar tph_2 tpf1
  37. renamevar tph_13 tpf2
  38. explode tpf1 e
  39. explode tpf2 e
  40. # - make curved surface by plate
  41. #plate r 0 4 tpf1_1 tpf1 1 tpf2_3 tpf2 1 sbf_2 sbf 1 sbf_4 sbf 1
  42. approxplate r1 0 4 tpf1_1 tpf1 0 tpf2_1 tpf2 0 sbf_2 sbf 0 sbf_4 sbf 0 0.00001 100 3 0
  43. # - make solid
  44. tcopy r1 r2
  45. tmirror r2 0 0 0 0 0 1
  46. explode sb f
  47. explode tp f
  48. sewing rr 0.001 r1 r2 sb_2 sb_3 tp_2 tp_5
  49. ssolid rr rs
  50. # rotate all solids by 45 deg to have standard orientation of the logo on top view
  51. trotate sb 0 0 0 0 0 1 -45
  52. trotate tp 0 0 0 0 0 1 -45
  53. trotate rs 0 0 0 0 0 1 -45
  54. # create XDE document
  55. catch {Close D}
  56. XNewDoc D
  57. set main [XNewShape D]
  58. XAddComponent D $main sb
  59. XAddComponent D $main tp
  60. XAddComponent D $main rs
  61. XUpdateAssemblies D
  62. SetName D $main "OCC Logo 2019"
  63. SetName D [XFindShape D sb] "Core"
  64. SetName D [XFindShape D tp] "Loop"
  65. SetName D [XFindShape D rs] "Connector"
  66. XSetColor D sb FF3652
  67. XSetColor D tp 00AADA
  68. XSetColor D rs 0073B0
  69. # display
  70. vinit View1
  71. vbackground -color WHITE
  72. XDisplay -dispMode 1 D
  73. vtop
  74. vfit