@casmo/tree.js 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/README.md +106 -16
  2. package/dist/apply-CcodnAbs.js +250 -0
  3. package/dist/apply-CcodnAbs.js.map +1 -0
  4. package/dist/bake/index.d.ts +2 -2
  5. package/dist/bake/index.d.ts.map +1 -1
  6. package/dist/definition/crown-shape.d.ts +9 -0
  7. package/dist/definition/crown-shape.d.ts.map +1 -0
  8. package/dist/definition/defaults.d.ts +7 -1
  9. package/dist/definition/defaults.d.ts.map +1 -1
  10. package/dist/definition/index.d.ts +4 -3
  11. package/dist/definition/index.d.ts.map +1 -1
  12. package/dist/definition/migrations.d.ts +0 -8
  13. package/dist/definition/migrations.d.ts.map +1 -1
  14. package/dist/definition/schema.d.ts.map +1 -1
  15. package/dist/definition/types.d.ts +95 -6
  16. package/dist/definition/types.d.ts.map +1 -1
  17. package/dist/effects/mask.d.ts +3 -3
  18. package/dist/effects/mask.d.ts.map +1 -1
  19. package/dist/effects.js +3 -3
  20. package/dist/effects.js.map +1 -1
  21. package/dist/forest/Forest.d.ts +10 -1
  22. package/dist/forest/Forest.d.ts.map +1 -1
  23. package/dist/forest/nodes.d.ts +4 -1
  24. package/dist/forest/nodes.d.ts.map +1 -1
  25. package/dist/{forest-OX9WvAwh.js → forest-DTrD8puH.js} +695 -546
  26. package/dist/forest-DTrD8puH.js.map +1 -0
  27. package/dist/generator/branches.d.ts +2 -2
  28. package/dist/generator/branches.d.ts.map +1 -1
  29. package/dist/generator/fruit.d.ts +28 -0
  30. package/dist/generator/fruit.d.ts.map +1 -0
  31. package/dist/generator/growth.d.ts +1 -1
  32. package/dist/generator/growth.d.ts.map +1 -1
  33. package/dist/generator/index.d.ts +4 -4
  34. package/dist/generator/index.d.ts.map +1 -1
  35. package/dist/generator/leaf-shapes.d.ts +33 -1
  36. package/dist/generator/leaf-shapes.d.ts.map +1 -1
  37. package/dist/generator/trunk.d.ts +8 -2
  38. package/dist/generator/trunk.d.ts.map +1 -1
  39. package/dist/generator/types.d.ts +34 -5
  40. package/dist/generator/types.d.ts.map +1 -1
  41. package/dist/index.d.ts +4 -2
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +48 -4
  44. package/dist/index.js.map +1 -1
  45. package/dist/materials/index.d.ts +6 -0
  46. package/dist/materials/index.d.ts.map +1 -1
  47. package/dist/names-C6-wuJ29.js +589 -0
  48. package/dist/names-C6-wuJ29.js.map +1 -0
  49. package/dist/react/Tree.d.ts +5 -2
  50. package/dist/react/Tree.d.ts.map +1 -1
  51. package/dist/react.js +10 -6
  52. package/dist/react.js.map +1 -1
  53. package/dist/season/nodes.d.ts +16 -0
  54. package/dist/season/nodes.d.ts.map +1 -1
  55. package/dist/season/profile.d.ts +26 -0
  56. package/dist/season/profile.d.ts.map +1 -1
  57. package/dist/species/almond.js +213 -0
  58. package/dist/species/almond.js.map +1 -0
  59. package/dist/species/almond.json +201 -0
  60. package/dist/species/apple.js +220 -0
  61. package/dist/species/apple.js.map +1 -0
  62. package/dist/species/apple.json +211 -0
  63. package/dist/species/ash.js +177 -0
  64. package/dist/species/ash.js.map +1 -0
  65. package/dist/species/ash.json +168 -0
  66. package/dist/species/beech.js +164 -0
  67. package/dist/species/beech.js.map +1 -0
  68. package/dist/species/beech.json +158 -0
  69. package/dist/species/birch.js +160 -0
  70. package/dist/species/birch.js.map +1 -0
  71. package/dist/species/birch.json +154 -0
  72. package/dist/species/catalog.d.ts +61 -0
  73. package/dist/species/catalog.d.ts.map +1 -0
  74. package/dist/species/cedar.js +159 -0
  75. package/dist/species/cedar.js.map +1 -0
  76. package/dist/species/cedar.json +159 -0
  77. package/dist/species/cherry.js +227 -0
  78. package/dist/species/cherry.js.map +1 -0
  79. package/dist/species/cherry.json +215 -0
  80. package/dist/species/chestnut.js +220 -0
  81. package/dist/species/chestnut.js.map +1 -0
  82. package/dist/species/chestnut.json +211 -0
  83. package/dist/species/douglas-fir.js +164 -0
  84. package/dist/species/douglas-fir.js.map +1 -0
  85. package/dist/species/douglas-fir.json +161 -0
  86. package/dist/species/elm.js +163 -0
  87. package/dist/species/elm.js.map +1 -0
  88. package/dist/species/elm.json +154 -0
  89. package/dist/species/hemlock.js +165 -0
  90. package/dist/species/hemlock.js.map +1 -0
  91. package/dist/species/hemlock.json +162 -0
  92. package/dist/species/hickory.js +190 -0
  93. package/dist/species/hickory.js.map +1 -0
  94. package/dist/species/hickory.json +183 -0
  95. package/dist/species/index.d.ts +10 -0
  96. package/dist/species/index.d.ts.map +1 -0
  97. package/dist/species/juniper.js +148 -0
  98. package/dist/species/juniper.js.map +1 -0
  99. package/dist/species/juniper.json +145 -0
  100. package/dist/species/loaders.d.ts +7 -0
  101. package/dist/species/loaders.d.ts.map +1 -0
  102. package/dist/species/mahogany.js +191 -0
  103. package/dist/species/mahogany.js.map +1 -0
  104. package/dist/species/mahogany.json +187 -0
  105. package/dist/species/maple.js +167 -0
  106. package/dist/species/maple.js.map +1 -0
  107. package/dist/species/maple.json +162 -0
  108. package/dist/species/oak.js +210 -0
  109. package/dist/species/oak.js.map +1 -0
  110. package/dist/species/oak.json +203 -0
  111. package/dist/species/olive.js +179 -0
  112. package/dist/species/olive.js.map +1 -0
  113. package/dist/species/olive.json +172 -0
  114. package/dist/species/peach.js +213 -0
  115. package/dist/species/peach.js.map +1 -0
  116. package/dist/species/peach.json +201 -0
  117. package/dist/species/pear.js +203 -0
  118. package/dist/species/pear.js.map +1 -0
  119. package/dist/species/pear.json +191 -0
  120. package/dist/species/pine.js +153 -0
  121. package/dist/species/pine.js.map +1 -0
  122. package/dist/species/pine.json +153 -0
  123. package/dist/species/plum.js +227 -0
  124. package/dist/species/plum.js.map +1 -0
  125. package/dist/species/plum.json +215 -0
  126. package/dist/species/red-oak.js +210 -0
  127. package/dist/species/red-oak.js.map +1 -0
  128. package/dist/species/red-oak.json +203 -0
  129. package/dist/species/redwood.js +164 -0
  130. package/dist/species/redwood.js.map +1 -0
  131. package/dist/species/redwood.json +161 -0
  132. package/dist/species/sequoia.js +157 -0
  133. package/dist/species/sequoia.js.map +1 -0
  134. package/dist/species/sequoia.json +157 -0
  135. package/dist/species/spruce.js +160 -0
  136. package/dist/species/spruce.js.map +1 -0
  137. package/dist/species/spruce.json +157 -0
  138. package/dist/species/teak.js +156 -0
  139. package/dist/species/teak.js.map +1 -0
  140. package/dist/species/teak.json +148 -0
  141. package/dist/species/types.d.ts +61 -0
  142. package/dist/species/types.d.ts.map +1 -0
  143. package/dist/species/walnut.js +210 -0
  144. package/dist/species/walnut.js.map +1 -0
  145. package/dist/species/walnut.json +203 -0
  146. package/dist/species/white-oak.js +203 -0
  147. package/dist/species/white-oak.js.map +1 -0
  148. package/dist/species/white-oak.json +199 -0
  149. package/dist/species.js +160 -0
  150. package/dist/species.js.map +1 -0
  151. package/dist/styles/apply.d.ts +12 -0
  152. package/dist/styles/apply.d.ts.map +1 -0
  153. package/dist/styles/low-poly/index.d.ts +1 -1
  154. package/dist/styles/low-poly/index.d.ts.map +1 -1
  155. package/dist/styles/low-poly.js +9 -8
  156. package/dist/styles/low-poly.js.map +1 -1
  157. package/dist/styles/names.d.ts +28 -0
  158. package/dist/styles/names.d.ts.map +1 -0
  159. package/dist/styles/realistic/index.d.ts +3 -8
  160. package/dist/styles/realistic/index.d.ts.map +1 -1
  161. package/dist/styles/realistic/textures.d.ts +20 -0
  162. package/dist/styles/realistic/textures.d.ts.map +1 -0
  163. package/dist/styles/realistic.js +10 -16
  164. package/dist/styles/realistic.js.map +1 -1
  165. package/dist/styles/registry.d.ts +2 -13
  166. package/dist/styles/registry.d.ts.map +1 -1
  167. package/dist/styles/stylized/index.d.ts +1 -1
  168. package/dist/styles/stylized/index.d.ts.map +1 -1
  169. package/dist/styles/stylized.js +9 -8
  170. package/dist/styles/stylized.js.map +1 -1
  171. package/dist/styles/types.d.ts +16 -2
  172. package/dist/styles/types.d.ts.map +1 -1
  173. package/dist/textures/realistic/bark-fibrous-normal.png +0 -0
  174. package/dist/textures/realistic/bark-fibrous.png +0 -0
  175. package/dist/textures/realistic/bark-papery-normal.png +0 -0
  176. package/dist/textures/realistic/bark-papery.png +0 -0
  177. package/dist/textures/realistic/bark-plated-normal.png +0 -0
  178. package/dist/textures/realistic/bark-plated.png +0 -0
  179. package/dist/textures/realistic/bark-smooth-normal.png +0 -0
  180. package/dist/textures/realistic/bark-smooth.png +0 -0
  181. package/dist/textures/realistic/leaf-compound.png +0 -0
  182. package/dist/textures/realistic/leaf-lobed.png +0 -0
  183. package/dist/textures/realistic/leaf-palmate.png +0 -0
  184. package/dist/textures/realistic/scale.png +0 -0
  185. package/dist/tree/Tree.d.ts +6 -4
  186. package/dist/tree/Tree.d.ts.map +1 -1
  187. package/package.json +9 -2
  188. package/dist/forest-OX9WvAwh.js.map +0 -1
  189. package/dist/types-BZjHhNz7.js +0 -20
  190. package/dist/types-BZjHhNz7.js.map +0 -1
@@ -0,0 +1,160 @@
1
+ // src/species/data/spruce.json
2
+ var id = "spruce";
3
+ var name = "Spruce";
4
+ var form = "conifer";
5
+ var trunk = {
6
+ "length": 8,
7
+ "radius": .24,
8
+ "taper": .1,
9
+ "lengthVariation": .12,
10
+ "bend": .02
11
+ };
12
+ var branches = [{
13
+ "angleVariation": .06,
14
+ "spiral": 137.5,
15
+ "lengthVariation": .15,
16
+ "taper": .3,
17
+ "bend": .04,
18
+ "gravity": -.08,
19
+ "lengthProfile": [
20
+ {
21
+ "t": .04,
22
+ "value": 1
23
+ },
24
+ {
25
+ "t": .93,
26
+ "value": .1
27
+ },
28
+ {
29
+ "t": 1,
30
+ "value": .08
31
+ }
32
+ ],
33
+ "angleProfile": [
34
+ {
35
+ "t": .04,
36
+ "value": 1.05
37
+ },
38
+ {
39
+ "t": .7,
40
+ "value": .9
41
+ },
42
+ {
43
+ "t": 1,
44
+ "value": .45
45
+ }
46
+ ],
47
+ "count": 20,
48
+ "start": .04,
49
+ "end": .93,
50
+ "angle": 90,
51
+ "length": .32,
52
+ "radius": .3
53
+ }, {
54
+ "angleVariation": .15,
55
+ "spiral": 120,
56
+ "lengthVariation": .15,
57
+ "taper": .3,
58
+ "bend": .05,
59
+ "gravity": -.25,
60
+ "count": 3,
61
+ "start": .3,
62
+ "end": 1,
63
+ "angle": 45,
64
+ "length": .45,
65
+ "radius": .5
66
+ }];
67
+ var foliage = {
68
+ "type": "needle",
69
+ "density": .18,
70
+ "size": .92,
71
+ "sizeVariation": .2,
72
+ "start": 0,
73
+ "angle": 35
74
+ };
75
+ var bark = {
76
+ "type": "plated",
77
+ "color": "#928070"
78
+ };
79
+ var fruit = {
80
+ "type": "cone",
81
+ "count": .12,
82
+ "size": .24,
83
+ "sizeVariation": .2,
84
+ "hang": 1
85
+ };
86
+ var season = {
87
+ "leafColor": [
88
+ {
89
+ "t": 0,
90
+ "value": "#3f7048"
91
+ },
92
+ {
93
+ "t": .25,
94
+ "value": "#2a5638"
95
+ },
96
+ {
97
+ "t": .55,
98
+ "value": "#2a5638"
99
+ },
100
+ {
101
+ "t": .75,
102
+ "value": "#22462e"
103
+ },
104
+ {
105
+ "t": .92,
106
+ "value": "#22462e"
107
+ },
108
+ {
109
+ "t": 1,
110
+ "value": "#3f7048"
111
+ }
112
+ ],
113
+ "leafCoverage": [{
114
+ "t": 0,
115
+ "value": 1
116
+ }],
117
+ "blossom": [{
118
+ "t": 0,
119
+ "value": 0
120
+ }],
121
+ "blossomColor": "#c9b46a",
122
+ "fruit": [{
123
+ "t": 0,
124
+ "value": 1
125
+ }],
126
+ "fruitColor": [{
127
+ "t": .15,
128
+ "value": "#7a8f3a"
129
+ }, {
130
+ "t": .55,
131
+ "value": "#7a5434"
132
+ }]
133
+ };
134
+ var wind = {
135
+ "trunk": .08,
136
+ "branches": .3,
137
+ "leaves": .35,
138
+ "frequency": .8
139
+ };
140
+ var variation = {
141
+ "color": .08,
142
+ "growth": .1,
143
+ "season": .05
144
+ };
145
+ var spruce_default = {
146
+ id,
147
+ name,
148
+ form,
149
+ trunk,
150
+ branches,
151
+ foliage,
152
+ bark,
153
+ fruit,
154
+ season,
155
+ wind,
156
+ variation
157
+ };
158
+ export { bark, branches, spruce_default as default, foliage, form, fruit, id, name, season, trunk, variation, wind };
159
+
160
+ //# sourceMappingURL=spruce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spruce.js","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,157 @@
1
+ {
2
+ "id": "spruce",
3
+ "name": "Spruce",
4
+ "form": "conifer",
5
+ "trunk": {
6
+ "length": 8,
7
+ "radius": 0.24,
8
+ "taper": 0.1,
9
+ "lengthVariation": 0.12,
10
+ "bend": 0.02
11
+ },
12
+ "branches": [
13
+ {
14
+ "angleVariation": 0.06,
15
+ "spiral": 137.5,
16
+ "lengthVariation": 0.15,
17
+ "taper": 0.3,
18
+ "bend": 0.04,
19
+ "gravity": -0.08,
20
+ "lengthProfile": [
21
+ {
22
+ "t": 0.04,
23
+ "value": 1.0
24
+ },
25
+ {
26
+ "t": 0.93,
27
+ "value": 0.1
28
+ },
29
+ {
30
+ "t": 1.0,
31
+ "value": 0.08
32
+ }
33
+ ],
34
+ "angleProfile": [
35
+ {
36
+ "t": 0.04,
37
+ "value": 1.05
38
+ },
39
+ {
40
+ "t": 0.7,
41
+ "value": 0.9
42
+ },
43
+ {
44
+ "t": 1.0,
45
+ "value": 0.45
46
+ }
47
+ ],
48
+ "count": 20,
49
+ "start": 0.04,
50
+ "end": 0.93,
51
+ "angle": 90,
52
+ "length": 0.32,
53
+ "radius": 0.3
54
+ },
55
+ {
56
+ "angleVariation": 0.15,
57
+ "spiral": 120,
58
+ "lengthVariation": 0.15,
59
+ "taper": 0.3,
60
+ "bend": 0.05,
61
+ "gravity": -0.25,
62
+ "count": 3,
63
+ "start": 0.3,
64
+ "end": 1,
65
+ "angle": 45,
66
+ "length": 0.45,
67
+ "radius": 0.5
68
+ }
69
+ ],
70
+ "foliage": {
71
+ "type": "needle",
72
+ "density": 0.18,
73
+ "size": 0.92,
74
+ "sizeVariation": 0.2,
75
+ "start": 0,
76
+ "angle": 35
77
+ },
78
+ "bark": {
79
+ "type": "plated",
80
+ "color": "#928070"
81
+ },
82
+ "fruit": {
83
+ "type": "cone",
84
+ "count": 0.12,
85
+ "size": 0.24,
86
+ "sizeVariation": 0.2,
87
+ "hang": 1
88
+ },
89
+ "season": {
90
+ "leafColor": [
91
+ {
92
+ "t": 0,
93
+ "value": "#3f7048"
94
+ },
95
+ {
96
+ "t": 0.25,
97
+ "value": "#2a5638"
98
+ },
99
+ {
100
+ "t": 0.55,
101
+ "value": "#2a5638"
102
+ },
103
+ {
104
+ "t": 0.75,
105
+ "value": "#22462e"
106
+ },
107
+ {
108
+ "t": 0.92,
109
+ "value": "#22462e"
110
+ },
111
+ {
112
+ "t": 1,
113
+ "value": "#3f7048"
114
+ }
115
+ ],
116
+ "leafCoverage": [
117
+ {
118
+ "t": 0,
119
+ "value": 1
120
+ }
121
+ ],
122
+ "blossom": [
123
+ {
124
+ "t": 0,
125
+ "value": 0
126
+ }
127
+ ],
128
+ "blossomColor": "#c9b46a",
129
+ "fruit": [
130
+ {
131
+ "t": 0,
132
+ "value": 1
133
+ }
134
+ ],
135
+ "fruitColor": [
136
+ {
137
+ "t": 0.15,
138
+ "value": "#7a8f3a"
139
+ },
140
+ {
141
+ "t": 0.55,
142
+ "value": "#7a5434"
143
+ }
144
+ ]
145
+ },
146
+ "wind": {
147
+ "trunk": 0.08,
148
+ "branches": 0.3,
149
+ "leaves": 0.35,
150
+ "frequency": 0.8
151
+ },
152
+ "variation": {
153
+ "color": 0.08,
154
+ "growth": 0.1,
155
+ "season": 0.05
156
+ }
157
+ }
@@ -0,0 +1,156 @@
1
+ // src/species/data/teak.json
2
+ var id = "teak";
3
+ var name = "Teak";
4
+ var form = "broadleaf";
5
+ var trunk = {
6
+ "length": 7.5,
7
+ "radius": .4,
8
+ "taper": .36,
9
+ "lengthVariation": .1,
10
+ "bend": .08
11
+ };
12
+ var branches = [{
13
+ "angleVariation": .15,
14
+ "spiral": 137.5,
15
+ "lengthVariation": .15,
16
+ "taper": .42,
17
+ "bend": .12,
18
+ "gravity": .1,
19
+ "lengthProfile": [{
20
+ "t": .62,
21
+ "value": 1
22
+ }, {
23
+ "t": 1,
24
+ "value": .55
25
+ }],
26
+ "count": 7,
27
+ "start": .62,
28
+ "end": .96,
29
+ "angle": 50,
30
+ "length": .4,
31
+ "radius": .6
32
+ }, {
33
+ "angleVariation": .15,
34
+ "spiral": 137.5,
35
+ "lengthVariation": .15,
36
+ "taper": .45,
37
+ "bend": .12,
38
+ "gravity": .15,
39
+ "count": 4,
40
+ "start": .35,
41
+ "end": 1,
42
+ "angle": 45,
43
+ "length": .6,
44
+ "radius": .6
45
+ }];
46
+ var foliage = {
47
+ "type": "broad",
48
+ "density": .3,
49
+ "size": 1.25,
50
+ "sizeVariation": .25,
51
+ "start": .3,
52
+ "angle": 60
53
+ };
54
+ var bark = {
55
+ "type": "fibrous",
56
+ "color": "#a39886"
57
+ };
58
+ var season = {
59
+ "leafColor": [
60
+ {
61
+ "t": 0,
62
+ "value": "#8fb04a"
63
+ },
64
+ {
65
+ "t": .15,
66
+ "value": "#4c7a2e"
67
+ },
68
+ {
69
+ "t": .6,
70
+ "value": "#4c7a2e"
71
+ },
72
+ {
73
+ "t": .7,
74
+ "value": "#8a6e3a"
75
+ },
76
+ {
77
+ "t": .85,
78
+ "value": "#7a5a32"
79
+ },
80
+ {
81
+ "t": 1,
82
+ "value": "#8fb04a"
83
+ }
84
+ ],
85
+ "leafCoverage": [
86
+ {
87
+ "t": 0,
88
+ "value": .4
89
+ },
90
+ {
91
+ "t": .1,
92
+ "value": 1
93
+ },
94
+ {
95
+ "t": .7,
96
+ "value": 1
97
+ },
98
+ {
99
+ "t": .86,
100
+ "value": 0
101
+ },
102
+ {
103
+ "t": .95,
104
+ "value": 0
105
+ },
106
+ {
107
+ "t": 1,
108
+ "value": .4
109
+ }
110
+ ],
111
+ "blossom": [
112
+ {
113
+ "t": .4,
114
+ "value": 0
115
+ },
116
+ {
117
+ "t": .46,
118
+ "value": .25
119
+ },
120
+ {
121
+ "t": .54,
122
+ "value": .25
123
+ },
124
+ {
125
+ "t": .6,
126
+ "value": 0
127
+ }
128
+ ],
129
+ "blossomColor": "#f2efe2"
130
+ };
131
+ var wind = {
132
+ "trunk": .06,
133
+ "branches": .3,
134
+ "leaves": .8,
135
+ "frequency": .8
136
+ };
137
+ var variation = {
138
+ "color": .1,
139
+ "growth": .1,
140
+ "season": .05
141
+ };
142
+ var teak_default = {
143
+ id,
144
+ name,
145
+ form,
146
+ trunk,
147
+ branches,
148
+ foliage,
149
+ bark,
150
+ season,
151
+ wind,
152
+ variation
153
+ };
154
+ export { bark, branches, teak_default as default, foliage, form, id, name, season, trunk, variation, wind };
155
+
156
+ //# sourceMappingURL=teak.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teak.js","names":[],"sources":[],"mappings":""}
@@ -0,0 +1,148 @@
1
+ {
2
+ "id": "teak",
3
+ "name": "Teak",
4
+ "form": "broadleaf",
5
+ "trunk": {
6
+ "length": 7.5,
7
+ "radius": 0.4,
8
+ "taper": 0.36,
9
+ "lengthVariation": 0.1,
10
+ "bend": 0.08
11
+ },
12
+ "branches": [
13
+ {
14
+ "angleVariation": 0.15,
15
+ "spiral": 137.5,
16
+ "lengthVariation": 0.15,
17
+ "taper": 0.42,
18
+ "bend": 0.12,
19
+ "gravity": 0.1,
20
+ "lengthProfile": [
21
+ {
22
+ "t": 0.62,
23
+ "value": 1.0
24
+ },
25
+ {
26
+ "t": 1.0,
27
+ "value": 0.55
28
+ }
29
+ ],
30
+ "count": 7,
31
+ "start": 0.62,
32
+ "end": 0.96,
33
+ "angle": 50,
34
+ "length": 0.4,
35
+ "radius": 0.6
36
+ },
37
+ {
38
+ "angleVariation": 0.15,
39
+ "spiral": 137.5,
40
+ "lengthVariation": 0.15,
41
+ "taper": 0.45,
42
+ "bend": 0.12,
43
+ "gravity": 0.15,
44
+ "count": 4,
45
+ "start": 0.35,
46
+ "end": 1,
47
+ "angle": 45,
48
+ "length": 0.6,
49
+ "radius": 0.6
50
+ }
51
+ ],
52
+ "foliage": {
53
+ "type": "broad",
54
+ "density": 0.3,
55
+ "size": 1.25,
56
+ "sizeVariation": 0.25,
57
+ "start": 0.3,
58
+ "angle": 60
59
+ },
60
+ "bark": {
61
+ "type": "fibrous",
62
+ "color": "#a39886"
63
+ },
64
+ "season": {
65
+ "leafColor": [
66
+ {
67
+ "t": 0,
68
+ "value": "#8fb04a"
69
+ },
70
+ {
71
+ "t": 0.15,
72
+ "value": "#4c7a2e"
73
+ },
74
+ {
75
+ "t": 0.6,
76
+ "value": "#4c7a2e"
77
+ },
78
+ {
79
+ "t": 0.7,
80
+ "value": "#8a6e3a"
81
+ },
82
+ {
83
+ "t": 0.85,
84
+ "value": "#7a5a32"
85
+ },
86
+ {
87
+ "t": 1,
88
+ "value": "#8fb04a"
89
+ }
90
+ ],
91
+ "leafCoverage": [
92
+ {
93
+ "t": 0,
94
+ "value": 0.4
95
+ },
96
+ {
97
+ "t": 0.1,
98
+ "value": 1
99
+ },
100
+ {
101
+ "t": 0.7,
102
+ "value": 1
103
+ },
104
+ {
105
+ "t": 0.86,
106
+ "value": 0
107
+ },
108
+ {
109
+ "t": 0.95,
110
+ "value": 0
111
+ },
112
+ {
113
+ "t": 1,
114
+ "value": 0.4
115
+ }
116
+ ],
117
+ "blossom": [
118
+ {
119
+ "t": 0.4,
120
+ "value": 0
121
+ },
122
+ {
123
+ "t": 0.46,
124
+ "value": 0.25
125
+ },
126
+ {
127
+ "t": 0.54,
128
+ "value": 0.25
129
+ },
130
+ {
131
+ "t": 0.6,
132
+ "value": 0
133
+ }
134
+ ],
135
+ "blossomColor": "#f2efe2"
136
+ },
137
+ "wind": {
138
+ "trunk": 0.06,
139
+ "branches": 0.3,
140
+ "leaves": 0.8,
141
+ "frequency": 0.8
142
+ },
143
+ "variation": {
144
+ "color": 0.1,
145
+ "growth": 0.1,
146
+ "season": 0.05
147
+ }
148
+ }
@@ -0,0 +1,61 @@
1
+ import type { BarkType, BranchLevelDefinition, FruitDefinition, HexColor, LeafType, SeasonProfileDefinition, TreeForm, TrunkDefinition, VariationDefinition, WindResponseDefinition } from '../definition/types';
2
+ /**
3
+ * A Species' trunk: the shape fields of {@link TrunkDefinition}, without the polygon detail
4
+ * (`sides`, `sections`), which the Style chooses. Fields beyond the five required ones (e.g. Stems)
5
+ * are optional and default like in a Tree Definition.
6
+ */
7
+ export type SpeciesTrunkDefinition = Pick<TrunkDefinition, 'length' | 'radius' | 'taper' | 'lengthVariation' | 'bend'> & Partial<Omit<TrunkDefinition, 'sides' | 'sections'>>;
8
+ /** A Species' branch level: {@link BranchLevelDefinition} (with its Crown Shape curves) without `sides` / `sections`. */
9
+ export type SpeciesBranchLevelDefinition = Omit<BranchLevelDefinition, 'sides' | 'sections'>;
10
+ /** A Species' foliage, Style-neutral: the Style turns it into leaf shape, count, size and texture. */
11
+ export interface SpeciesFoliageDefinition {
12
+ /** Leaf Type. */
13
+ type: LeafType;
14
+ /** How dense the foliage is, 0 (none) .. 1 (very dense); 0.5 is an ordinary crown. */
15
+ density: number;
16
+ /** Real size of one leaf spray (a cluster of leaves on a twig), metres (> 0). */
17
+ size: number;
18
+ /** Seed range: ± this fraction of `size` (0..1). */
19
+ sizeVariation: number;
20
+ /** Where along the terminal branch leaves start, as a fraction of its length (0..1). */
21
+ start: number;
22
+ /** Angle between branch and leaf, degrees (0..180). */
23
+ angle: number;
24
+ }
25
+ /** A Species' bark, Style-neutral. */
26
+ export interface SpeciesBarkDefinition {
27
+ /** Bark Type. */
28
+ type: BarkType;
29
+ /** Bark colour (the tint for textured bark). */
30
+ color: HexColor;
31
+ }
32
+ /**
33
+ * A Species' Fruit (ADR 0006), copied as is into the Tree Definition's `fruit` block;
34
+ * the Style decides how it is drawn (its shading).
35
+ */
36
+ export type SpeciesFruitDefinition = FruitDefinition;
37
+ /**
38
+ * Species: a named kind of real tree, described once, Style-neutral (ADR 0005). Plain JSON.
39
+ * A Style turns it into an ordinary, complete Tree Definition: `createTree(lowPoly.apply(oak), { seed })`.
40
+ * It holds no shading, polygon detail, textures or Style-specific leaf shape / count.
41
+ */
42
+ export interface SpeciesDefinition {
43
+ /** Kebab-case id, e.g. `'douglas-fir'`; kept as the Definition's `species`. */
44
+ id: string;
45
+ /** English display name, e.g. `'Douglas Fir'`; becomes the Definition's `name`. */
46
+ name: string;
47
+ /** Form: a label for grouping Species; it never changes geometry. */
48
+ form: TreeForm;
49
+ trunk: SpeciesTrunkDefinition;
50
+ /** Branch levels below the trunk, with their Crown Shape curves. */
51
+ branches: SpeciesBranchLevelDefinition[];
52
+ foliage: SpeciesFoliageDefinition;
53
+ bark: SpeciesBarkDefinition;
54
+ /** Optional Fruit. */
55
+ fruit?: SpeciesFruitDefinition;
56
+ /** Season Profile (tracks beyond the four required ones are optional and default like in a Tree Definition). */
57
+ season: Pick<SeasonProfileDefinition, 'leafColor' | 'leafCoverage' | 'blossom' | 'blossomColor'> & Partial<SeasonProfileDefinition>;
58
+ wind: WindResponseDefinition;
59
+ variation: VariationDefinition;
60
+ }
61
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/species/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,uBAAuB,EACvB,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,iBAAiB,GAAG,MAAM,CAAC,GACpH,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC;AAEvD,yHAAyH;AACzH,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE7F,sGAAsG;AACtG,MAAM,WAAW,wBAAwB;IACvC,iBAAiB;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,sCAAsC;AACtC,MAAM,WAAW,qBAAqB;IACpC,iBAAiB;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,gDAAgD;IAChD,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,EAAE,EAAE,MAAM,CAAC;IACX,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,sBAAsB,CAAC;IAC9B,oEAAoE;IACpE,QAAQ,EAAE,4BAA4B,EAAE,CAAC;IACzC,OAAO,EAAE,wBAAwB,CAAC;IAClC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,sBAAsB;IACtB,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAC/B,gHAAgH;IAChH,MAAM,EAAE,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,cAAc,GAAG,SAAS,GAAG,cAAc,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACpI,IAAI,EAAE,sBAAsB,CAAC;IAC7B,SAAS,EAAE,mBAAmB,CAAC;CAChC"}