sun.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Created: 08.04.2018
  2. # Copyright (c) 2018, Manfred Moitzi
  3. # License: MIT-License
  4. from .dxfobjects import ExtendedTags, DXFAttr, DefSubclass, DXFAttributes
  5. from .dxfobjects import none_subclass, DXFObject
  6. _SUN_CLS = """0
  7. CLASS
  8. 1
  9. SUN
  10. 2
  11. AcDbSun
  12. 3
  13. SCENEOE
  14. 90
  15. 1153
  16. 91
  17. 0
  18. 280
  19. 0
  20. 281
  21. 0
  22. """
  23. _SUN_TPL = """0
  24. SUN
  25. 5
  26. 0
  27. 330
  28. 0
  29. 100
  30. AcDbSun
  31. 90
  32. 1
  33. 290
  34. 1
  35. 63
  36. 7
  37. 421
  38. 16777215
  39. 40
  40. 1.0
  41. 291
  42. 1
  43. 91
  44. 2456922
  45. 92
  46. 43200
  47. 292
  48. 0
  49. 70
  50. 0
  51. 71
  52. 256
  53. 280
  54. 1
  55. """
  56. sun_subclass = DefSubclass('AcDbSun', {
  57. 'version': DXFAttr(90),
  58. 'status': DXFAttr(290),
  59. 'color': DXFAttr(63),
  60. 'true_color': DXFAttr(421),
  61. 'intensity': DXFAttr(40),
  62. 'shadows': DXFAttr(291),
  63. 'julian_day': DXFAttr(91),
  64. 'time': DXFAttr(92), # Time (in seconds past midnight)
  65. 'daylight_savings_time': DXFAttr(292),
  66. 'shadow_type': DXFAttr(70), # Shadow type 0 = Ray traced shadows; 1 = Shadow maps
  67. 'shadow_map_size': DXFAttr(71),
  68. 'shadow_softness': DXFAttr(280),
  69. })
  70. class Sun(DXFObject):
  71. # Requires AC1021/R2007
  72. __slots__ = ()
  73. TEMPLATE = ExtendedTags.from_text(_SUN_TPL)
  74. CLASS = ExtendedTags.from_text(_SUN_CLS)
  75. DXFATTRIBS = DXFAttributes(none_subclass, sun_subclass)