@awesome-flow/noise 0.7.0 → 0.8.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 (77) hide show
  1. package/dist/abstract/index.cjs +8 -3469
  2. package/dist/abstract/index.d.cts +2 -2
  3. package/dist/abstract/index.d.ts +2 -2
  4. package/dist/abstract/index.js +15 -3508
  5. package/dist/chunk-2Y22M2Y4.js +0 -0
  6. package/dist/chunk-4PQ4USYV.cjs +1 -0
  7. package/dist/chunk-5ELMFIRV.js +0 -0
  8. package/dist/chunk-ACWBUUZ7.cjs +1376 -0
  9. package/dist/chunk-BG6U3TYO.js +1376 -0
  10. package/dist/chunk-D5JM4EYQ.cjs +305 -0
  11. package/dist/chunk-DWSACR65.js +305 -0
  12. package/dist/chunk-FFQRP23R.cjs +1 -0
  13. package/dist/chunk-JACBT4MS.cjs +1 -0
  14. package/dist/chunk-KHIIB5TH.js +93 -0
  15. package/dist/chunk-M67JHEU2.cjs +93 -0
  16. package/dist/chunk-N6YNJKLS.cjs +1 -0
  17. package/dist/chunk-PS5VUND5.js +348 -0
  18. package/dist/chunk-Q5FVGKKM.cjs +1 -0
  19. package/dist/chunk-RDQ4BOOV.js +522 -0
  20. package/dist/chunk-RKTZQUWR.cjs +348 -0
  21. package/dist/chunk-RVWCBH7K.js +0 -0
  22. package/dist/chunk-SD3T3LFY.js +0 -0
  23. package/dist/chunk-SGHEOOLW.js +19 -0
  24. package/dist/chunk-TOYKGWYO.js +0 -0
  25. package/dist/chunk-TZCT2GZV.cjs +522 -0
  26. package/dist/chunk-UNMRBZ5X.cjs +19 -0
  27. package/dist/chunk-WOJTKQKO.cjs +1 -0
  28. package/dist/chunk-XZQQ6N3L.js +0 -0
  29. package/dist/modules/index.cjs +4 -42
  30. package/dist/modules/index.js +3 -15
  31. package/dist/nodes/generators/index.cjs +13 -335
  32. package/dist/nodes/generators/index.d.cts +7 -7
  33. package/dist/nodes/generators/index.d.ts +7 -7
  34. package/dist/nodes/generators/index.js +12 -299
  35. package/dist/nodes/groups/index.cjs +4 -111
  36. package/dist/nodes/groups/index.d.cts +2 -2
  37. package/dist/nodes/groups/index.d.ts +2 -2
  38. package/dist/nodes/groups/index.js +2 -88
  39. package/dist/nodes/index.cjs +75 -3425
  40. package/dist/nodes/index.js +37 -3397
  41. package/dist/nodes/modifiers/index.cjs +4 -1459
  42. package/dist/nodes/modifiers/index.d.cts +6 -6
  43. package/dist/nodes/modifiers/index.d.ts +6 -6
  44. package/dist/nodes/modifiers/index.js +11 -1479
  45. package/dist/nodes/output/index.cjs +8 -1335
  46. package/dist/nodes/output/index.d.cts +3 -3
  47. package/dist/nodes/output/index.d.ts +3 -3
  48. package/dist/nodes/output/index.js +10 -1361
  49. package/dist/nodes/selectors/index.cjs +8 -1317
  50. package/dist/nodes/selectors/index.d.cts +1 -1
  51. package/dist/nodes/selectors/index.d.ts +1 -1
  52. package/dist/nodes/selectors/index.js +8 -1343
  53. package/dist/nodes/transformers/index.cjs +8 -331
  54. package/dist/nodes/transformers/index.d.cts +5 -5
  55. package/dist/nodes/transformers/index.d.ts +5 -5
  56. package/dist/nodes/transformers/index.js +6 -311
  57. package/dist/templates/generators/index.cjs +8 -1199
  58. package/dist/templates/generators/index.d.cts +5 -5
  59. package/dist/templates/generators/index.d.ts +5 -5
  60. package/dist/templates/generators/index.js +17 -1226
  61. package/dist/templates/groups/index.cjs +8 -1199
  62. package/dist/templates/groups/index.js +8 -1226
  63. package/dist/templates/index.cjs +77 -1263
  64. package/dist/templates/index.js +43 -1226
  65. package/dist/templates/modifiers/index.cjs +8 -1199
  66. package/dist/templates/modifiers/index.d.cts +9 -9
  67. package/dist/templates/modifiers/index.d.ts +9 -9
  68. package/dist/templates/modifiers/index.js +16 -1226
  69. package/dist/templates/output/index.cjs +8 -1199
  70. package/dist/templates/output/index.d.cts +3 -3
  71. package/dist/templates/output/index.d.ts +3 -3
  72. package/dist/templates/output/index.js +11 -1226
  73. package/dist/templates/selectors/index.cjs +8 -1199
  74. package/dist/templates/selectors/index.js +9 -1226
  75. package/dist/templates/transformers/index.cjs +8 -1199
  76. package/dist/templates/transformers/index.js +12 -1226
  77. package/package.json +30 -20
@@ -0,0 +1,1376 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17; var _class18; var _class19; var _class20; var _class21; var _class22; var _class23; var _class24; var _class25; var _class26; var _class27; var _class28; var _class29; var _class30; var _class31;
2
+
3
+
4
+
5
+
6
+
7
+ var _chunkRKTZQUWRcjs = require('./chunk-RKTZQUWR.cjs');
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+ var _chunkD5JM4EYQcjs = require('./chunk-D5JM4EYQ.cjs');
20
+
21
+
22
+ var _chunkM67JHEU2cjs = require('./chunk-M67JHEU2.cjs');
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+ var _chunkTZCT2GZVcjs = require('./chunk-TZCT2GZV.cjs');
34
+
35
+ // src/nodes/output/noise-logger-node.tsx
36
+ var _hooks = require('@awesome-flow/core/hooks');
37
+ var _layout = require('@awesome-flow/core/layout');
38
+ var _core = require('@mantine/core');
39
+ var _react = require('react');
40
+ var _jsxruntime = require('react/jsx-runtime');
41
+ function NoiseLoggerNode({ id, selected, data, type }) {
42
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
43
+ const noise = _react.useMemo.call(void 0, () => _optionalChain([incoming, 'optionalAccess', _ => _.map, 'call', _2 => _2((p) => p.noise), 'access', _3 => _3.flat, 'call', _4 => _4()]), [incoming]);
44
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
45
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Text, { children: [
46
+ "Size: ",
47
+ _optionalChain([noise, 'optionalAccess', _5 => _5.length]) || 0
48
+ ] }),
49
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Divider, { h: 5 }),
50
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: _optionalChain([noise, 'optionalAccess', _6 => _6.map, 'call', _7 => _7((v, i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Text, { children: [
51
+ _optionalChain([v, 'access', _8 => _8.position, 'optionalAccess', _9 => _9.x]),
52
+ ":",
53
+ _optionalChain([v, 'access', _10 => _10.position, 'optionalAccess', _11 => _11.y]),
54
+ ":",
55
+ _optionalChain([v, 'access', _12 => _12.position, 'optionalAccess', _13 => _13.z]),
56
+ ": ",
57
+ v.value
58
+ ] }, i))]) }),
59
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
60
+ ] });
61
+ }
62
+ var noise_logger_node_default = NoiseLoggerNode;
63
+
64
+ // src/nodes/output/noise-output-node.tsx
65
+ var _components = require('@awesome-flow/core/components');
66
+
67
+
68
+
69
+
70
+
71
+ // src/nodes/selectors/noise-blend-node.tsx
72
+
73
+
74
+
75
+ var _libnoisesimplexts = require('libnoise-simplex-ts');
76
+
77
+
78
+ function NoiseBlendNode({ id, selected, data, type }) {
79
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
80
+ const onDataUpdated = _react.useCallback.call(void 0,
81
+ (incomingData) => {
82
+ const incomingSources = incomingData["source" /* source */];
83
+ const incomingControl = incomingData["control" /* control */];
84
+ if (_optionalChain([incomingSources, 'optionalAccess', _14 => _14.length]) >= 2 && _optionalChain([incomingControl, 'optionalAccess', _15 => _15.length])) {
85
+ const module = new (0, _libnoisesimplexts.Blend)(
86
+ incomingSources[0].module,
87
+ incomingSources[1].module,
88
+ incomingControl[0].module
89
+ );
90
+ updateComputedData(id, { module });
91
+ }
92
+ },
93
+ []
94
+ );
95
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
96
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
97
+ _components.HandlesIncomingDataStatus,
98
+ {
99
+ nodeId: id,
100
+ handles: data.handles,
101
+ handleKey: "dataId",
102
+ onDataUpdated,
103
+ type: "target",
104
+ resetComputedData: true
105
+ }
106
+ ),
107
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
108
+ ] });
109
+ }
110
+ var noise_blend_node_default = NoiseBlendNode;
111
+
112
+ // src/nodes/selectors/noise-select-node.tsx
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+ function NoiseSelectNode({ id, selected, data, type }) {
121
+ const [edgeFalloff, setEdgeFalloff] = _react.useState.call(void 0, data.edgeFalloff);
122
+ const [lowerBound, setLowerBound] = _react.useState.call(void 0, data.lowerBound);
123
+ const [upperBound, setUpperBound] = _react.useState.call(void 0, data.upperBound);
124
+ const updateNodeData = _hooks.useUpdateNodeData.call(void 0, );
125
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
126
+ _react.useEffect.call(void 0, () => {
127
+ updateNodeData(id, { edgeFalloff, lowerBound, upperBound });
128
+ }, [edgeFalloff, lowerBound, upperBound]);
129
+ const onDataUpdated = _react.useCallback.call(void 0,
130
+ (incomingData) => {
131
+ const incomingSources = incomingData["source" /* source */];
132
+ const incomingControl = incomingData["control" /* control */];
133
+ if (_optionalChain([incomingSources, 'optionalAccess', _16 => _16.length]) >= 2 && _optionalChain([incomingControl, 'optionalAccess', _17 => _17.length])) {
134
+ const module = new (0, _libnoisesimplexts.Select)(
135
+ incomingSources[0].module,
136
+ incomingSources[1].module,
137
+ incomingControl[0].module,
138
+ edgeFalloff,
139
+ lowerBound,
140
+ upperBound
141
+ );
142
+ updateComputedData(id, { module });
143
+ }
144
+ },
145
+ []
146
+ );
147
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
148
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
149
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
150
+ "Edge Falloff:",
151
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
152
+ _core.NumberInput,
153
+ {
154
+ size: "xs",
155
+ w: 100,
156
+ value: edgeFalloff,
157
+ onChange: (e) => setEdgeFalloff(Number(e)),
158
+ step: 0.1
159
+ }
160
+ )
161
+ ] }),
162
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
163
+ "Lower Bound:",
164
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
165
+ _core.NumberInput,
166
+ {
167
+ size: "xs",
168
+ w: 100,
169
+ value: lowerBound,
170
+ onChange: (e) => setLowerBound(Number(e)),
171
+ step: 0.1
172
+ }
173
+ )
174
+ ] }),
175
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
176
+ "Upper Bound:",
177
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
178
+ _core.NumberInput,
179
+ {
180
+ size: "xs",
181
+ w: 100,
182
+ value: upperBound,
183
+ onChange: (e) => setUpperBound(Number(e)),
184
+ step: 0.1
185
+ }
186
+ )
187
+ ] }),
188
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
189
+ _components.HandlesIncomingDataStatus,
190
+ {
191
+ nodeId: id,
192
+ handles: data.handles,
193
+ handleKey: "dataId",
194
+ onDataUpdated,
195
+ type: "target",
196
+ resetComputedData: true
197
+ }
198
+ )
199
+ ] }),
200
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
201
+ ] });
202
+ }
203
+ var noise_select_node_default = NoiseSelectNode;
204
+
205
+ // src/nodes/output/noise-raw-texture-node.tsx
206
+
207
+
208
+
209
+
210
+
211
+ function NoiseRawTextureNode({ id, selected, data, type }) {
212
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
213
+ const [dataLength, setDataLength] = _react.useState.call(void 0, 0);
214
+ const [resolution, setResolution] = _react.useState.call(void 0, 0);
215
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
216
+ const noise = _react.useMemo.call(void 0, () => _optionalChain([incoming, 'optionalAccess', _18 => _18.map, 'call', _19 => _19((p) => p.noise), 'access', _20 => _20.flat, 'call', _21 => _21()]), [incoming]);
217
+ _react.useEffect.call(void 0, () => {
218
+ if (_optionalChain([noise, 'optionalAccess', _22 => _22.length])) {
219
+ const size = Math.ceil(Math.sqrt(noise.length));
220
+ const colors = noise.map((n) => [n.value * 255, n.value * 255, n.value * 255, 255]).flat();
221
+ const dataArray = new Uint8Array(size * size * 4);
222
+ dataArray.set(colors);
223
+ setResolution(size);
224
+ setDataLength(dataArray.length);
225
+ updateComputedData(id, {
226
+ textureData: dataArray,
227
+ textureResolutionX: size,
228
+ textureResolutionY: size
229
+ });
230
+ }
231
+ }, [noise]);
232
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
233
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Stack, { children: [
234
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
235
+ "Resolution: ",
236
+ resolution,
237
+ "x",
238
+ resolution
239
+ ] }),
240
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
241
+ "Input Length: ",
242
+ _optionalChain([noise, 'optionalAccess', _23 => _23.length]) || 0
243
+ ] }),
244
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Group, { children: [
245
+ "Output Length (",
246
+ resolution,
247
+ "*",
248
+ resolution,
249
+ "*4): ",
250
+ dataLength
251
+ ] })
252
+ ] }),
253
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
254
+ ] });
255
+ }
256
+ var noise_raw_texture_node_default = NoiseRawTextureNode;
257
+
258
+ // src/nodes/output/positions-logger-node.tsx
259
+
260
+
261
+
262
+
263
+
264
+ function PositionsLoggerNode({ id, selected, data, type }) {
265
+ const incoming = _hooks.useIncomingComputedData.call(void 0, id);
266
+ const positions = _react.useMemo.call(void 0, () => {
267
+ return _optionalChain([incoming, 'optionalAccess', _24 => _24.map, 'call', _25 => _25((p) => p.positions), 'access', _26 => _26.flat, 'call', _27 => _27()]);
268
+ }, [incoming]);
269
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
270
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Text, { children: [
271
+ "Size: ",
272
+ _optionalChain([positions, 'optionalAccess', _28 => _28.length]) || 0
273
+ ] }),
274
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Divider, { h: 5 }),
275
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _core.Stack, { children: _optionalChain([positions, 'optionalAccess', _29 => _29.map, 'call', _30 => _30((v, i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Text, { children: [
276
+ v.x,
277
+ ":",
278
+ v.y,
279
+ ":",
280
+ v.z
281
+ ] }, i))]) }),
282
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
283
+ ] });
284
+ }
285
+ var positions_logger_node_default = PositionsLoggerNode;
286
+
287
+ // src/templates/generators/noise-billow-template.ts
288
+ var _abstract = require('@awesome-flow/core/abstract');
289
+ var _utils = require('@awesome-flow/core/utils');
290
+ var _system = require('@xyflow/system');
291
+
292
+ // src/abstract/templates.ts
293
+ var NoiseTemplateGroup = /* @__PURE__ */ ((NoiseTemplateGroup2) => {
294
+ NoiseTemplateGroup2["positions"] = "Positions";
295
+ NoiseTemplateGroup2["output"] = "Output";
296
+ NoiseTemplateGroup2["noiseGenerators"] = "Noise Generators";
297
+ NoiseTemplateGroup2["noiseModifiers"] = "Noise Modifiers";
298
+ NoiseTemplateGroup2["noiseSelectors"] = "Noise Selectors";
299
+ NoiseTemplateGroup2["noiseTransformers"] = "Noise Transformers";
300
+ return NoiseTemplateGroup2;
301
+ })(NoiseTemplateGroup || {});
302
+
303
+ // src/templates/generators/noise-billow-template.ts
304
+ var NoiseBillowNodeTemplateFactory = (_class = class {constructor() { _class.prototype.__init.call(this); }
305
+ __init() {this.template = {
306
+ id: _utils.IDGenerator.template(),
307
+ type: "noise-billow" /* noiseBillow */,
308
+ group: "Noise Generators" /* noiseGenerators */,
309
+ data: {
310
+ title: "Billow Noise",
311
+ frequency: 0.1,
312
+ lacunarity: 2,
313
+ octaves: 5,
314
+ persistence: 0.5,
315
+ seed: 0
316
+ },
317
+ handles: [
318
+ {
319
+ position: _system.Position.Left,
320
+ dataType: _abstract.CoreHandleType.variableProperty,
321
+ connection: "target"
322
+ },
323
+ {
324
+ position: _system.Position.Right,
325
+ dataType: "module" /* module */,
326
+ connection: "source"
327
+ }
328
+ ]
329
+ }}
330
+ }, _class);
331
+
332
+ // src/templates/generators/noise-checkerboard-template.ts
333
+
334
+ var NoiseCheckerboardNodeTemplateFactory = (_class2 = class {constructor() { _class2.prototype.__init2.call(this); }
335
+ __init2() {this.template = {
336
+ type: "noise-checkerboard" /* noiseCheckerboard */,
337
+ group: "Noise Generators" /* noiseGenerators */,
338
+ data: {
339
+ title: "Checkerboard Noise"
340
+ },
341
+ handles: [
342
+ {
343
+ position: _system.Position.Right,
344
+ dataType: "module" /* module */,
345
+ connection: "source"
346
+ }
347
+ ]
348
+ }}
349
+ }, _class2);
350
+
351
+ // src/templates/generators/noise-const-template.ts
352
+
353
+ var NoiseConstNodeTemplateFactory = (_class3 = class {constructor() { _class3.prototype.__init3.call(this); }
354
+ __init3() {this.template = {
355
+ type: "noise-constant" /* noiseConst */,
356
+ group: "Noise Generators" /* noiseGenerators */,
357
+ data: {
358
+ title: "Const Value Noise",
359
+ noise: 0,
360
+ min: -1,
361
+ max: 1
362
+ },
363
+ handles: [
364
+ {
365
+ position: _system.Position.Right,
366
+ dataType: "module" /* module */,
367
+ connection: "source"
368
+ }
369
+ ]
370
+ }}
371
+ }, _class3);
372
+
373
+ // src/templates/generators/noise-cylinders-template.ts
374
+
375
+
376
+ var NoiseCylindersNodeTemplateFactory = (_class4 = class {constructor() { _class4.prototype.__init4.call(this); }
377
+ __init4() {this.template = {
378
+ type: "noise-cylinders" /* noiseCylinders */,
379
+ group: "Noise Generators" /* noiseGenerators */,
380
+ data: {
381
+ title: "Cylinders Noise",
382
+ frequency: 0.1
383
+ },
384
+ handles: [
385
+ {
386
+ position: _system.Position.Left,
387
+ dataType: _abstract.CoreHandleType.variableProperty,
388
+ connection: "target"
389
+ },
390
+ {
391
+ position: _system.Position.Right,
392
+ dataType: "module" /* module */,
393
+ connection: "source"
394
+ }
395
+ ]
396
+ }}
397
+ }, _class4);
398
+
399
+ // src/templates/generators/noise-perlin-template.ts
400
+
401
+
402
+ var NoisePerlinNodeTemplateFactory = (_class5 = class {constructor() { _class5.prototype.__init5.call(this); }
403
+ __init5() {this.template = {
404
+ type: "noise-perlin" /* noisePerlin */,
405
+ group: "Noise Generators" /* noiseGenerators */,
406
+ data: {
407
+ title: "Perlin Noise",
408
+ frequency: 0.1,
409
+ lacunarity: 2,
410
+ octaves: 5,
411
+ persistence: 0.5,
412
+ seed: 0
413
+ },
414
+ handles: [
415
+ {
416
+ position: _system.Position.Left,
417
+ dataType: _abstract.CoreHandleType.variableProperty,
418
+ connection: "target"
419
+ },
420
+ {
421
+ position: _system.Position.Right,
422
+ dataType: "module" /* module */,
423
+ connection: "source"
424
+ }
425
+ ]
426
+ }}
427
+ }, _class5);
428
+
429
+ // src/templates/generators/noise-ridgedmulti-template.ts
430
+
431
+
432
+ var NoiseRidgedMultiNodeTemplateFactory = (_class6 = class {constructor() { _class6.prototype.__init6.call(this); }
433
+ __init6() {this.template = {
434
+ type: "noise-ridged-multi" /* noiseRidgedMulti */,
435
+ group: "Noise Generators" /* noiseGenerators */,
436
+ data: {
437
+ title: "Ridged Multi Noise",
438
+ frequency: 0.1,
439
+ lacunarity: 2,
440
+ octaves: 6,
441
+ offset: 1,
442
+ gain: 2,
443
+ seed: 0
444
+ },
445
+ handles: [
446
+ {
447
+ position: _system.Position.Left,
448
+ dataType: _abstract.CoreHandleType.variableProperty,
449
+ connection: "target"
450
+ },
451
+ {
452
+ position: _system.Position.Right,
453
+ dataType: "module" /* module */,
454
+ connection: "source"
455
+ }
456
+ ]
457
+ }}
458
+ }, _class6);
459
+
460
+ // src/templates/generators/noise-spheres-template.ts
461
+
462
+
463
+ var NoiseSpheresNodeTemplateFactory = (_class7 = class {constructor() { _class7.prototype.__init7.call(this); }
464
+ __init7() {this.template = {
465
+ type: "noise-spheres" /* noiseSpheres */,
466
+ group: "Noise Generators" /* noiseGenerators */,
467
+ data: {
468
+ title: "Spheres Noise",
469
+ frequency: 0.1
470
+ },
471
+ handles: [
472
+ {
473
+ position: _system.Position.Left,
474
+ dataType: _abstract.CoreHandleType.variableProperty,
475
+ connection: "target"
476
+ },
477
+ {
478
+ position: _system.Position.Right,
479
+ dataType: "module" /* module */,
480
+ connection: "source"
481
+ }
482
+ ]
483
+ }}
484
+ }, _class7);
485
+
486
+ // src/templates/generators/noise-voronoi-template.ts
487
+
488
+
489
+ var NoiseVoronoiNodeTemplateFactory = (_class8 = class {constructor() { _class8.prototype.__init8.call(this); }
490
+ __init8() {this.template = {
491
+ type: "noise-voronoi" /* noiseVoronoi */,
492
+ group: "Noise Generators" /* noiseGenerators */,
493
+ data: {
494
+ title: "Voronoi Noise",
495
+ frequency: 0.1,
496
+ displacement: 1,
497
+ distance: true,
498
+ seed: 0
499
+ },
500
+ handles: [
501
+ {
502
+ position: _system.Position.Left,
503
+ dataType: _abstract.CoreHandleType.variableProperty,
504
+ connection: "target"
505
+ },
506
+ {
507
+ position: _system.Position.Right,
508
+ dataType: "module" /* module */,
509
+ connection: "source"
510
+ }
511
+ ]
512
+ }}
513
+ }, _class8);
514
+
515
+ // src/templates/generators/position-const-template.ts
516
+
517
+ var PositionConstNodeTemplateFactory = (_class9 = class {constructor() { _class9.prototype.__init9.call(this); }
518
+ __init9() {this.template = {
519
+ type: "position" /* position */,
520
+ group: "Positions" /* positions */,
521
+ data: {
522
+ title: "Position Output",
523
+ position: { x: 0, y: 0, z: 0 }
524
+ },
525
+ handles: [
526
+ {
527
+ position: _system.Position.Right,
528
+ dataType: "position" /* position */,
529
+ connection: "source"
530
+ }
531
+ ]
532
+ }}
533
+ }, _class9);
534
+
535
+ // src/templates/generators/position-grid-template.ts
536
+
537
+ var PositionGridNodeTemplateFactory = (_class10 = class {constructor() { _class10.prototype.__init10.call(this); }
538
+ __init10() {this.template = {
539
+ type: "grid" /* grid */,
540
+ group: "Positions" /* positions */,
541
+ data: {
542
+ title: "Grid Output",
543
+ center: { x: 0, y: 0, z: 0 },
544
+ radius: 1
545
+ },
546
+ handles: [
547
+ {
548
+ position: _system.Position.Right,
549
+ dataType: "position" /* position */,
550
+ connection: "source"
551
+ }
552
+ ]
553
+ }}
554
+ }, _class10);
555
+
556
+ // src/templates/groups/module-group-template.ts
557
+
558
+
559
+
560
+
561
+
562
+ var ModuleGroupNodeTemplateFactory = (_class11 = class {constructor() { _class11.prototype.__init11.call(this); }
563
+ __init11() {this.template = {
564
+ id: _utils.IDGenerator.template(),
565
+ type: "group-module" /* groupModule */,
566
+ group: _abstract.CoreTemplateGroup.groups,
567
+ data: {
568
+ title: "Modules Group",
569
+ isGroup: true,
570
+ initialSize: {
571
+ width: 300,
572
+ height: 200
573
+ },
574
+ collapsedSize: {
575
+ width: 300,
576
+ height: 80
577
+ }
578
+ },
579
+ handles: [
580
+ {
581
+ position: _system.Position.Bottom,
582
+ dataType: "module" /* module */,
583
+ connection: "target",
584
+ maxConnections: 1,
585
+ hideOnCollapse: true
586
+ },
587
+ {
588
+ position: _system.Position.Right,
589
+ dataType: "module" /* module */,
590
+ connection: "source"
591
+ }
592
+ ]
593
+ }}
594
+ }, _class11);
595
+
596
+ // src/templates/modifiers/noise-abs-template.ts
597
+
598
+ var NoiseAbsNodeTemplateFactory = (_class12 = class {constructor() { _class12.prototype.__init12.call(this); }
599
+ __init12() {this.template = {
600
+ type: "noise-abs" /* noiseAbs */,
601
+ group: "Noise Modifiers" /* noiseModifiers */,
602
+ data: {
603
+ title: "Abs Noise"
604
+ },
605
+ handles: [
606
+ {
607
+ position: _system.Position.Left,
608
+ dataType: "module" /* module */,
609
+ connection: "target",
610
+ maxConnections: 1
611
+ },
612
+ {
613
+ position: _system.Position.Right,
614
+ dataType: "module" /* module */,
615
+ connection: "source"
616
+ }
617
+ ]
618
+ }}
619
+ }, _class12);
620
+
621
+ // src/templates/modifiers/noise-clamp-template.ts
622
+
623
+ var NoiseClampNodeTemplateFactory = (_class13 = class {constructor() { _class13.prototype.__init13.call(this); }
624
+ __init13() {this.template = {
625
+ type: "noise-clamp" /* noiseClamp */,
626
+ group: "Noise Modifiers" /* noiseModifiers */,
627
+ data: {
628
+ title: "Clamp Noise",
629
+ lowerBound: -1,
630
+ upperBound: 1
631
+ },
632
+ handles: [
633
+ {
634
+ position: _system.Position.Left,
635
+ dataType: "module" /* module */,
636
+ connection: "target",
637
+ maxConnections: 1
638
+ },
639
+ {
640
+ position: _system.Position.Right,
641
+ dataType: "module" /* module */,
642
+ connection: "source"
643
+ }
644
+ ]
645
+ }}
646
+ }, _class13);
647
+
648
+ // src/templates/modifiers/noise-combine-template.ts
649
+
650
+ var NoiseCombineNodeTemplateFactory = (_class14 = class {constructor() { _class14.prototype.__init14.call(this); }
651
+ __init14() {this.template = {
652
+ type: "noise-combiner" /* noiseCombine */,
653
+ group: "Noise Modifiers" /* noiseModifiers */,
654
+ data: {
655
+ title: "Combine Noise",
656
+ operation: "add" /* add */
657
+ },
658
+ handles: [
659
+ {
660
+ position: _system.Position.Left,
661
+ dataType: "module" /* module */,
662
+ connection: "target",
663
+ maxConnections: 2
664
+ },
665
+ {
666
+ position: _system.Position.Right,
667
+ dataType: "module" /* module */,
668
+ connection: "source"
669
+ }
670
+ ]
671
+ }}
672
+ }, _class14);
673
+
674
+ // src/templates/modifiers/noise-curve-template.ts
675
+
676
+ var NoiseCurveNodeTemplateFactory = (_class15 = class {constructor() { _class15.prototype.__init15.call(this); }
677
+ __init15() {this.template = {
678
+ type: "noise-curve" /* noiseCurve */,
679
+ group: "Noise Modifiers" /* noiseModifiers */,
680
+ data: {
681
+ title: "Noise Curve",
682
+ points: []
683
+ },
684
+ handles: [
685
+ {
686
+ position: _system.Position.Left,
687
+ dataType: "module" /* module */,
688
+ connection: "target",
689
+ maxConnections: 1
690
+ },
691
+ // {
692
+ // position: Position.Left,
693
+ // dataType: CoreHandleType.variableProperty,
694
+ // connection: 'target',
695
+ // },
696
+ {
697
+ position: _system.Position.Right,
698
+ dataType: "module" /* module */,
699
+ connection: "source"
700
+ }
701
+ ]
702
+ }}
703
+ }, _class15);
704
+
705
+ // src/templates/modifiers/noise-exponent-template.ts
706
+
707
+ var NoiseExponentNodeTemplateFactory = (_class16 = class {constructor() { _class16.prototype.__init16.call(this); }
708
+ __init16() {this.template = {
709
+ type: "noise-exponent" /* noiseExponent */,
710
+ group: "Noise Modifiers" /* noiseModifiers */,
711
+ data: {
712
+ title: "Noise Exponent",
713
+ exponent: 1
714
+ },
715
+ handles: [
716
+ {
717
+ position: _system.Position.Left,
718
+ dataType: "module" /* module */,
719
+ connection: "target",
720
+ maxConnections: 1
721
+ },
722
+ {
723
+ position: _system.Position.Right,
724
+ dataType: "module" /* module */,
725
+ connection: "source"
726
+ }
727
+ ]
728
+ }}
729
+ }, _class16);
730
+
731
+ // src/templates/modifiers/noise-invert-template.ts
732
+
733
+ var NoiseInvertNodeTemplateFactory = (_class17 = class {constructor() { _class17.prototype.__init17.call(this); }
734
+ __init17() {this.template = {
735
+ type: "noise-invert" /* noiseInvert */,
736
+ group: "Noise Modifiers" /* noiseModifiers */,
737
+ data: {
738
+ title: "Invert Noise"
739
+ },
740
+ handles: [
741
+ {
742
+ position: _system.Position.Left,
743
+ dataType: "module" /* module */,
744
+ connection: "target",
745
+ maxConnections: 1
746
+ },
747
+ {
748
+ position: _system.Position.Right,
749
+ dataType: "module" /* module */,
750
+ connection: "source"
751
+ }
752
+ ]
753
+ }}
754
+ }, _class17);
755
+
756
+ // src/templates/modifiers/noise-normalize-template.ts
757
+
758
+
759
+ var NoiseNormalizeNodeTemplateFactory = (_class18 = class {constructor() { _class18.prototype.__init18.call(this); }
760
+ __init18() {this.template = {
761
+ id: _utils.IDGenerator.template(),
762
+ type: "noise-normalize" /* noiseNormalize */,
763
+ group: "Noise Modifiers" /* noiseModifiers */,
764
+ data: {
765
+ title: "Normalize Noise",
766
+ intervalStart: -1,
767
+ intervalEnd: 1
768
+ },
769
+ handles: [
770
+ {
771
+ position: _system.Position.Left,
772
+ dataType: "module" /* module */,
773
+ connection: "target",
774
+ maxConnections: 1
775
+ },
776
+ {
777
+ position: _system.Position.Right,
778
+ dataType: "module" /* module */,
779
+ connection: "source"
780
+ }
781
+ ]
782
+ }}
783
+ }, _class18);
784
+
785
+ // src/templates/modifiers/noise-scalebias-template.ts
786
+
787
+ var NoiseScaleBiasNodeTemplateFactory = (_class19 = class {constructor() { _class19.prototype.__init19.call(this); }
788
+ __init19() {this.template = {
789
+ type: "noise-scale-bias" /* noiseScaleBias */,
790
+ group: "Noise Modifiers" /* noiseModifiers */,
791
+ data: {
792
+ title: "Scale/Bias Noise",
793
+ scale: 1,
794
+ bias: 0
795
+ },
796
+ handles: [
797
+ {
798
+ position: _system.Position.Left,
799
+ dataType: "module" /* module */,
800
+ connection: "target",
801
+ maxConnections: 1
802
+ },
803
+ {
804
+ position: _system.Position.Right,
805
+ dataType: "module" /* module */,
806
+ connection: "source"
807
+ }
808
+ ]
809
+ }}
810
+ }, _class19);
811
+
812
+ // src/templates/modifiers/noise-terrace-template.ts
813
+
814
+ var NoiseTerraceNodeTemplateFactory = (_class20 = class {constructor() { _class20.prototype.__init20.call(this); }
815
+ __init20() {this.template = {
816
+ type: "noise-terrace" /* noiseTerrace */,
817
+ group: "Noise Modifiers" /* noiseModifiers */,
818
+ data: {
819
+ title: "Noise Terrace",
820
+ points: []
821
+ },
822
+ handles: [
823
+ {
824
+ position: _system.Position.Left,
825
+ dataType: "module" /* module */,
826
+ connection: "target",
827
+ maxConnections: 1
828
+ },
829
+ {
830
+ position: _system.Position.Right,
831
+ dataType: "module" /* module */,
832
+ connection: "source"
833
+ }
834
+ ]
835
+ }}
836
+ }, _class20);
837
+
838
+ // src/templates/output/noise-logger-template.ts
839
+
840
+ var NoiseLoggerNodeTemplateFactory = (_class21 = class {constructor() { _class21.prototype.__init21.call(this); }
841
+ __init21() {this.template = {
842
+ type: "noise-logger" /* noiseLogger */,
843
+ group: "Output" /* output */,
844
+ data: {
845
+ title: "Noise Logger"
846
+ },
847
+ handles: [
848
+ {
849
+ position: _system.Position.Left,
850
+ dataType: "noise" /* noise */,
851
+ connection: "target"
852
+ }
853
+ ]
854
+ }}
855
+ }, _class21);
856
+
857
+ // src/templates/output/noise-output-template.ts
858
+
859
+ var NoiseOutputNodeTemplateFactory = (_class22 = class {constructor() { _class22.prototype.__init22.call(this); }
860
+ __init22() {this.template = {
861
+ type: "noise-output" /* noiseOutput */,
862
+ group: "Output" /* output */,
863
+ data: {
864
+ title: "Noise Output"
865
+ },
866
+ handles: [
867
+ {
868
+ position: _system.Position.Left,
869
+ dataType: "position" /* position */,
870
+ connection: "target"
871
+ },
872
+ {
873
+ position: _system.Position.Left,
874
+ dataType: "module" /* module */,
875
+ connection: "target",
876
+ maxConnections: 1
877
+ },
878
+ {
879
+ position: _system.Position.Right,
880
+ dataType: "noise" /* noise */,
881
+ connection: "source"
882
+ }
883
+ ]
884
+ }}
885
+ }, _class22);
886
+
887
+ // src/templates/output/noise-raw-texture-template.ts
888
+
889
+ var NoiseRawTextureTemplateFactory = (_class23 = class {constructor() { _class23.prototype.__init23.call(this); }
890
+ __init23() {this.template = {
891
+ type: "texture-data" /* textureData */,
892
+ group: "Output" /* output */,
893
+ data: {
894
+ title: "Texture Data"
895
+ },
896
+ handles: [
897
+ {
898
+ position: _system.Position.Left,
899
+ dataType: "noise" /* noise */,
900
+ connection: "target",
901
+ maxConnections: 1
902
+ },
903
+ {
904
+ position: _system.Position.Right,
905
+ dataType: "texture" /* texture */,
906
+ connection: "source"
907
+ }
908
+ ]
909
+ }}
910
+ }, _class23);
911
+
912
+ // src/templates/output/position-logger-template.ts
913
+
914
+ var PositionLoggerNodeTemplateFactory = (_class24 = class {constructor() { _class24.prototype.__init24.call(this); }
915
+ __init24() {this.template = {
916
+ type: "position-logger" /* positionLogger */,
917
+ group: "Positions" /* positions */,
918
+ data: {
919
+ title: "Position Logger"
920
+ },
921
+ handles: [
922
+ {
923
+ position: _system.Position.Left,
924
+ dataType: "position" /* position */,
925
+ connection: "target"
926
+ }
927
+ ]
928
+ }}
929
+ }, _class24);
930
+
931
+ // src/templates/selectors/noise-blend-template.ts
932
+
933
+ var NoiseBlendNodeTemplateFactory = (_class25 = class {constructor() { _class25.prototype.__init25.call(this); }
934
+ __init25() {this.template = {
935
+ type: "noise-blend" /* noiseBlend */,
936
+ group: "Noise Selectors" /* noiseSelectors */,
937
+ data: {
938
+ title: "Noise Blend"
939
+ },
940
+ handles: [
941
+ {
942
+ position: _system.Position.Left,
943
+ dataType: "module" /* module */,
944
+ connection: "target",
945
+ label: "Source Modules",
946
+ dataId: "source" /* source */,
947
+ maxConnections: 2,
948
+ minConnections: 2
949
+ },
950
+ {
951
+ position: _system.Position.Left,
952
+ dataType: "module" /* module */,
953
+ dataId: "control" /* control */,
954
+ connection: "target",
955
+ label: "Control Module",
956
+ maxConnections: 1
957
+ },
958
+ {
959
+ position: _system.Position.Right,
960
+ dataType: "module" /* module */,
961
+ dataId: "output" /* output */,
962
+ connection: "source"
963
+ }
964
+ ]
965
+ }}
966
+ }, _class25);
967
+
968
+ // src/templates/selectors/noise-select-template.ts
969
+
970
+ var NoiseSelectNodeTemplateFactory = (_class26 = class {constructor() { _class26.prototype.__init26.call(this); }
971
+ __init26() {this.template = {
972
+ type: "noise-select" /* noiseSelect */,
973
+ group: "Noise Selectors" /* noiseSelectors */,
974
+ data: {
975
+ title: "Noise Select",
976
+ edgeFalloff: 0,
977
+ lowerBound: -1,
978
+ upperBound: 1
979
+ },
980
+ handles: [
981
+ {
982
+ position: _system.Position.Left,
983
+ dataType: "module" /* module */,
984
+ dataId: "source" /* source */,
985
+ connection: "target",
986
+ label: "Source Modules",
987
+ maxConnections: 2,
988
+ minConnections: 2
989
+ },
990
+ {
991
+ position: _system.Position.Left,
992
+ dataType: "module" /* module */,
993
+ dataId: "control" /* control */,
994
+ connection: "target",
995
+ label: "Control Module",
996
+ maxConnections: 1
997
+ },
998
+ {
999
+ position: _system.Position.Right,
1000
+ dataType: "module" /* module */,
1001
+ dataId: "output" /* output */,
1002
+ connection: "source"
1003
+ }
1004
+ ]
1005
+ }}
1006
+ }, _class26);
1007
+
1008
+ // src/templates/transformers/noise-displace-template.ts
1009
+
1010
+ var NoiseDisplaceNodeTemplateFactory = (_class27 = class {constructor() { _class27.prototype.__init27.call(this); }
1011
+ __init27() {this.template = {
1012
+ type: "noise-displace" /* noiseDisplace */,
1013
+ group: "Noise Transformers" /* noiseTransformers */,
1014
+ data: {
1015
+ title: "Noise Displace"
1016
+ },
1017
+ handles: [
1018
+ {
1019
+ position: _system.Position.Left,
1020
+ connection: "target",
1021
+ label: "Source Module",
1022
+ dataType: "module" /* module */,
1023
+ dataId: "source" /* sourceModule */,
1024
+ maxConnections: 1
1025
+ },
1026
+ {
1027
+ position: _system.Position.Left,
1028
+ connection: "target",
1029
+ label: "X Module",
1030
+ dataType: "module" /* module */,
1031
+ dataId: "x-module" /* xModule */,
1032
+ maxConnections: 1
1033
+ },
1034
+ {
1035
+ position: _system.Position.Left,
1036
+ connection: "target",
1037
+ label: "Y Module",
1038
+ dataType: "module" /* module */,
1039
+ dataId: "y-module" /* yModule */,
1040
+ maxConnections: 1
1041
+ },
1042
+ {
1043
+ position: _system.Position.Left,
1044
+ connection: "target",
1045
+ label: "Z Module",
1046
+ dataType: "module" /* module */,
1047
+ dataId: "z-module" /* zModule */,
1048
+ maxConnections: 1
1049
+ },
1050
+ {
1051
+ position: _system.Position.Right,
1052
+ dataType: "module" /* module */,
1053
+ dataId: "output" /* output */,
1054
+ connection: "source"
1055
+ }
1056
+ ]
1057
+ }}
1058
+ }, _class27);
1059
+
1060
+ // src/templates/transformers/noise-rotate-point-template.ts
1061
+
1062
+ var NoiseRotatePointNodeTemplateFactory = (_class28 = class {constructor() { _class28.prototype.__init28.call(this); }
1063
+ __init28() {this.template = {
1064
+ type: "noise-rotate-point" /* noiseRotatePoint */,
1065
+ group: "Noise Transformers" /* noiseTransformers */,
1066
+ data: {
1067
+ title: "Noise Rotate Point",
1068
+ xAngle: 0,
1069
+ yAngle: 0,
1070
+ zAngle: 0
1071
+ },
1072
+ handles: [
1073
+ {
1074
+ position: _system.Position.Left,
1075
+ dataType: "module" /* module */,
1076
+ connection: "target",
1077
+ label: "Source Module",
1078
+ maxConnections: 1
1079
+ },
1080
+ {
1081
+ position: _system.Position.Right,
1082
+ dataType: "module" /* module */,
1083
+ connection: "source"
1084
+ }
1085
+ ]
1086
+ }}
1087
+ }, _class28);
1088
+
1089
+ // src/templates/transformers/noise-scale-point-template.ts
1090
+
1091
+ var NoiseScalePointNodeTemplateFactory = (_class29 = class {constructor() { _class29.prototype.__init29.call(this); }
1092
+ __init29() {this.template = {
1093
+ type: "noise-scale-point" /* noiseScalePoint */,
1094
+ group: "Noise Transformers" /* noiseTransformers */,
1095
+ data: {
1096
+ title: "Noise Scale Point",
1097
+ xScale: 1,
1098
+ yScale: 1,
1099
+ zScale: 1
1100
+ },
1101
+ handles: [
1102
+ {
1103
+ position: _system.Position.Left,
1104
+ dataType: "module" /* module */,
1105
+ connection: "target",
1106
+ label: "Source Module",
1107
+ maxConnections: 1
1108
+ },
1109
+ {
1110
+ position: _system.Position.Right,
1111
+ dataType: "module" /* module */,
1112
+ connection: "source"
1113
+ }
1114
+ ]
1115
+ }}
1116
+ }, _class29);
1117
+
1118
+ // src/templates/transformers/noise-translate-point-template.ts
1119
+
1120
+ var NoiseTranslatePointNodeTemplateFactory = (_class30 = class {constructor() { _class30.prototype.__init30.call(this); }
1121
+ __init30() {this.template = {
1122
+ type: "noise-translate-point" /* noiseTranslatePoint */,
1123
+ group: "Noise Transformers" /* noiseTransformers */,
1124
+ data: {
1125
+ title: "Noise Translate Point",
1126
+ translateX: 0,
1127
+ translateY: 0,
1128
+ translateZ: 0
1129
+ },
1130
+ handles: [
1131
+ {
1132
+ position: _system.Position.Left,
1133
+ dataType: "module" /* module */,
1134
+ connection: "target",
1135
+ label: "Source Module",
1136
+ maxConnections: 1
1137
+ },
1138
+ {
1139
+ position: _system.Position.Right,
1140
+ dataType: "module" /* module */,
1141
+ connection: "source"
1142
+ }
1143
+ ]
1144
+ }}
1145
+ }, _class30);
1146
+
1147
+ // src/templates/transformers/noise-turbulence-template.ts
1148
+
1149
+
1150
+ var NoiseTurbulenceNodeTemplateFactory = (_class31 = class {constructor() { _class31.prototype.__init31.call(this); }
1151
+ __init31() {this.template = {
1152
+ type: "noise-turbulence" /* noiseTurbulence */,
1153
+ group: "Noise Transformers" /* noiseTransformers */,
1154
+ data: {
1155
+ title: "Noise Turbulence",
1156
+ frequency: 1,
1157
+ power: 1,
1158
+ roughness: 1,
1159
+ seed: 0
1160
+ },
1161
+ handles: [
1162
+ {
1163
+ position: _system.Position.Left,
1164
+ dataType: "module" /* module */,
1165
+ connection: "target",
1166
+ label: "Source Module",
1167
+ maxConnections: 1
1168
+ },
1169
+ {
1170
+ position: _system.Position.Left,
1171
+ dataType: _abstract.CoreHandleType.variableProperty,
1172
+ label: "Variable Properties",
1173
+ connection: "target"
1174
+ },
1175
+ {
1176
+ position: _system.Position.Right,
1177
+ dataType: "module" /* module */,
1178
+ connection: "source"
1179
+ }
1180
+ ]
1181
+ }}
1182
+ }, _class31);
1183
+
1184
+ // src/abstract/node-types.ts
1185
+ var NoiseNodeType = /* @__PURE__ */ ((NoiseNodeType2) => {
1186
+ NoiseNodeType2["position"] = "position";
1187
+ NoiseNodeType2["grid"] = "grid";
1188
+ NoiseNodeType2["textureData"] = "texture-data";
1189
+ NoiseNodeType2["groupModule"] = "group-module";
1190
+ NoiseNodeType2["positionLogger"] = "position-logger";
1191
+ NoiseNodeType2["noiseLogger"] = "noise-logger";
1192
+ NoiseNodeType2["noiseOutput"] = "noise-output";
1193
+ NoiseNodeType2["noiseConst"] = "noise-constant";
1194
+ NoiseNodeType2["noiseBillow"] = "noise-billow";
1195
+ NoiseNodeType2["noiseCheckerboard"] = "noise-checkerboard";
1196
+ NoiseNodeType2["noiseNormalize"] = "noise-normalize";
1197
+ NoiseNodeType2["noiseCylinders"] = "noise-cylinders";
1198
+ NoiseNodeType2["noisePerlin"] = "noise-perlin";
1199
+ NoiseNodeType2["noiseRidgedMulti"] = "noise-ridged-multi";
1200
+ NoiseNodeType2["noiseSpheres"] = "noise-spheres";
1201
+ NoiseNodeType2["noiseVoronoi"] = "noise-voronoi";
1202
+ NoiseNodeType2["noiseCombine"] = "noise-combiner";
1203
+ NoiseNodeType2["noiseClamp"] = "noise-clamp";
1204
+ NoiseNodeType2["noiseAbs"] = "noise-abs";
1205
+ NoiseNodeType2["noiseCurve"] = "noise-curve";
1206
+ NoiseNodeType2["noiseExponent"] = "noise-exponent";
1207
+ NoiseNodeType2["noiseInvert"] = "noise-invert";
1208
+ NoiseNodeType2["noiseScaleBias"] = "noise-scale-bias";
1209
+ NoiseNodeType2["noiseTerrace"] = "noise-terrace";
1210
+ NoiseNodeType2["noiseBlend"] = "noise-blend";
1211
+ NoiseNodeType2["noiseSelect"] = "noise-select";
1212
+ NoiseNodeType2["noiseDisplace"] = "noise-displace";
1213
+ NoiseNodeType2["noiseRotatePoint"] = "noise-rotate-point";
1214
+ NoiseNodeType2["noiseScalePoint"] = "noise-scale-point";
1215
+ NoiseNodeType2["noiseTranslatePoint"] = "noise-translate-point";
1216
+ NoiseNodeType2["noiseTurbulence"] = "noise-turbulence";
1217
+ return NoiseNodeType2;
1218
+ })(NoiseNodeType || {});
1219
+ var noiseNodeTypes = {
1220
+ ["group-module" /* groupModule */]: _chunkM67JHEU2cjs.module_group_node_default,
1221
+ ["position" /* position */]: _chunkD5JM4EYQcjs.position_const_node_default,
1222
+ ["grid" /* grid */]: _chunkD5JM4EYQcjs.position_grid_node_default,
1223
+ ["noise-output" /* noiseOutput */]: noise_output_node_default,
1224
+ ["texture-data" /* textureData */]: noise_raw_texture_node_default,
1225
+ ["noise-logger" /* noiseLogger */]: noise_logger_node_default,
1226
+ ["position-logger" /* positionLogger */]: positions_logger_node_default,
1227
+ ["noise-constant" /* noiseConst */]: _chunkD5JM4EYQcjs.noise_const_node_default,
1228
+ ["noise-billow" /* noiseBillow */]: _chunkD5JM4EYQcjs.noise_billow_node_default,
1229
+ ["noise-checkerboard" /* noiseCheckerboard */]: _chunkD5JM4EYQcjs.noise_checkerboard_node_default,
1230
+ ["noise-cylinders" /* noiseCylinders */]: _chunkD5JM4EYQcjs.noise_cylinders_node_default,
1231
+ ["noise-perlin" /* noisePerlin */]: _chunkD5JM4EYQcjs.noise_perlin_node_default,
1232
+ ["noise-ridged-multi" /* noiseRidgedMulti */]: _chunkD5JM4EYQcjs.noise_ridgedmulti_node_default,
1233
+ ["noise-spheres" /* noiseSpheres */]: _chunkD5JM4EYQcjs.noise_spheres_node_default,
1234
+ ["noise-voronoi" /* noiseVoronoi */]: _chunkD5JM4EYQcjs.noise_voronoi_node_default,
1235
+ ["noise-combiner" /* noiseCombine */]: _chunkTZCT2GZVcjs.noise_combine_node_default,
1236
+ ["noise-clamp" /* noiseClamp */]: _chunkTZCT2GZVcjs.noise_clamp_node_default,
1237
+ ["noise-abs" /* noiseAbs */]: _chunkTZCT2GZVcjs.noise_abs_node_default,
1238
+ ["noise-normalize" /* noiseNormalize */]: _chunkTZCT2GZVcjs.noise_normalize_node_default,
1239
+ ["noise-curve" /* noiseCurve */]: _chunkTZCT2GZVcjs.noise_curve_node_default,
1240
+ ["noise-exponent" /* noiseExponent */]: _chunkTZCT2GZVcjs.noise_exponent_node_default,
1241
+ ["noise-invert" /* noiseInvert */]: _chunkTZCT2GZVcjs.noise_invert_node_default,
1242
+ ["noise-scale-bias" /* noiseScaleBias */]: _chunkTZCT2GZVcjs.noise_scale_bias_node_default,
1243
+ ["noise-terrace" /* noiseTerrace */]: _chunkTZCT2GZVcjs.noise_terrace_node_default,
1244
+ ["noise-blend" /* noiseBlend */]: noise_blend_node_default,
1245
+ ["noise-select" /* noiseSelect */]: noise_select_node_default,
1246
+ ["noise-displace" /* noiseDisplace */]: _chunkRKTZQUWRcjs.noise_displace_node_default,
1247
+ ["noise-rotate-point" /* noiseRotatePoint */]: _chunkRKTZQUWRcjs.noise_rotate_point_node_default,
1248
+ ["noise-scale-point" /* noiseScalePoint */]: _chunkRKTZQUWRcjs.noise_scale_point_node_default,
1249
+ ["noise-translate-point" /* noiseTranslatePoint */]: _chunkRKTZQUWRcjs.noise_translate_point_node_default,
1250
+ ["noise-turbulence" /* noiseTurbulence */]: _chunkRKTZQUWRcjs.noise_turbulence_node_default
1251
+ };
1252
+ var noiseNodeTemplates = {
1253
+ ["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
1254
+ ["noise-billow" /* noiseBillow */]: new NoiseBillowNodeTemplateFactory(),
1255
+ ["noise-checkerboard" /* noiseCheckerboard */]: new NoiseCheckerboardNodeTemplateFactory(),
1256
+ ["noise-normalize" /* noiseNormalize */]: new NoiseNormalizeNodeTemplateFactory(),
1257
+ ["noise-logger" /* noiseLogger */]: new NoiseLoggerNodeTemplateFactory(),
1258
+ ["noise-constant" /* noiseConst */]: new NoiseConstNodeTemplateFactory(),
1259
+ ["position" /* position */]: new PositionConstNodeTemplateFactory(),
1260
+ ["position-logger" /* positionLogger */]: new PositionLoggerNodeTemplateFactory(),
1261
+ ["grid" /* grid */]: new PositionGridNodeTemplateFactory(),
1262
+ ["texture-data" /* textureData */]: new NoiseRawTextureTemplateFactory(),
1263
+ ["noise-cylinders" /* noiseCylinders */]: new NoiseCylindersNodeTemplateFactory(),
1264
+ ["noise-perlin" /* noisePerlin */]: new NoisePerlinNodeTemplateFactory(),
1265
+ ["noise-ridged-multi" /* noiseRidgedMulti */]: new NoiseRidgedMultiNodeTemplateFactory(),
1266
+ ["noise-spheres" /* noiseSpheres */]: new NoiseSpheresNodeTemplateFactory(),
1267
+ ["noise-voronoi" /* noiseVoronoi */]: new NoiseVoronoiNodeTemplateFactory(),
1268
+ ["noise-combiner" /* noiseCombine */]: new NoiseCombineNodeTemplateFactory(),
1269
+ ["noise-clamp" /* noiseClamp */]: new NoiseClampNodeTemplateFactory(),
1270
+ ["noise-abs" /* noiseAbs */]: new NoiseAbsNodeTemplateFactory(),
1271
+ ["noise-curve" /* noiseCurve */]: new NoiseCurveNodeTemplateFactory(),
1272
+ ["noise-exponent" /* noiseExponent */]: new NoiseExponentNodeTemplateFactory(),
1273
+ ["noise-invert" /* noiseInvert */]: new NoiseInvertNodeTemplateFactory(),
1274
+ ["noise-scale-bias" /* noiseScaleBias */]: new NoiseScaleBiasNodeTemplateFactory(),
1275
+ ["noise-terrace" /* noiseTerrace */]: new NoiseTerraceNodeTemplateFactory(),
1276
+ ["noise-blend" /* noiseBlend */]: new NoiseBlendNodeTemplateFactory(),
1277
+ ["noise-select" /* noiseSelect */]: new NoiseSelectNodeTemplateFactory(),
1278
+ ["noise-displace" /* noiseDisplace */]: new NoiseDisplaceNodeTemplateFactory(),
1279
+ ["noise-rotate-point" /* noiseRotatePoint */]: new NoiseRotatePointNodeTemplateFactory(),
1280
+ ["noise-scale-point" /* noiseScalePoint */]: new NoiseScalePointNodeTemplateFactory(),
1281
+ ["noise-translate-point" /* noiseTranslatePoint */]: new NoiseTranslatePointNodeTemplateFactory(),
1282
+ ["noise-turbulence" /* noiseTurbulence */]: new NoiseTurbulenceNodeTemplateFactory(),
1283
+ ["group-module" /* groupModule */]: new ModuleGroupNodeTemplateFactory()
1284
+ };
1285
+
1286
+ // src/nodes/output/noise-output-node.tsx
1287
+
1288
+ function NoiseOutputNode({ id, selected, data, type }) {
1289
+ const [size, setSize] = _react.useState.call(void 0, 0);
1290
+ const updateComputedData = _hooks.useUpdateNodeComputedData.call(void 0, );
1291
+ const onDataUpdated = _react.useCallback.call(void 0,
1292
+ (handleData) => {
1293
+ const incomingPositions = handleData["position" /* position */];
1294
+ const incomingModule = handleData["module" /* module */];
1295
+ if (_optionalChain([incomingPositions, 'optionalAccess', _31 => _31.length]) && _optionalChain([incomingModule, 'optionalAccess', _32 => _32.length]) && _optionalChain([incomingModule, 'access', _33 => _33[0], 'optionalAccess', _34 => _34.module])) {
1296
+ const { module } = incomingModule[0];
1297
+ const noise = [];
1298
+ for (const input of incomingPositions) {
1299
+ for (const position of input.positions) {
1300
+ const value = module.getValue(position.x, position.y, position.z);
1301
+ noise.push({
1302
+ position,
1303
+ value
1304
+ });
1305
+ }
1306
+ }
1307
+ updateComputedData(id, { noise, module });
1308
+ setSize(noise.length);
1309
+ }
1310
+ },
1311
+ []
1312
+ );
1313
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _layout.NodeContainer, { id, selected, data, type, children: [
1314
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1315
+ _components.HandlesIncomingDataStatus,
1316
+ {
1317
+ nodeId: id,
1318
+ handles: data.handles,
1319
+ handleKey: "dataType",
1320
+ onDataUpdated,
1321
+ type: "target",
1322
+ resetComputedData: true
1323
+ }
1324
+ ),
1325
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _core.Text, { mt: 5, children: [
1326
+ "Noise points: ",
1327
+ size
1328
+ ] }),
1329
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _layout.NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
1330
+ ] });
1331
+ }
1332
+ var noise_output_node_default = NoiseOutputNode;
1333
+
1334
+
1335
+
1336
+
1337
+
1338
+
1339
+
1340
+
1341
+
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+
1353
+
1354
+
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+
1368
+
1369
+
1370
+
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+ exports.noise_logger_node_default = noise_logger_node_default; exports.noise_output_node_default = noise_output_node_default; exports.noise_raw_texture_node_default = noise_raw_texture_node_default; exports.positions_logger_node_default = positions_logger_node_default; exports.noise_blend_node_default = noise_blend_node_default; exports.noise_select_node_default = noise_select_node_default; exports.NoiseTemplateGroup = NoiseTemplateGroup; exports.NoiseBillowNodeTemplateFactory = NoiseBillowNodeTemplateFactory; exports.NoiseCheckerboardNodeTemplateFactory = NoiseCheckerboardNodeTemplateFactory; exports.NoiseConstNodeTemplateFactory = NoiseConstNodeTemplateFactory; exports.NoiseCylindersNodeTemplateFactory = NoiseCylindersNodeTemplateFactory; exports.NoisePerlinNodeTemplateFactory = NoisePerlinNodeTemplateFactory; exports.NoiseRidgedMultiNodeTemplateFactory = NoiseRidgedMultiNodeTemplateFactory; exports.NoiseSpheresNodeTemplateFactory = NoiseSpheresNodeTemplateFactory; exports.NoiseVoronoiNodeTemplateFactory = NoiseVoronoiNodeTemplateFactory; exports.PositionConstNodeTemplateFactory = PositionConstNodeTemplateFactory; exports.PositionGridNodeTemplateFactory = PositionGridNodeTemplateFactory; exports.ModuleGroupNodeTemplateFactory = ModuleGroupNodeTemplateFactory; exports.NoiseAbsNodeTemplateFactory = NoiseAbsNodeTemplateFactory; exports.NoiseClampNodeTemplateFactory = NoiseClampNodeTemplateFactory; exports.NoiseCombineNodeTemplateFactory = NoiseCombineNodeTemplateFactory; exports.NoiseCurveNodeTemplateFactory = NoiseCurveNodeTemplateFactory; exports.NoiseExponentNodeTemplateFactory = NoiseExponentNodeTemplateFactory; exports.NoiseInvertNodeTemplateFactory = NoiseInvertNodeTemplateFactory; exports.NoiseNormalizeNodeTemplateFactory = NoiseNormalizeNodeTemplateFactory; exports.NoiseScaleBiasNodeTemplateFactory = NoiseScaleBiasNodeTemplateFactory; exports.NoiseTerraceNodeTemplateFactory = NoiseTerraceNodeTemplateFactory; exports.NoiseLoggerNodeTemplateFactory = NoiseLoggerNodeTemplateFactory; exports.NoiseOutputNodeTemplateFactory = NoiseOutputNodeTemplateFactory; exports.NoiseRawTextureTemplateFactory = NoiseRawTextureTemplateFactory; exports.PositionLoggerNodeTemplateFactory = PositionLoggerNodeTemplateFactory; exports.NoiseBlendNodeTemplateFactory = NoiseBlendNodeTemplateFactory; exports.NoiseSelectNodeTemplateFactory = NoiseSelectNodeTemplateFactory; exports.NoiseDisplaceNodeTemplateFactory = NoiseDisplaceNodeTemplateFactory; exports.NoiseRotatePointNodeTemplateFactory = NoiseRotatePointNodeTemplateFactory; exports.NoiseScalePointNodeTemplateFactory = NoiseScalePointNodeTemplateFactory; exports.NoiseTranslatePointNodeTemplateFactory = NoiseTranslatePointNodeTemplateFactory; exports.NoiseTurbulenceNodeTemplateFactory = NoiseTurbulenceNodeTemplateFactory; exports.NoiseNodeType = NoiseNodeType; exports.noiseNodeTypes = noiseNodeTypes; exports.noiseNodeTemplates = noiseNodeTemplates;