@field/cascade 0.5.1 → 0.6.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.
- package/CHANGELOG.md +63 -0
- package/dist/assets/{CodeEditor-dOrU3aQg.js → CodeEditor-BLpahZw6.js} +7 -7
- package/dist/assets/{CodePanel-Bqy85qen.js → CodePanel-BqYKqBMH.js} +2 -2
- package/dist/assets/{CustomNodeDialog-DkZlOgjs.js → CustomNodeDialog-CYr9y7dG.js} +1 -1
- package/dist/assets/{ProjectSettings-D192mr6g.js → ProjectSettings-CnYfrkKh.js} +2 -2
- package/dist/assets/{SettingsDialog-BTeeIE3T.js → SettingsDialog-mSS6KUyS.js} +1 -1
- package/dist/assets/{VersionHistoryDialog-TZQKkn3Y.js → VersionHistoryDialog-DZuwNG6s.js} +1 -1
- package/dist/assets/{core-DwbcGL0o.js → core-BOGrwBxU.js} +2 -2
- package/dist/assets/{cssMode-Dcjn356x.js → cssMode-0Z3pyDOW.js} +1 -1
- package/dist/assets/definitions-Cckh442l.js +1 -0
- package/dist/assets/{editor.api-D7Q83606.js → editor.api-D-_7pnnj.js} +1 -1
- package/dist/assets/{freemarker2-DCCiHlV6.js → freemarker2-DE0JRkF7.js} +1 -1
- package/dist/assets/geo-DcAVygkw.js +1 -0
- package/dist/assets/{handlebars-BCxC8xu1.js → handlebars-B_Shirzj.js} +1 -1
- package/dist/assets/{html-COwepzSd.js → html-DI5Qj4gd.js} +1 -1
- package/dist/assets/{htmlMode-Dpg7H0rx.js → htmlMode-CkHZy0mE.js} +1 -1
- package/dist/assets/{image-CMfMMxlC.js → image-B6RU2frM.js} +3 -3
- package/dist/assets/{index-De1cIZ9N.js → index-DTyzl6YV.js} +36 -36
- package/dist/assets/{javascript-CSwWxfLr.js → javascript-zxQfbzS_.js} +1 -1
- package/dist/assets/{jsonMode-BXRriTpj.js → jsonMode-DSQ0uLqA.js} +1 -1
- package/dist/assets/{liquid-Cmkfyogc.js → liquid-0zs2oOuA.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-xH9JbZGO.js → lspLanguageFeatures-7VWaq5lc.js} +1 -1
- package/dist/assets/math-BA6juJD7.js +1 -0
- package/dist/assets/{mdx-BzrNjNvK.js → mdx-BFKlF5Xh.js} +1 -1
- package/dist/assets/pop-Bkzzmp57.js +1 -0
- package/dist/assets/{python-D4E9jbx7.js → python-BgexpWZh.js} +1 -1
- package/dist/assets/{razor-B3x9cIEM.js → razor-E1kWyvkT.js} +1 -1
- package/dist/assets/{tsMode-dhQYPNMZ.js → tsMode-CTmJLLW5.js} +1 -1
- package/dist/assets/{typescript-CITkDxAE.js → typescript-BheZLRDM.js} +1 -1
- package/dist/assets/{workers-BQvF9bbO.js → workers-KIoho05H.js} +1 -1
- package/dist/assets/{xml-DvHlU3A8.js → xml-DaVLg9zI.js} +1 -1
- package/dist/assets/{yaml-uznsLgs8.js → yaml-D6XGTfOj.js} +1 -1
- package/dist/cli/index.js +632 -289
- package/dist/index.html +1 -1
- package/dist/runtime/builtins/index.js +2 -0
- package/dist/runtime/builtins/math/definitions.d.ts +845 -0
- package/dist/runtime/builtins/math/definitions.js +285 -0
- package/dist/runtime/builtins/math/index.d.ts +2 -0
- package/dist/runtime/builtins/math/index.js +2 -0
- package/doc/NODE_REFERENCE.md +115 -0
- package/package.json +1 -1
- package/dist/assets/definitions-C_SY6Bhg.js +0 -1
- package/dist/assets/geo-CT-wtvaE.js +0 -1
- package/dist/assets/pop-BdKEHslJ.js +0 -1
|
@@ -0,0 +1,845 @@
|
|
|
1
|
+
import type { NodeExecutionContext } from "@field/cascade/contracts";
|
|
2
|
+
import type { DefinitionNodeRegistration } from "../../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Division and modulo by zero give **zero**, not `Infinity` or `NaN`.
|
|
5
|
+
*
|
|
6
|
+
* Both choices hide something, so this is the lesser one. A non-finite number
|
|
7
|
+
* flows downstream into a position and the geometry silently vanishes — a
|
|
8
|
+
* blank frame with no error anywhere, which is the hardest thing to diagnose
|
|
9
|
+
* here. And a zero divisor is almost always a parameter nobody set yet rather
|
|
10
|
+
* than an intent, so zero is also the likelier thing to have meant.
|
|
11
|
+
*/
|
|
12
|
+
declare function divide(a: number, b: number): number;
|
|
13
|
+
declare const BINARY: {
|
|
14
|
+
readonly add: (a: number, b: number) => number;
|
|
15
|
+
readonly subtract: (a: number, b: number) => number;
|
|
16
|
+
readonly multiply: (a: number, b: number) => number;
|
|
17
|
+
readonly divide: typeof divide;
|
|
18
|
+
readonly power: (a: number, b: number) => number;
|
|
19
|
+
readonly modulo: (a: number, b: number) => number;
|
|
20
|
+
readonly min: (a: number, b: number) => number;
|
|
21
|
+
readonly max: (a: number, b: number) => number;
|
|
22
|
+
readonly atan2: (a: number, b: number) => number;
|
|
23
|
+
};
|
|
24
|
+
declare const UNARY: {
|
|
25
|
+
readonly abs: (x: number) => number;
|
|
26
|
+
readonly negate: (a: number) => number;
|
|
27
|
+
readonly floor: (x: number) => number;
|
|
28
|
+
readonly ceil: (x: number) => number;
|
|
29
|
+
readonly round: (x: number) => number;
|
|
30
|
+
readonly sqrt: (a: number) => number;
|
|
31
|
+
readonly sign: (x: number) => number;
|
|
32
|
+
readonly sin: (x: number) => number;
|
|
33
|
+
readonly cos: (x: number) => number;
|
|
34
|
+
readonly tan: (x: number) => number;
|
|
35
|
+
readonly asin: (a: number) => number;
|
|
36
|
+
readonly acos: (a: number) => number;
|
|
37
|
+
readonly exp: (x: number) => number;
|
|
38
|
+
readonly log: (a: number) => number;
|
|
39
|
+
readonly radians: (a: number) => number;
|
|
40
|
+
readonly degrees: (a: number) => number;
|
|
41
|
+
/** The fractional part, always positive — `fract(-0.25)` is `0.75`, which is
|
|
42
|
+
* what a repeating pattern wants and what GLSL's `fract` does. */
|
|
43
|
+
readonly fract: (a: number) => number;
|
|
44
|
+
};
|
|
45
|
+
declare const COMPARE: {
|
|
46
|
+
readonly greater: (a: number, b: number) => boolean;
|
|
47
|
+
readonly "greater-or-equal": (a: number, b: number) => boolean;
|
|
48
|
+
readonly less: (a: number, b: number) => boolean;
|
|
49
|
+
readonly "less-or-equal": (a: number, b: number) => boolean;
|
|
50
|
+
readonly equal: (a: number, b: number) => boolean;
|
|
51
|
+
readonly "not-equal": (a: number, b: number) => boolean;
|
|
52
|
+
};
|
|
53
|
+
export declare const binaryDefinition: {
|
|
54
|
+
readonly apiVersion: 1;
|
|
55
|
+
readonly label: "Binary Math";
|
|
56
|
+
readonly description: "Two values, one operation. Component-wise, and a scalar broadcasts against a vector.";
|
|
57
|
+
readonly icon: "Plus";
|
|
58
|
+
readonly runsOn: "portable";
|
|
59
|
+
readonly inputs: {
|
|
60
|
+
readonly a: {
|
|
61
|
+
readonly kind: "data";
|
|
62
|
+
readonly type: "any";
|
|
63
|
+
readonly default: 0;
|
|
64
|
+
readonly description: "First value.";
|
|
65
|
+
};
|
|
66
|
+
readonly b: {
|
|
67
|
+
readonly kind: "data";
|
|
68
|
+
readonly type: "any";
|
|
69
|
+
readonly default: 0;
|
|
70
|
+
readonly description: "Second value.";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
readonly outputs: {
|
|
74
|
+
readonly value: {
|
|
75
|
+
readonly kind: "data";
|
|
76
|
+
readonly type: "any";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
readonly props: {
|
|
80
|
+
readonly operation: {
|
|
81
|
+
readonly type: "string";
|
|
82
|
+
readonly default: "add";
|
|
83
|
+
readonly control: "select";
|
|
84
|
+
readonly options: {
|
|
85
|
+
value: string;
|
|
86
|
+
label: string;
|
|
87
|
+
}[];
|
|
88
|
+
readonly label: "Operation";
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export declare function executeBinary(context: NodeExecutionContext<typeof binaryDefinition>): void;
|
|
93
|
+
export declare const unaryDefinition: {
|
|
94
|
+
readonly apiVersion: 1;
|
|
95
|
+
readonly label: "Unary Math";
|
|
96
|
+
readonly description: "One value, one operation. Trigonometry is in radians.";
|
|
97
|
+
readonly icon: "FunctionSquare";
|
|
98
|
+
readonly runsOn: "portable";
|
|
99
|
+
readonly inputs: {
|
|
100
|
+
readonly value: {
|
|
101
|
+
readonly kind: "data";
|
|
102
|
+
readonly type: "any";
|
|
103
|
+
readonly default: 0;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
readonly outputs: {
|
|
107
|
+
readonly value: {
|
|
108
|
+
readonly kind: "data";
|
|
109
|
+
readonly type: "any";
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
readonly props: {
|
|
113
|
+
readonly operation: {
|
|
114
|
+
readonly type: "string";
|
|
115
|
+
readonly default: "abs";
|
|
116
|
+
readonly control: "select";
|
|
117
|
+
readonly options: {
|
|
118
|
+
value: string;
|
|
119
|
+
label: string;
|
|
120
|
+
}[];
|
|
121
|
+
readonly label: "Operation";
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
export declare function executeUnary(context: NodeExecutionContext<typeof unaryDefinition>): void;
|
|
126
|
+
export declare const clampDefinition: {
|
|
127
|
+
readonly apiVersion: 1;
|
|
128
|
+
readonly label: "Clamp";
|
|
129
|
+
readonly description: "Hold a value between two bounds.";
|
|
130
|
+
readonly icon: "Brackets";
|
|
131
|
+
readonly runsOn: "portable";
|
|
132
|
+
readonly inputs: {
|
|
133
|
+
readonly value: {
|
|
134
|
+
readonly kind: "data";
|
|
135
|
+
readonly type: "any";
|
|
136
|
+
readonly default: 0;
|
|
137
|
+
};
|
|
138
|
+
readonly min: {
|
|
139
|
+
readonly kind: "data";
|
|
140
|
+
readonly type: "any";
|
|
141
|
+
readonly default: 0;
|
|
142
|
+
};
|
|
143
|
+
readonly max: {
|
|
144
|
+
readonly kind: "data";
|
|
145
|
+
readonly type: "any";
|
|
146
|
+
readonly default: 1;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
readonly outputs: {
|
|
150
|
+
readonly value: {
|
|
151
|
+
readonly kind: "data";
|
|
152
|
+
readonly type: "any";
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
readonly props: {};
|
|
156
|
+
};
|
|
157
|
+
export declare function executeClamp(context: NodeExecutionContext<typeof clampDefinition>): void;
|
|
158
|
+
export declare const mixDefinition: {
|
|
159
|
+
readonly apiVersion: 1;
|
|
160
|
+
readonly label: "Mix";
|
|
161
|
+
readonly description: "Blend between two values. Houdini's lerp.";
|
|
162
|
+
readonly icon: "Blend";
|
|
163
|
+
readonly runsOn: "portable";
|
|
164
|
+
readonly inputs: {
|
|
165
|
+
readonly a: {
|
|
166
|
+
readonly kind: "data";
|
|
167
|
+
readonly type: "any";
|
|
168
|
+
readonly default: 0;
|
|
169
|
+
readonly description: "The value at 0.";
|
|
170
|
+
};
|
|
171
|
+
readonly b: {
|
|
172
|
+
readonly kind: "data";
|
|
173
|
+
readonly type: "any";
|
|
174
|
+
readonly default: 1;
|
|
175
|
+
readonly description: "The value at 1.";
|
|
176
|
+
};
|
|
177
|
+
readonly bias: {
|
|
178
|
+
readonly kind: "data";
|
|
179
|
+
readonly type: "float";
|
|
180
|
+
readonly default: 0.5;
|
|
181
|
+
readonly min: 0;
|
|
182
|
+
readonly max: 1;
|
|
183
|
+
readonly step: 0.01;
|
|
184
|
+
readonly description: "Not clamped: past 0..1 this extrapolates, which is useful.";
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
readonly outputs: {
|
|
188
|
+
readonly value: {
|
|
189
|
+
readonly kind: "data";
|
|
190
|
+
readonly type: "any";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
readonly props: {};
|
|
194
|
+
};
|
|
195
|
+
export declare function executeMix(context: NodeExecutionContext<typeof mixDefinition>): void;
|
|
196
|
+
export declare const compareDefinition: {
|
|
197
|
+
readonly apiVersion: 1;
|
|
198
|
+
readonly label: "Compare";
|
|
199
|
+
readonly description: "Test two values. Outputs a bool, for a Switch.";
|
|
200
|
+
readonly icon: "Equal";
|
|
201
|
+
readonly runsOn: "portable";
|
|
202
|
+
readonly inputs: {
|
|
203
|
+
readonly a: {
|
|
204
|
+
readonly kind: "data";
|
|
205
|
+
readonly type: "float";
|
|
206
|
+
readonly default: 0;
|
|
207
|
+
};
|
|
208
|
+
readonly b: {
|
|
209
|
+
readonly kind: "data";
|
|
210
|
+
readonly type: "float";
|
|
211
|
+
readonly default: 0;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
readonly outputs: {
|
|
215
|
+
readonly result: {
|
|
216
|
+
readonly kind: "data";
|
|
217
|
+
readonly type: "bool";
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
readonly props: {
|
|
221
|
+
readonly operation: {
|
|
222
|
+
readonly type: "string";
|
|
223
|
+
readonly default: "greater";
|
|
224
|
+
readonly control: "select";
|
|
225
|
+
readonly options: {
|
|
226
|
+
value: string;
|
|
227
|
+
label: string;
|
|
228
|
+
}[];
|
|
229
|
+
readonly label: "Test";
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* Scalars only, unlike the rest of this namespace.
|
|
233
|
+
*
|
|
234
|
+
* "Is this vector greater than that one" has no single right answer — all
|
|
235
|
+
* components, any component, or the length — and a node that picked one
|
|
236
|
+
* silently would be wrong for the other two readings. A comparison feeding
|
|
237
|
+
* a `Switch` wants one boolean, so the input is a `float` and the question
|
|
238
|
+
* does not arise.
|
|
239
|
+
*/
|
|
240
|
+
readonly tolerance: {
|
|
241
|
+
readonly type: "float";
|
|
242
|
+
readonly default: 0;
|
|
243
|
+
readonly min: 0;
|
|
244
|
+
readonly label: "Tolerance";
|
|
245
|
+
readonly description: "Slack for Equal and Not Equal. Floating point rarely lands on exactly equal.";
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
export declare function executeCompare(context: NodeExecutionContext<typeof compareDefinition>): void;
|
|
250
|
+
export declare const binaryRegistration: {
|
|
251
|
+
kind: "definition-v1";
|
|
252
|
+
moduleId: string;
|
|
253
|
+
definition: {
|
|
254
|
+
readonly apiVersion: 1;
|
|
255
|
+
readonly label: "Binary Math";
|
|
256
|
+
readonly description: "Two values, one operation. Component-wise, and a scalar broadcasts against a vector.";
|
|
257
|
+
readonly icon: "Plus";
|
|
258
|
+
readonly runsOn: "portable";
|
|
259
|
+
readonly inputs: {
|
|
260
|
+
readonly a: {
|
|
261
|
+
readonly kind: "data";
|
|
262
|
+
readonly type: "any";
|
|
263
|
+
readonly default: 0;
|
|
264
|
+
readonly description: "First value.";
|
|
265
|
+
};
|
|
266
|
+
readonly b: {
|
|
267
|
+
readonly kind: "data";
|
|
268
|
+
readonly type: "any";
|
|
269
|
+
readonly default: 0;
|
|
270
|
+
readonly description: "Second value.";
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
readonly outputs: {
|
|
274
|
+
readonly value: {
|
|
275
|
+
readonly kind: "data";
|
|
276
|
+
readonly type: "any";
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
readonly props: {
|
|
280
|
+
readonly operation: {
|
|
281
|
+
readonly type: "string";
|
|
282
|
+
readonly default: "add";
|
|
283
|
+
readonly control: "select";
|
|
284
|
+
readonly options: {
|
|
285
|
+
value: string;
|
|
286
|
+
label: string;
|
|
287
|
+
}[];
|
|
288
|
+
readonly label: "Operation";
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
loadExecute: () => Promise<(context: NodeExecutionContext<{
|
|
293
|
+
readonly apiVersion: 1;
|
|
294
|
+
readonly label: "Binary Math";
|
|
295
|
+
readonly description: "Two values, one operation. Component-wise, and a scalar broadcasts against a vector.";
|
|
296
|
+
readonly icon: "Plus";
|
|
297
|
+
readonly runsOn: "portable";
|
|
298
|
+
readonly inputs: {
|
|
299
|
+
readonly a: {
|
|
300
|
+
readonly kind: "data";
|
|
301
|
+
readonly type: "any";
|
|
302
|
+
readonly default: 0;
|
|
303
|
+
readonly description: "First value.";
|
|
304
|
+
};
|
|
305
|
+
readonly b: {
|
|
306
|
+
readonly kind: "data";
|
|
307
|
+
readonly type: "any";
|
|
308
|
+
readonly default: 0;
|
|
309
|
+
readonly description: "Second value.";
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
readonly outputs: {
|
|
313
|
+
readonly value: {
|
|
314
|
+
readonly kind: "data";
|
|
315
|
+
readonly type: "any";
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
readonly props: {
|
|
319
|
+
readonly operation: {
|
|
320
|
+
readonly type: "string";
|
|
321
|
+
readonly default: "add";
|
|
322
|
+
readonly control: "select";
|
|
323
|
+
readonly options: {
|
|
324
|
+
value: string;
|
|
325
|
+
label: string;
|
|
326
|
+
}[];
|
|
327
|
+
readonly label: "Operation";
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
}>) => void>;
|
|
331
|
+
};
|
|
332
|
+
export declare const unaryRegistration: {
|
|
333
|
+
kind: "definition-v1";
|
|
334
|
+
moduleId: string;
|
|
335
|
+
definition: {
|
|
336
|
+
readonly apiVersion: 1;
|
|
337
|
+
readonly label: "Unary Math";
|
|
338
|
+
readonly description: "One value, one operation. Trigonometry is in radians.";
|
|
339
|
+
readonly icon: "FunctionSquare";
|
|
340
|
+
readonly runsOn: "portable";
|
|
341
|
+
readonly inputs: {
|
|
342
|
+
readonly value: {
|
|
343
|
+
readonly kind: "data";
|
|
344
|
+
readonly type: "any";
|
|
345
|
+
readonly default: 0;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
readonly outputs: {
|
|
349
|
+
readonly value: {
|
|
350
|
+
readonly kind: "data";
|
|
351
|
+
readonly type: "any";
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
readonly props: {
|
|
355
|
+
readonly operation: {
|
|
356
|
+
readonly type: "string";
|
|
357
|
+
readonly default: "abs";
|
|
358
|
+
readonly control: "select";
|
|
359
|
+
readonly options: {
|
|
360
|
+
value: string;
|
|
361
|
+
label: string;
|
|
362
|
+
}[];
|
|
363
|
+
readonly label: "Operation";
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
loadExecute: () => Promise<(context: NodeExecutionContext<{
|
|
368
|
+
readonly apiVersion: 1;
|
|
369
|
+
readonly label: "Unary Math";
|
|
370
|
+
readonly description: "One value, one operation. Trigonometry is in radians.";
|
|
371
|
+
readonly icon: "FunctionSquare";
|
|
372
|
+
readonly runsOn: "portable";
|
|
373
|
+
readonly inputs: {
|
|
374
|
+
readonly value: {
|
|
375
|
+
readonly kind: "data";
|
|
376
|
+
readonly type: "any";
|
|
377
|
+
readonly default: 0;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
readonly outputs: {
|
|
381
|
+
readonly value: {
|
|
382
|
+
readonly kind: "data";
|
|
383
|
+
readonly type: "any";
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
readonly props: {
|
|
387
|
+
readonly operation: {
|
|
388
|
+
readonly type: "string";
|
|
389
|
+
readonly default: "abs";
|
|
390
|
+
readonly control: "select";
|
|
391
|
+
readonly options: {
|
|
392
|
+
value: string;
|
|
393
|
+
label: string;
|
|
394
|
+
}[];
|
|
395
|
+
readonly label: "Operation";
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
}>) => void>;
|
|
399
|
+
};
|
|
400
|
+
export declare const clampRegistration: {
|
|
401
|
+
kind: "definition-v1";
|
|
402
|
+
moduleId: string;
|
|
403
|
+
definition: {
|
|
404
|
+
readonly apiVersion: 1;
|
|
405
|
+
readonly label: "Clamp";
|
|
406
|
+
readonly description: "Hold a value between two bounds.";
|
|
407
|
+
readonly icon: "Brackets";
|
|
408
|
+
readonly runsOn: "portable";
|
|
409
|
+
readonly inputs: {
|
|
410
|
+
readonly value: {
|
|
411
|
+
readonly kind: "data";
|
|
412
|
+
readonly type: "any";
|
|
413
|
+
readonly default: 0;
|
|
414
|
+
};
|
|
415
|
+
readonly min: {
|
|
416
|
+
readonly kind: "data";
|
|
417
|
+
readonly type: "any";
|
|
418
|
+
readonly default: 0;
|
|
419
|
+
};
|
|
420
|
+
readonly max: {
|
|
421
|
+
readonly kind: "data";
|
|
422
|
+
readonly type: "any";
|
|
423
|
+
readonly default: 1;
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
readonly outputs: {
|
|
427
|
+
readonly value: {
|
|
428
|
+
readonly kind: "data";
|
|
429
|
+
readonly type: "any";
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
readonly props: {};
|
|
433
|
+
};
|
|
434
|
+
loadExecute: () => Promise<(context: NodeExecutionContext<{
|
|
435
|
+
readonly apiVersion: 1;
|
|
436
|
+
readonly label: "Clamp";
|
|
437
|
+
readonly description: "Hold a value between two bounds.";
|
|
438
|
+
readonly icon: "Brackets";
|
|
439
|
+
readonly runsOn: "portable";
|
|
440
|
+
readonly inputs: {
|
|
441
|
+
readonly value: {
|
|
442
|
+
readonly kind: "data";
|
|
443
|
+
readonly type: "any";
|
|
444
|
+
readonly default: 0;
|
|
445
|
+
};
|
|
446
|
+
readonly min: {
|
|
447
|
+
readonly kind: "data";
|
|
448
|
+
readonly type: "any";
|
|
449
|
+
readonly default: 0;
|
|
450
|
+
};
|
|
451
|
+
readonly max: {
|
|
452
|
+
readonly kind: "data";
|
|
453
|
+
readonly type: "any";
|
|
454
|
+
readonly default: 1;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
readonly outputs: {
|
|
458
|
+
readonly value: {
|
|
459
|
+
readonly kind: "data";
|
|
460
|
+
readonly type: "any";
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
readonly props: {};
|
|
464
|
+
}>) => void>;
|
|
465
|
+
};
|
|
466
|
+
export declare const mixRegistration: {
|
|
467
|
+
kind: "definition-v1";
|
|
468
|
+
moduleId: string;
|
|
469
|
+
definition: {
|
|
470
|
+
readonly apiVersion: 1;
|
|
471
|
+
readonly label: "Mix";
|
|
472
|
+
readonly description: "Blend between two values. Houdini's lerp.";
|
|
473
|
+
readonly icon: "Blend";
|
|
474
|
+
readonly runsOn: "portable";
|
|
475
|
+
readonly inputs: {
|
|
476
|
+
readonly a: {
|
|
477
|
+
readonly kind: "data";
|
|
478
|
+
readonly type: "any";
|
|
479
|
+
readonly default: 0;
|
|
480
|
+
readonly description: "The value at 0.";
|
|
481
|
+
};
|
|
482
|
+
readonly b: {
|
|
483
|
+
readonly kind: "data";
|
|
484
|
+
readonly type: "any";
|
|
485
|
+
readonly default: 1;
|
|
486
|
+
readonly description: "The value at 1.";
|
|
487
|
+
};
|
|
488
|
+
readonly bias: {
|
|
489
|
+
readonly kind: "data";
|
|
490
|
+
readonly type: "float";
|
|
491
|
+
readonly default: 0.5;
|
|
492
|
+
readonly min: 0;
|
|
493
|
+
readonly max: 1;
|
|
494
|
+
readonly step: 0.01;
|
|
495
|
+
readonly description: "Not clamped: past 0..1 this extrapolates, which is useful.";
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
readonly outputs: {
|
|
499
|
+
readonly value: {
|
|
500
|
+
readonly kind: "data";
|
|
501
|
+
readonly type: "any";
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
readonly props: {};
|
|
505
|
+
};
|
|
506
|
+
loadExecute: () => Promise<(context: NodeExecutionContext<{
|
|
507
|
+
readonly apiVersion: 1;
|
|
508
|
+
readonly label: "Mix";
|
|
509
|
+
readonly description: "Blend between two values. Houdini's lerp.";
|
|
510
|
+
readonly icon: "Blend";
|
|
511
|
+
readonly runsOn: "portable";
|
|
512
|
+
readonly inputs: {
|
|
513
|
+
readonly a: {
|
|
514
|
+
readonly kind: "data";
|
|
515
|
+
readonly type: "any";
|
|
516
|
+
readonly default: 0;
|
|
517
|
+
readonly description: "The value at 0.";
|
|
518
|
+
};
|
|
519
|
+
readonly b: {
|
|
520
|
+
readonly kind: "data";
|
|
521
|
+
readonly type: "any";
|
|
522
|
+
readonly default: 1;
|
|
523
|
+
readonly description: "The value at 1.";
|
|
524
|
+
};
|
|
525
|
+
readonly bias: {
|
|
526
|
+
readonly kind: "data";
|
|
527
|
+
readonly type: "float";
|
|
528
|
+
readonly default: 0.5;
|
|
529
|
+
readonly min: 0;
|
|
530
|
+
readonly max: 1;
|
|
531
|
+
readonly step: 0.01;
|
|
532
|
+
readonly description: "Not clamped: past 0..1 this extrapolates, which is useful.";
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
readonly outputs: {
|
|
536
|
+
readonly value: {
|
|
537
|
+
readonly kind: "data";
|
|
538
|
+
readonly type: "any";
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
readonly props: {};
|
|
542
|
+
}>) => void>;
|
|
543
|
+
};
|
|
544
|
+
export declare const compareRegistration: {
|
|
545
|
+
kind: "definition-v1";
|
|
546
|
+
moduleId: string;
|
|
547
|
+
definition: {
|
|
548
|
+
readonly apiVersion: 1;
|
|
549
|
+
readonly label: "Compare";
|
|
550
|
+
readonly description: "Test two values. Outputs a bool, for a Switch.";
|
|
551
|
+
readonly icon: "Equal";
|
|
552
|
+
readonly runsOn: "portable";
|
|
553
|
+
readonly inputs: {
|
|
554
|
+
readonly a: {
|
|
555
|
+
readonly kind: "data";
|
|
556
|
+
readonly type: "float";
|
|
557
|
+
readonly default: 0;
|
|
558
|
+
};
|
|
559
|
+
readonly b: {
|
|
560
|
+
readonly kind: "data";
|
|
561
|
+
readonly type: "float";
|
|
562
|
+
readonly default: 0;
|
|
563
|
+
};
|
|
564
|
+
};
|
|
565
|
+
readonly outputs: {
|
|
566
|
+
readonly result: {
|
|
567
|
+
readonly kind: "data";
|
|
568
|
+
readonly type: "bool";
|
|
569
|
+
};
|
|
570
|
+
};
|
|
571
|
+
readonly props: {
|
|
572
|
+
readonly operation: {
|
|
573
|
+
readonly type: "string";
|
|
574
|
+
readonly default: "greater";
|
|
575
|
+
readonly control: "select";
|
|
576
|
+
readonly options: {
|
|
577
|
+
value: string;
|
|
578
|
+
label: string;
|
|
579
|
+
}[];
|
|
580
|
+
readonly label: "Test";
|
|
581
|
+
};
|
|
582
|
+
/**
|
|
583
|
+
* Scalars only, unlike the rest of this namespace.
|
|
584
|
+
*
|
|
585
|
+
* "Is this vector greater than that one" has no single right answer — all
|
|
586
|
+
* components, any component, or the length — and a node that picked one
|
|
587
|
+
* silently would be wrong for the other two readings. A comparison feeding
|
|
588
|
+
* a `Switch` wants one boolean, so the input is a `float` and the question
|
|
589
|
+
* does not arise.
|
|
590
|
+
*/
|
|
591
|
+
readonly tolerance: {
|
|
592
|
+
readonly type: "float";
|
|
593
|
+
readonly default: 0;
|
|
594
|
+
readonly min: 0;
|
|
595
|
+
readonly label: "Tolerance";
|
|
596
|
+
readonly description: "Slack for Equal and Not Equal. Floating point rarely lands on exactly equal.";
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
loadExecute: () => Promise<(context: NodeExecutionContext<{
|
|
601
|
+
readonly apiVersion: 1;
|
|
602
|
+
readonly label: "Compare";
|
|
603
|
+
readonly description: "Test two values. Outputs a bool, for a Switch.";
|
|
604
|
+
readonly icon: "Equal";
|
|
605
|
+
readonly runsOn: "portable";
|
|
606
|
+
readonly inputs: {
|
|
607
|
+
readonly a: {
|
|
608
|
+
readonly kind: "data";
|
|
609
|
+
readonly type: "float";
|
|
610
|
+
readonly default: 0;
|
|
611
|
+
};
|
|
612
|
+
readonly b: {
|
|
613
|
+
readonly kind: "data";
|
|
614
|
+
readonly type: "float";
|
|
615
|
+
readonly default: 0;
|
|
616
|
+
};
|
|
617
|
+
};
|
|
618
|
+
readonly outputs: {
|
|
619
|
+
readonly result: {
|
|
620
|
+
readonly kind: "data";
|
|
621
|
+
readonly type: "bool";
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
readonly props: {
|
|
625
|
+
readonly operation: {
|
|
626
|
+
readonly type: "string";
|
|
627
|
+
readonly default: "greater";
|
|
628
|
+
readonly control: "select";
|
|
629
|
+
readonly options: {
|
|
630
|
+
value: string;
|
|
631
|
+
label: string;
|
|
632
|
+
}[];
|
|
633
|
+
readonly label: "Test";
|
|
634
|
+
};
|
|
635
|
+
/**
|
|
636
|
+
* Scalars only, unlike the rest of this namespace.
|
|
637
|
+
*
|
|
638
|
+
* "Is this vector greater than that one" has no single right answer — all
|
|
639
|
+
* components, any component, or the length — and a node that picked one
|
|
640
|
+
* silently would be wrong for the other two readings. A comparison feeding
|
|
641
|
+
* a `Switch` wants one boolean, so the input is a `float` and the question
|
|
642
|
+
* does not arise.
|
|
643
|
+
*/
|
|
644
|
+
readonly tolerance: {
|
|
645
|
+
readonly type: "float";
|
|
646
|
+
readonly default: 0;
|
|
647
|
+
readonly min: 0;
|
|
648
|
+
readonly label: "Tolerance";
|
|
649
|
+
readonly description: "Slack for Equal and Not Equal. Floating point rarely lands on exactly equal.";
|
|
650
|
+
};
|
|
651
|
+
};
|
|
652
|
+
}>) => void>;
|
|
653
|
+
};
|
|
654
|
+
export declare const mathNodeRegistrations: readonly DefinitionNodeRegistration[];
|
|
655
|
+
/** `[moduleId, definition]` pairs, the shape a host's palette builder wants. */
|
|
656
|
+
export declare const mathNodeDefinitions: readonly [readonly ["cascade.math.Binary", {
|
|
657
|
+
readonly apiVersion: 1;
|
|
658
|
+
readonly label: "Binary Math";
|
|
659
|
+
readonly description: "Two values, one operation. Component-wise, and a scalar broadcasts against a vector.";
|
|
660
|
+
readonly icon: "Plus";
|
|
661
|
+
readonly runsOn: "portable";
|
|
662
|
+
readonly inputs: {
|
|
663
|
+
readonly a: {
|
|
664
|
+
readonly kind: "data";
|
|
665
|
+
readonly type: "any";
|
|
666
|
+
readonly default: 0;
|
|
667
|
+
readonly description: "First value.";
|
|
668
|
+
};
|
|
669
|
+
readonly b: {
|
|
670
|
+
readonly kind: "data";
|
|
671
|
+
readonly type: "any";
|
|
672
|
+
readonly default: 0;
|
|
673
|
+
readonly description: "Second value.";
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
readonly outputs: {
|
|
677
|
+
readonly value: {
|
|
678
|
+
readonly kind: "data";
|
|
679
|
+
readonly type: "any";
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
readonly props: {
|
|
683
|
+
readonly operation: {
|
|
684
|
+
readonly type: "string";
|
|
685
|
+
readonly default: "add";
|
|
686
|
+
readonly control: "select";
|
|
687
|
+
readonly options: {
|
|
688
|
+
value: string;
|
|
689
|
+
label: string;
|
|
690
|
+
}[];
|
|
691
|
+
readonly label: "Operation";
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
}], readonly ["cascade.math.Unary", {
|
|
695
|
+
readonly apiVersion: 1;
|
|
696
|
+
readonly label: "Unary Math";
|
|
697
|
+
readonly description: "One value, one operation. Trigonometry is in radians.";
|
|
698
|
+
readonly icon: "FunctionSquare";
|
|
699
|
+
readonly runsOn: "portable";
|
|
700
|
+
readonly inputs: {
|
|
701
|
+
readonly value: {
|
|
702
|
+
readonly kind: "data";
|
|
703
|
+
readonly type: "any";
|
|
704
|
+
readonly default: 0;
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
readonly outputs: {
|
|
708
|
+
readonly value: {
|
|
709
|
+
readonly kind: "data";
|
|
710
|
+
readonly type: "any";
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
readonly props: {
|
|
714
|
+
readonly operation: {
|
|
715
|
+
readonly type: "string";
|
|
716
|
+
readonly default: "abs";
|
|
717
|
+
readonly control: "select";
|
|
718
|
+
readonly options: {
|
|
719
|
+
value: string;
|
|
720
|
+
label: string;
|
|
721
|
+
}[];
|
|
722
|
+
readonly label: "Operation";
|
|
723
|
+
};
|
|
724
|
+
};
|
|
725
|
+
}], readonly ["cascade.math.Clamp", {
|
|
726
|
+
readonly apiVersion: 1;
|
|
727
|
+
readonly label: "Clamp";
|
|
728
|
+
readonly description: "Hold a value between two bounds.";
|
|
729
|
+
readonly icon: "Brackets";
|
|
730
|
+
readonly runsOn: "portable";
|
|
731
|
+
readonly inputs: {
|
|
732
|
+
readonly value: {
|
|
733
|
+
readonly kind: "data";
|
|
734
|
+
readonly type: "any";
|
|
735
|
+
readonly default: 0;
|
|
736
|
+
};
|
|
737
|
+
readonly min: {
|
|
738
|
+
readonly kind: "data";
|
|
739
|
+
readonly type: "any";
|
|
740
|
+
readonly default: 0;
|
|
741
|
+
};
|
|
742
|
+
readonly max: {
|
|
743
|
+
readonly kind: "data";
|
|
744
|
+
readonly type: "any";
|
|
745
|
+
readonly default: 1;
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
readonly outputs: {
|
|
749
|
+
readonly value: {
|
|
750
|
+
readonly kind: "data";
|
|
751
|
+
readonly type: "any";
|
|
752
|
+
};
|
|
753
|
+
};
|
|
754
|
+
readonly props: {};
|
|
755
|
+
}], readonly ["cascade.math.Mix", {
|
|
756
|
+
readonly apiVersion: 1;
|
|
757
|
+
readonly label: "Mix";
|
|
758
|
+
readonly description: "Blend between two values. Houdini's lerp.";
|
|
759
|
+
readonly icon: "Blend";
|
|
760
|
+
readonly runsOn: "portable";
|
|
761
|
+
readonly inputs: {
|
|
762
|
+
readonly a: {
|
|
763
|
+
readonly kind: "data";
|
|
764
|
+
readonly type: "any";
|
|
765
|
+
readonly default: 0;
|
|
766
|
+
readonly description: "The value at 0.";
|
|
767
|
+
};
|
|
768
|
+
readonly b: {
|
|
769
|
+
readonly kind: "data";
|
|
770
|
+
readonly type: "any";
|
|
771
|
+
readonly default: 1;
|
|
772
|
+
readonly description: "The value at 1.";
|
|
773
|
+
};
|
|
774
|
+
readonly bias: {
|
|
775
|
+
readonly kind: "data";
|
|
776
|
+
readonly type: "float";
|
|
777
|
+
readonly default: 0.5;
|
|
778
|
+
readonly min: 0;
|
|
779
|
+
readonly max: 1;
|
|
780
|
+
readonly step: 0.01;
|
|
781
|
+
readonly description: "Not clamped: past 0..1 this extrapolates, which is useful.";
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
readonly outputs: {
|
|
785
|
+
readonly value: {
|
|
786
|
+
readonly kind: "data";
|
|
787
|
+
readonly type: "any";
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
readonly props: {};
|
|
791
|
+
}], readonly ["cascade.math.Compare", {
|
|
792
|
+
readonly apiVersion: 1;
|
|
793
|
+
readonly label: "Compare";
|
|
794
|
+
readonly description: "Test two values. Outputs a bool, for a Switch.";
|
|
795
|
+
readonly icon: "Equal";
|
|
796
|
+
readonly runsOn: "portable";
|
|
797
|
+
readonly inputs: {
|
|
798
|
+
readonly a: {
|
|
799
|
+
readonly kind: "data";
|
|
800
|
+
readonly type: "float";
|
|
801
|
+
readonly default: 0;
|
|
802
|
+
};
|
|
803
|
+
readonly b: {
|
|
804
|
+
readonly kind: "data";
|
|
805
|
+
readonly type: "float";
|
|
806
|
+
readonly default: 0;
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
readonly outputs: {
|
|
810
|
+
readonly result: {
|
|
811
|
+
readonly kind: "data";
|
|
812
|
+
readonly type: "bool";
|
|
813
|
+
};
|
|
814
|
+
};
|
|
815
|
+
readonly props: {
|
|
816
|
+
readonly operation: {
|
|
817
|
+
readonly type: "string";
|
|
818
|
+
readonly default: "greater";
|
|
819
|
+
readonly control: "select";
|
|
820
|
+
readonly options: {
|
|
821
|
+
value: string;
|
|
822
|
+
label: string;
|
|
823
|
+
}[];
|
|
824
|
+
readonly label: "Test";
|
|
825
|
+
};
|
|
826
|
+
/**
|
|
827
|
+
* Scalars only, unlike the rest of this namespace.
|
|
828
|
+
*
|
|
829
|
+
* "Is this vector greater than that one" has no single right answer — all
|
|
830
|
+
* components, any component, or the length — and a node that picked one
|
|
831
|
+
* silently would be wrong for the other two readings. A comparison feeding
|
|
832
|
+
* a `Switch` wants one boolean, so the input is a `float` and the question
|
|
833
|
+
* does not arise.
|
|
834
|
+
*/
|
|
835
|
+
readonly tolerance: {
|
|
836
|
+
readonly type: "float";
|
|
837
|
+
readonly default: 0;
|
|
838
|
+
readonly min: 0;
|
|
839
|
+
readonly label: "Tolerance";
|
|
840
|
+
readonly description: "Slack for Equal and Not Equal. Floating point rarely lands on exactly equal.";
|
|
841
|
+
};
|
|
842
|
+
};
|
|
843
|
+
}]];
|
|
844
|
+
export { BINARY, UNARY, COMPARE };
|
|
845
|
+
//# sourceMappingURL=definitions.d.ts.map
|