pencil.tcl 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Sample demonstrating assignment of colors to faces in XDE
  2. #Category: XDE
  3. #Title: Assignment of colors to faces
  4. pload MODELING VISUALIZATION OCAF XDE
  5. box b 0 -20 -10 100 40 20
  6. compound b b b a
  7. explode a
  8. trotate a_1 0 0 0 1 0 0 60
  9. trotate a_2 0 0 0 1 0 0 -60
  10. bcommon b a a_1
  11. bcommon b b a_2
  12. pcylinder c 4 100
  13. trotate c 0 0 0 0 1 0 90
  14. psphere s 1.4
  15. ttranslate s 99.2 0 0
  16. bfuse cx c s
  17. pcone e 60 0.5 101
  18. trotate e 0 0 0 0 1 0 90
  19. bcommon body b e
  20. bcut body body c
  21. bcommon core cx e
  22. text2brep text "CAD Assistant" -font Times -height 10
  23. ttranslate text 10 -4 10
  24. prism tr text 0 0 -1
  25. bfuse body body tr
  26. donly body core
  27. #vdisplay body core
  28. #vsetcolor body yellow
  29. #vsetcolor core red
  30. explode body so
  31. explode body_1 f
  32. explode core so
  33. NewDocument D
  34. XAddShape D body_1
  35. XAddShape D core_1
  36. for {set i 1} {$i <= 26} {incr i} {XSetColor D body_1_$i BLUE}
  37. XSetColor D body_1_1 E68066
  38. XSetColor D body_1_9 E68066
  39. for {set i 10} {$i <= 22} {incr i} {XSetColor D body_1_$i 99B300}
  40. XSetColor D core_1 1A1AFF
  41. foreach ff [explode core_1 f] { XSetColor D $ff 1A1AFF ; puts "set color $ff" }
  42. vclear
  43. vinit View1
  44. XDisplay -dispMode 1 D -explore
  45. vfit
  46. vrenderparams -msaa 8
  47. vbackground -color WHITE
  48. #param write.iges.brep.mode 1
  49. #WriteIges D d:/pencil3.igs