selva-compute 1.0.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 (57) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +110 -0
  3. package/dist/base-DbB0Ggdq.d.cts +118 -0
  4. package/dist/base-DbB0Ggdq.d.ts +118 -0
  5. package/dist/chunk-24EXIE4G.js +3 -0
  6. package/dist/chunk-24EXIE4G.js.map +1 -0
  7. package/dist/chunk-5DJRUPGI.cjs +2 -0
  8. package/dist/chunk-5DJRUPGI.cjs.map +1 -0
  9. package/dist/chunk-AEQTQHPY.js +2 -0
  10. package/dist/chunk-AEQTQHPY.js.map +1 -0
  11. package/dist/chunk-JJLRDYYP.js +2 -0
  12. package/dist/chunk-JJLRDYYP.js.map +1 -0
  13. package/dist/chunk-OXD76DAK.js +2 -0
  14. package/dist/chunk-OXD76DAK.js.map +1 -0
  15. package/dist/chunk-P57VU27W.cjs +3 -0
  16. package/dist/chunk-P57VU27W.cjs.map +1 -0
  17. package/dist/chunk-PNG3L5TM.cjs +2 -0
  18. package/dist/chunk-PNG3L5TM.cjs.map +1 -0
  19. package/dist/chunk-TVCJBLSW.cjs +2 -0
  20. package/dist/chunk-TVCJBLSW.cjs.map +1 -0
  21. package/dist/core.cjs +2 -0
  22. package/dist/core.cjs.map +1 -0
  23. package/dist/core.d.cts +114 -0
  24. package/dist/core.d.ts +114 -0
  25. package/dist/core.js +2 -0
  26. package/dist/core.js.map +1 -0
  27. package/dist/files.cjs +2 -0
  28. package/dist/files.cjs.map +1 -0
  29. package/dist/files.d.cts +34 -0
  30. package/dist/files.d.ts +34 -0
  31. package/dist/files.js +2 -0
  32. package/dist/files.js.map +1 -0
  33. package/dist/grasshopper.cjs +2 -0
  34. package/dist/grasshopper.cjs.map +1 -0
  35. package/dist/grasshopper.d.cts +741 -0
  36. package/dist/grasshopper.d.ts +741 -0
  37. package/dist/grasshopper.js +2 -0
  38. package/dist/grasshopper.js.map +1 -0
  39. package/dist/index.cjs +2 -0
  40. package/dist/index.cjs.map +1 -0
  41. package/dist/index.d.cts +8 -0
  42. package/dist/index.d.ts +8 -0
  43. package/dist/index.js +2 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/schemas-5LuPKgX2.d.cts +202 -0
  46. package/dist/schemas-5LuPKgX2.d.ts +202 -0
  47. package/dist/types-SwbLAMW8.d.cts +27 -0
  48. package/dist/types-SwbLAMW8.d.ts +27 -0
  49. package/dist/types-r00wVwfo.d.cts +77 -0
  50. package/dist/types-r00wVwfo.d.ts +77 -0
  51. package/dist/visualization.cjs +2 -0
  52. package/dist/visualization.cjs.map +1 -0
  53. package/dist/visualization.d.cts +202 -0
  54. package/dist/visualization.d.ts +202 -0
  55. package/dist/visualization.js +2 -0
  56. package/dist/visualization.js.map +1 -0
  57. package/package.json +117 -0
@@ -0,0 +1,2 @@
1
+ import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i}from"./chunk-OXD76DAK.js";import"./chunk-JJLRDYYP.js";import"./chunk-AEQTQHPY.js";import{d as a}from"./chunk-24EXIE4G.js";export{b as GrasshopperClient,c as GrasshopperResponseProcessor,a as RhinoComputeError,i as TreeBuilder,g as fetchDefinitionIO,h as fetchParsedDefinitionIO,e as processInput,f as processInputs,d as solveGrasshopperDefinition};
2
+ //# sourceMappingURL=grasshopper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPNG3L5TMcjs = require('./chunk-PNG3L5TM.cjs');var _chunkTVCJBLSWcjs = require('./chunk-TVCJBLSW.cjs');require('./chunk-5DJRUPGI.cjs');var _chunkP57VU27Wcjs = require('./chunk-P57VU27W.cjs');exports.ComputeServerStats = _chunkP57VU27Wcjs.o; exports.ErrorCodes = _chunkP57VU27Wcjs.f; exports.GrasshopperClient = _chunkPNG3L5TMcjs.a; exports.GrasshopperResponseProcessor = _chunkPNG3L5TMcjs.b; exports.RhinoComputeError = _chunkP57VU27Wcjs.d; exports.TreeBuilder = _chunkPNG3L5TMcjs.h; exports.downloadFileData = _chunkTVCJBLSWcjs.b; exports.enableDebugLogging = _chunkP57VU27Wcjs.l; exports.extractFilesFromComputeResponse = _chunkTVCJBLSWcjs.a; exports.fetchDefinitionIO = _chunkPNG3L5TMcjs.f; exports.fetchParsedDefinitionIO = _chunkPNG3L5TMcjs.g; exports.fetchRhinoCompute = _chunkP57VU27Wcjs.n; exports.getLogger = _chunkP57VU27Wcjs.j; exports.processInput = _chunkPNG3L5TMcjs.d; exports.processInputs = _chunkPNG3L5TMcjs.e; exports.setLogger = _chunkP57VU27Wcjs.k; exports.solveGrasshopperDefinition = _chunkPNG3L5TMcjs.c;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/felix/coding/selva-compute/dist/index.cjs"],"names":[],"mappings":"AAAA,iIAAyF,wDAAsC,gCAA6B,wDAAmF,m0BAAkZ","file":"/Users/felix/coding/selva-compute/dist/index.cjs"}
@@ -0,0 +1,8 @@
1
+ export { ErrorCode, ErrorCodes, Logger, enableDebugLogging, fetchRhinoCompute, getLogger, setLogger } from './core.cjs';
2
+ export { C as ComputeServerStats, R as RhinoComputeError } from './base-DbB0Ggdq.cjs';
3
+ export { C as ComputeConfig, D as DataItem, a as DataTree, d as DataTreeDefault, c as GrasshopperComputeConfig, b as GrasshopperComputeResponse, G as GrasshopperRequestSchema, I as InputParamSchema, O as OutputParamSchema, R as RhinoModelUnit } from './schemas-5LuPKgX2.cjs';
4
+ export { BooleanInputType, DataTreeValue, GeometryInputType, GrasshopperClient, GrasshopperParsedIO, GrasshopperResponseProcessor, InputParam, NumericInputType, OutputType, TextInputType, TreeBuilder, ValueListInputType, fetchDefinitionIO, fetchParsedDefinitionIO, processInput, processInputs, solveGrasshopperDefinition } from './grasshopper.cjs';
5
+ export { a as FileBaseInfo, F as FileData, P as ProcessedFile } from './types-SwbLAMW8.cjs';
6
+ export { downloadFileData, extractFilesFromComputeResponse } from './files.cjs';
7
+ import 'three';
8
+ import './types-r00wVwfo.cjs';
@@ -0,0 +1,8 @@
1
+ export { ErrorCode, ErrorCodes, Logger, enableDebugLogging, fetchRhinoCompute, getLogger, setLogger } from './core.js';
2
+ export { C as ComputeServerStats, R as RhinoComputeError } from './base-DbB0Ggdq.js';
3
+ export { C as ComputeConfig, D as DataItem, a as DataTree, d as DataTreeDefault, c as GrasshopperComputeConfig, b as GrasshopperComputeResponse, G as GrasshopperRequestSchema, I as InputParamSchema, O as OutputParamSchema, R as RhinoModelUnit } from './schemas-5LuPKgX2.js';
4
+ export { BooleanInputType, DataTreeValue, GeometryInputType, GrasshopperClient, GrasshopperParsedIO, GrasshopperResponseProcessor, InputParam, NumericInputType, OutputType, TextInputType, TreeBuilder, ValueListInputType, fetchDefinitionIO, fetchParsedDefinitionIO, processInput, processInputs, solveGrasshopperDefinition } from './grasshopper.js';
5
+ export { a as FileBaseInfo, F as FileData, P as ProcessedFile } from './types-SwbLAMW8.js';
6
+ export { downloadFileData, extractFilesFromComputeResponse } from './files.js';
7
+ import 'three';
8
+ import './types-r00wVwfo.js';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import{a as x,b as c,c as d,d as g,e as h,f as i,g as j,h as k}from"./chunk-OXD76DAK.js";import{a,b}from"./chunk-JJLRDYYP.js";import"./chunk-AEQTQHPY.js";import{d as o,f as r,j as e,k as f,l as m,n as p,o as t}from"./chunk-24EXIE4G.js";export{t as ComputeServerStats,r as ErrorCodes,x as GrasshopperClient,c as GrasshopperResponseProcessor,o as RhinoComputeError,k as TreeBuilder,b as downloadFileData,m as enableDebugLogging,a as extractFilesFromComputeResponse,i as fetchDefinitionIO,j as fetchParsedDefinitionIO,p as fetchRhinoCompute,e as getLogger,g as processInput,h as processInputs,f as setLogger,d as solveGrasshopperDefinition};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,202 @@
1
+ /**
2
+ * Rhino model unit types supported by Rhino.Compute
3
+ */
4
+ type RhinoModelUnit = 'None' | 'Microns' | 'Millimeters' | 'Centimeters' | 'Meters' | 'Kilometers' | 'Microinches' | 'Mils' | 'Inches' | 'Feet' | 'Miles' | 'CustomUnits' | 'Angstroms' | 'Nanometers' | 'Decimeters' | 'Dekameters' | 'Hectometers' | 'Megameters' | 'Gigameters' | 'Yards' | 'PrinterPoints' | 'PrinterPicas' | 'NauticalMiles' | 'AstronomicalUnits' | 'LightYears' | 'Parsecs' | 'Unset';
5
+ interface ComputeConfig {
6
+ /** The base URL of the Rhino Compute server (e.g., http://localhost:6500) */
7
+ serverUrl: string;
8
+ /** Optional API key for authenticating with the server */
9
+ apiKey?: string;
10
+ /** Optional auth token (Bearer token) for authentication */
11
+ authToken?: string;
12
+ /** Enable debug logging to the console */
13
+ debug?: boolean;
14
+ /** Suppress browser security warnings in the console */
15
+ suppressClientSideWarning?: boolean;
16
+ timeoutMs?: number;
17
+ }
18
+
19
+ /**
20
+ * Data tree types for Grasshopper parameter structures
21
+ */
22
+ /**
23
+ * Grasshopper-style data tree branch path
24
+ * @example "{0}", "{0;0}", "{0;1;2}"
25
+ */
26
+ type DataTreePath = `{${string}}`;
27
+ /**
28
+ * Represents a data item in a data tree
29
+ */
30
+ interface DataItem {
31
+ /** The type of the data, inferred from the Grasshopper GOO class */
32
+ type: string;
33
+ /** The actual returned data as a string that may need to be parsed */
34
+ data: string;
35
+ /** The grasshopper refrence id of the output */
36
+ id: string;
37
+ }
38
+ /**
39
+ * Grasshopper-style data tree for input defaults
40
+ * @example
41
+ * ```typescript
42
+ * const numericTree: DataTreeDefault<number> = {
43
+ * "{0}": [1, 2, 3],
44
+ * "{0;0}": [4, 5],
45
+ * "{1}": [6]
46
+ * };
47
+ * ```
48
+ */
49
+ type DataTreeDefault<T = any> = {
50
+ [K in DataTreePath]?: T[];
51
+ };
52
+ /**
53
+ * Data structure for InnerTreeData matching Rhino Compute responses
54
+ */
55
+ type InnerTreeData = {
56
+ [path in DataTreePath]: DataItem[];
57
+ };
58
+ /**
59
+ * Tree with parameter metadata (used in compute responses)
60
+ */
61
+ interface DataTree {
62
+ InnerTree: InnerTreeData;
63
+ ParamName: string;
64
+ }
65
+
66
+ /**
67
+ * API request/response schemas for Grasshopper compute operations
68
+ *
69
+ * @important These types mirror the Rhino.Compute API schema (Resthopper.IO).
70
+ * When Rhino.Compute is updated or types change, these definitions must be
71
+ * adjusted to maintain compatibility with the Compute server API.
72
+ *
73
+ * Reference: https://github.com/mcneel/rhino-compute/tree/main/src/compute.sln/Resthopper.IO
74
+ */
75
+
76
+ /**
77
+ * Base Grasshopper schema properties shared by config, args, and response
78
+ */
79
+ interface GrasshopperBaseSchema {
80
+ /** Absolute tolerance used in computation */
81
+ absolutetolerance?: number | null;
82
+ /** Angular tolerance used in computation */
83
+ angletolerance?: number | null;
84
+ /** Model units used */
85
+ modelunits?: RhinoModelUnit | null;
86
+ /** Data version (7 or 8) */
87
+ dataversion?: 7 | 8 | null;
88
+ /** Whether to use cached solution */
89
+ cachesolve?: boolean | null;
90
+ }
91
+ /**
92
+ * Definition source (used in args and response)
93
+ */
94
+ interface GrasshopperDefinitionSource {
95
+ /** Base64 encoded algorithm (if embedded) */
96
+ algo?: string | null;
97
+ /** URL pointer to definition file */
98
+ pointer?: string | null;
99
+ /** Filename of the definition */
100
+ filename?: string | null;
101
+ }
102
+ /**
103
+ * Configuration for Grasshopper compute operations
104
+ * Extends base config with Grasshopper-specific options
105
+ */
106
+ interface GrasshopperComputeConfig extends ComputeConfig, GrasshopperBaseSchema, GrasshopperDefinitionSource {
107
+ }
108
+ /**
109
+ * Raw I/O response schema from API (PascalCase)
110
+ *
111
+ * This is the direct response format from the Rhino Compute server API.
112
+ * All property names are in PascalCase, which is typical for .NET APIs.
113
+ * This raw response is converted to camelCase by the camelcaseKeys() function
114
+ * in the fetchDefinitionIO() method.
115
+ */
116
+ interface IoResponseSchema {
117
+ description: string;
118
+ filename: string;
119
+ cachekey: string;
120
+ inputnames: string[];
121
+ outputnames: string[];
122
+ icon: string | null;
123
+ inputs: InputParamSchema[];
124
+ outputs: OutputParamSchema[];
125
+ warnings: any[];
126
+ errors: any[];
127
+ }
128
+ /**
129
+ * Arguments sent to Grasshopper compute endpoint
130
+ * Includes config options + definition source + input values
131
+ */
132
+ interface GrasshopperRequestSchema extends GrasshopperBaseSchema, GrasshopperDefinitionSource {
133
+ /** Input values organized by parameter */
134
+ values?: DataTree[];
135
+ }
136
+ /**
137
+ * Response from Grasshopper compute server
138
+ * Includes all schema fields + computed results
139
+ */
140
+ interface GrasshopperComputeResponse extends GrasshopperBaseSchema, GrasshopperDefinitionSource {
141
+ /** Whether cache was used (always present in response) */
142
+ cachesolve: boolean;
143
+ /** Model units (always present in response) */
144
+ modelunits: RhinoModelUnit;
145
+ /** Base64 encoded algorithm (always present in response) */
146
+ algo: string;
147
+ /** Filename of the definition (always present in response) */
148
+ filename: string | null;
149
+ /** Data version */
150
+ dataversion: 7 | 8;
151
+ /** Recursion level used */
152
+ recursionlevel?: number;
153
+ /** Output values organized by parameter */
154
+ values: DataTree[];
155
+ /** Computation errors */
156
+ errors?: string[];
157
+ /** Computation warnings */
158
+ warnings?: string[];
159
+ }
160
+ /**
161
+ * Output parameter
162
+ */
163
+ interface OutputParamSchema {
164
+ name: string;
165
+ nickname: string | null;
166
+ paramType: string;
167
+ /**
168
+ * Grasshopper parameter instance GUID
169
+ */
170
+ id: string;
171
+ }
172
+ /**
173
+ * Input parameter
174
+ */
175
+ interface InputParamSchema {
176
+ /**
177
+ * Grasshopper parameter instance GUID
178
+ */
179
+ id: string;
180
+ name: string;
181
+ nickname: string | null;
182
+ description: string;
183
+ paramType: string;
184
+ treeAccess: boolean;
185
+ minimum: number | null;
186
+ maximum: number | null;
187
+ atLeast: number;
188
+ atMost: number;
189
+ stepSize?: number;
190
+ default: any;
191
+ /**
192
+ * Key-value pairs for dropdown options
193
+ */
194
+ values?: Record<string, string>;
195
+ /**
196
+ * Accepted file formats for File input
197
+ */
198
+ acceptedFormats?: string[];
199
+ groupName?: string | null;
200
+ }
201
+
202
+ export type { ComputeConfig as C, DataItem as D, GrasshopperRequestSchema as G, InputParamSchema as I, OutputParamSchema as O, RhinoModelUnit as R, DataTree as a, GrasshopperComputeResponse as b, GrasshopperComputeConfig as c, DataTreeDefault as d, DataTreePath as e, IoResponseSchema as f };
@@ -0,0 +1,202 @@
1
+ /**
2
+ * Rhino model unit types supported by Rhino.Compute
3
+ */
4
+ type RhinoModelUnit = 'None' | 'Microns' | 'Millimeters' | 'Centimeters' | 'Meters' | 'Kilometers' | 'Microinches' | 'Mils' | 'Inches' | 'Feet' | 'Miles' | 'CustomUnits' | 'Angstroms' | 'Nanometers' | 'Decimeters' | 'Dekameters' | 'Hectometers' | 'Megameters' | 'Gigameters' | 'Yards' | 'PrinterPoints' | 'PrinterPicas' | 'NauticalMiles' | 'AstronomicalUnits' | 'LightYears' | 'Parsecs' | 'Unset';
5
+ interface ComputeConfig {
6
+ /** The base URL of the Rhino Compute server (e.g., http://localhost:6500) */
7
+ serverUrl: string;
8
+ /** Optional API key for authenticating with the server */
9
+ apiKey?: string;
10
+ /** Optional auth token (Bearer token) for authentication */
11
+ authToken?: string;
12
+ /** Enable debug logging to the console */
13
+ debug?: boolean;
14
+ /** Suppress browser security warnings in the console */
15
+ suppressClientSideWarning?: boolean;
16
+ timeoutMs?: number;
17
+ }
18
+
19
+ /**
20
+ * Data tree types for Grasshopper parameter structures
21
+ */
22
+ /**
23
+ * Grasshopper-style data tree branch path
24
+ * @example "{0}", "{0;0}", "{0;1;2}"
25
+ */
26
+ type DataTreePath = `{${string}}`;
27
+ /**
28
+ * Represents a data item in a data tree
29
+ */
30
+ interface DataItem {
31
+ /** The type of the data, inferred from the Grasshopper GOO class */
32
+ type: string;
33
+ /** The actual returned data as a string that may need to be parsed */
34
+ data: string;
35
+ /** The grasshopper refrence id of the output */
36
+ id: string;
37
+ }
38
+ /**
39
+ * Grasshopper-style data tree for input defaults
40
+ * @example
41
+ * ```typescript
42
+ * const numericTree: DataTreeDefault<number> = {
43
+ * "{0}": [1, 2, 3],
44
+ * "{0;0}": [4, 5],
45
+ * "{1}": [6]
46
+ * };
47
+ * ```
48
+ */
49
+ type DataTreeDefault<T = any> = {
50
+ [K in DataTreePath]?: T[];
51
+ };
52
+ /**
53
+ * Data structure for InnerTreeData matching Rhino Compute responses
54
+ */
55
+ type InnerTreeData = {
56
+ [path in DataTreePath]: DataItem[];
57
+ };
58
+ /**
59
+ * Tree with parameter metadata (used in compute responses)
60
+ */
61
+ interface DataTree {
62
+ InnerTree: InnerTreeData;
63
+ ParamName: string;
64
+ }
65
+
66
+ /**
67
+ * API request/response schemas for Grasshopper compute operations
68
+ *
69
+ * @important These types mirror the Rhino.Compute API schema (Resthopper.IO).
70
+ * When Rhino.Compute is updated or types change, these definitions must be
71
+ * adjusted to maintain compatibility with the Compute server API.
72
+ *
73
+ * Reference: https://github.com/mcneel/rhino-compute/tree/main/src/compute.sln/Resthopper.IO
74
+ */
75
+
76
+ /**
77
+ * Base Grasshopper schema properties shared by config, args, and response
78
+ */
79
+ interface GrasshopperBaseSchema {
80
+ /** Absolute tolerance used in computation */
81
+ absolutetolerance?: number | null;
82
+ /** Angular tolerance used in computation */
83
+ angletolerance?: number | null;
84
+ /** Model units used */
85
+ modelunits?: RhinoModelUnit | null;
86
+ /** Data version (7 or 8) */
87
+ dataversion?: 7 | 8 | null;
88
+ /** Whether to use cached solution */
89
+ cachesolve?: boolean | null;
90
+ }
91
+ /**
92
+ * Definition source (used in args and response)
93
+ */
94
+ interface GrasshopperDefinitionSource {
95
+ /** Base64 encoded algorithm (if embedded) */
96
+ algo?: string | null;
97
+ /** URL pointer to definition file */
98
+ pointer?: string | null;
99
+ /** Filename of the definition */
100
+ filename?: string | null;
101
+ }
102
+ /**
103
+ * Configuration for Grasshopper compute operations
104
+ * Extends base config with Grasshopper-specific options
105
+ */
106
+ interface GrasshopperComputeConfig extends ComputeConfig, GrasshopperBaseSchema, GrasshopperDefinitionSource {
107
+ }
108
+ /**
109
+ * Raw I/O response schema from API (PascalCase)
110
+ *
111
+ * This is the direct response format from the Rhino Compute server API.
112
+ * All property names are in PascalCase, which is typical for .NET APIs.
113
+ * This raw response is converted to camelCase by the camelcaseKeys() function
114
+ * in the fetchDefinitionIO() method.
115
+ */
116
+ interface IoResponseSchema {
117
+ description: string;
118
+ filename: string;
119
+ cachekey: string;
120
+ inputnames: string[];
121
+ outputnames: string[];
122
+ icon: string | null;
123
+ inputs: InputParamSchema[];
124
+ outputs: OutputParamSchema[];
125
+ warnings: any[];
126
+ errors: any[];
127
+ }
128
+ /**
129
+ * Arguments sent to Grasshopper compute endpoint
130
+ * Includes config options + definition source + input values
131
+ */
132
+ interface GrasshopperRequestSchema extends GrasshopperBaseSchema, GrasshopperDefinitionSource {
133
+ /** Input values organized by parameter */
134
+ values?: DataTree[];
135
+ }
136
+ /**
137
+ * Response from Grasshopper compute server
138
+ * Includes all schema fields + computed results
139
+ */
140
+ interface GrasshopperComputeResponse extends GrasshopperBaseSchema, GrasshopperDefinitionSource {
141
+ /** Whether cache was used (always present in response) */
142
+ cachesolve: boolean;
143
+ /** Model units (always present in response) */
144
+ modelunits: RhinoModelUnit;
145
+ /** Base64 encoded algorithm (always present in response) */
146
+ algo: string;
147
+ /** Filename of the definition (always present in response) */
148
+ filename: string | null;
149
+ /** Data version */
150
+ dataversion: 7 | 8;
151
+ /** Recursion level used */
152
+ recursionlevel?: number;
153
+ /** Output values organized by parameter */
154
+ values: DataTree[];
155
+ /** Computation errors */
156
+ errors?: string[];
157
+ /** Computation warnings */
158
+ warnings?: string[];
159
+ }
160
+ /**
161
+ * Output parameter
162
+ */
163
+ interface OutputParamSchema {
164
+ name: string;
165
+ nickname: string | null;
166
+ paramType: string;
167
+ /**
168
+ * Grasshopper parameter instance GUID
169
+ */
170
+ id: string;
171
+ }
172
+ /**
173
+ * Input parameter
174
+ */
175
+ interface InputParamSchema {
176
+ /**
177
+ * Grasshopper parameter instance GUID
178
+ */
179
+ id: string;
180
+ name: string;
181
+ nickname: string | null;
182
+ description: string;
183
+ paramType: string;
184
+ treeAccess: boolean;
185
+ minimum: number | null;
186
+ maximum: number | null;
187
+ atLeast: number;
188
+ atMost: number;
189
+ stepSize?: number;
190
+ default: any;
191
+ /**
192
+ * Key-value pairs for dropdown options
193
+ */
194
+ values?: Record<string, string>;
195
+ /**
196
+ * Accepted file formats for File input
197
+ */
198
+ acceptedFormats?: string[];
199
+ groupName?: string | null;
200
+ }
201
+
202
+ export type { ComputeConfig as C, DataItem as D, GrasshopperRequestSchema as G, InputParamSchema as I, OutputParamSchema as O, RhinoModelUnit as R, DataTree as a, GrasshopperComputeResponse as b, GrasshopperComputeConfig as c, DataTreeDefault as d, DataTreePath as e, IoResponseSchema as f };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This type is defining a FileData object that comes from the IO Compuceraptor components.
3
+ */
4
+ type FileData = {
5
+ FileName: string;
6
+ Data: string;
7
+ /** eg. **.3dm** will be added to the file name*/
8
+ FileType: string;
9
+ /** Helps to determine if the file needs to be decoded first */
10
+ IsBase64Encoded: boolean;
11
+ /** Create a directory structure to be used to create the the ZIP in the end @file handle-files.ts */
12
+ SubFolder: string;
13
+ };
14
+ /**
15
+ * Represents a processed file ready for use.
16
+ */
17
+ type ProcessedFile = {
18
+ fileName: string;
19
+ content: Uint8Array | string;
20
+ path: string;
21
+ };
22
+ type FileBaseInfo = {
23
+ FileName: string;
24
+ FilePath: string;
25
+ };
26
+
27
+ export type { FileData as F, ProcessedFile as P, FileBaseInfo as a };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This type is defining a FileData object that comes from the IO Compuceraptor components.
3
+ */
4
+ type FileData = {
5
+ FileName: string;
6
+ Data: string;
7
+ /** eg. **.3dm** will be added to the file name*/
8
+ FileType: string;
9
+ /** Helps to determine if the file needs to be decoded first */
10
+ IsBase64Encoded: boolean;
11
+ /** Create a directory structure to be used to create the the ZIP in the end @file handle-files.ts */
12
+ SubFolder: string;
13
+ };
14
+ /**
15
+ * Represents a processed file ready for use.
16
+ */
17
+ type ProcessedFile = {
18
+ fileName: string;
19
+ content: Uint8Array | string;
20
+ path: string;
21
+ };
22
+ type FileBaseInfo = {
23
+ FileName: string;
24
+ FilePath: string;
25
+ };
26
+
27
+ export type { FileData as F, ProcessedFile as P, FileBaseInfo as a };
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Material properties for Three.js rendering.
3
+ */
4
+ interface SerializableMaterial {
5
+ color: string;
6
+ metalness: number;
7
+ roughness: number;
8
+ opacity: number;
9
+ transparent: boolean;
10
+ }
11
+ /**
12
+ * Metadata for a single mesh within a batch.
13
+ */
14
+ interface MeshMetadata {
15
+ name: string;
16
+ vertexCount: number;
17
+ faceCount: number;
18
+ /** Offset in the combined vertex array (in number of floats) */
19
+ vertexOffset: number;
20
+ /** Offset in the combined face index array (in number of integers) */
21
+ faceOffset: number;
22
+ /** Metadata for the mesh */
23
+ metadata?: Record<string, string>;
24
+ }
25
+ /**
26
+ * A group of meshes sharing the same material.
27
+ */
28
+ interface MaterialGroup {
29
+ /** Reference to the material ID in the materials array */
30
+ materialId: number;
31
+ /** Individual meshes in this group */
32
+ meshes: MeshMetadata[];
33
+ }
34
+ /**
35
+ * Batched mesh data optimized for Three.js rendering.
36
+ */
37
+ interface MeshBatch {
38
+ /** Array of unique materials */
39
+ materials: SerializableMaterial[];
40
+ /** Groups of meshes organized by material */
41
+ groups: MaterialGroup[];
42
+ /** Compressed binary data containing all vertices and faces */
43
+ compressedData: string;
44
+ }
45
+ /**
46
+ * Decompressed mesh data.
47
+ */
48
+ interface DecompressedMeshData {
49
+ vertices: Float32Array;
50
+ faces: Uint32Array;
51
+ }
52
+ /**
53
+ * Options for parsing mesh batch data.
54
+ */
55
+ interface MeshBatchParsingOptions {
56
+ /** Merge meshes with same material into single geometry (better performance). Defaults to true. */
57
+ mergeByMaterial?: boolean;
58
+ /** Apply coordinate system transformations (Rhino Z-up to Three.js Y-up). Defaults to true. */
59
+ applyTransforms?: boolean;
60
+ /** Enable performance monitoring in console. Defaults to false. */
61
+ debug?: boolean;
62
+ }
63
+ /**
64
+ * Options for extracting and processing meshes from compute responses.
65
+ */
66
+ interface MeshExtractionOptions {
67
+ /** Configuration for parsing mesh batches. */
68
+ parsing?: MeshBatchParsingOptions;
69
+ /** Apply scaling based on model units. Defaults to true. */
70
+ allowScaling?: boolean;
71
+ /** Apply automatic ground offset positioning (Z=0). Defaults to true. */
72
+ allowAutoPosition?: boolean;
73
+ /** Enable verbose logging. Defaults to false. */
74
+ debug?: boolean;
75
+ }
76
+
77
+ export type { DecompressedMeshData as D, MeshExtractionOptions as M, SerializableMaterial as S, MeshBatch as a, MeshBatchParsingOptions as b, MeshMetadata as c, MaterialGroup as d };
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Material properties for Three.js rendering.
3
+ */
4
+ interface SerializableMaterial {
5
+ color: string;
6
+ metalness: number;
7
+ roughness: number;
8
+ opacity: number;
9
+ transparent: boolean;
10
+ }
11
+ /**
12
+ * Metadata for a single mesh within a batch.
13
+ */
14
+ interface MeshMetadata {
15
+ name: string;
16
+ vertexCount: number;
17
+ faceCount: number;
18
+ /** Offset in the combined vertex array (in number of floats) */
19
+ vertexOffset: number;
20
+ /** Offset in the combined face index array (in number of integers) */
21
+ faceOffset: number;
22
+ /** Metadata for the mesh */
23
+ metadata?: Record<string, string>;
24
+ }
25
+ /**
26
+ * A group of meshes sharing the same material.
27
+ */
28
+ interface MaterialGroup {
29
+ /** Reference to the material ID in the materials array */
30
+ materialId: number;
31
+ /** Individual meshes in this group */
32
+ meshes: MeshMetadata[];
33
+ }
34
+ /**
35
+ * Batched mesh data optimized for Three.js rendering.
36
+ */
37
+ interface MeshBatch {
38
+ /** Array of unique materials */
39
+ materials: SerializableMaterial[];
40
+ /** Groups of meshes organized by material */
41
+ groups: MaterialGroup[];
42
+ /** Compressed binary data containing all vertices and faces */
43
+ compressedData: string;
44
+ }
45
+ /**
46
+ * Decompressed mesh data.
47
+ */
48
+ interface DecompressedMeshData {
49
+ vertices: Float32Array;
50
+ faces: Uint32Array;
51
+ }
52
+ /**
53
+ * Options for parsing mesh batch data.
54
+ */
55
+ interface MeshBatchParsingOptions {
56
+ /** Merge meshes with same material into single geometry (better performance). Defaults to true. */
57
+ mergeByMaterial?: boolean;
58
+ /** Apply coordinate system transformations (Rhino Z-up to Three.js Y-up). Defaults to true. */
59
+ applyTransforms?: boolean;
60
+ /** Enable performance monitoring in console. Defaults to false. */
61
+ debug?: boolean;
62
+ }
63
+ /**
64
+ * Options for extracting and processing meshes from compute responses.
65
+ */
66
+ interface MeshExtractionOptions {
67
+ /** Configuration for parsing mesh batches. */
68
+ parsing?: MeshBatchParsingOptions;
69
+ /** Apply scaling based on model units. Defaults to true. */
70
+ allowScaling?: boolean;
71
+ /** Apply automatic ground offset positioning (Z=0). Defaults to true. */
72
+ allowAutoPosition?: boolean;
73
+ /** Enable verbose logging. Defaults to false. */
74
+ debug?: boolean;
75
+ }
76
+
77
+ export type { DecompressedMeshData as D, MeshExtractionOptions as M, SerializableMaterial as S, MeshBatch as a, MeshBatchParsingOptions as b, MeshMetadata as c, MaterialGroup as d };