@iyulab/u-nesting 0.3.3 → 0.3.5
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/README.md +34 -7
- package/package.json +2 -2
- package/u_nesting_wasm_bg.js +39 -0
- package/u_nesting_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -167,22 +167,49 @@ interface Request2D {
|
|
|
167
167
|
|
|
168
168
|
## Response Schema
|
|
169
169
|
|
|
170
|
+
### `solve_2d` Response
|
|
171
|
+
|
|
170
172
|
```typescript
|
|
171
173
|
interface SolveResponse {
|
|
172
174
|
version: string;
|
|
173
175
|
success: boolean;
|
|
174
176
|
error?: string;
|
|
175
177
|
placements: {
|
|
176
|
-
|
|
177
|
-
instance: number;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
id: string; // geometry id
|
|
179
|
+
instance: number; // 0-based copy index
|
|
180
|
+
x: number;
|
|
181
|
+
y: number;
|
|
182
|
+
rotation: number; // degrees
|
|
183
|
+
sheet_index: number; // 0-based sheet/bin index
|
|
184
|
+
flipped: boolean; // mirrored
|
|
185
|
+
}[];
|
|
186
|
+
sheets_used: number;
|
|
187
|
+
utilization: number;
|
|
188
|
+
unplaced: string[];
|
|
189
|
+
elapsed_ms: number;
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### `solve_3d` Response
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
interface Pack3DResponse {
|
|
197
|
+
version: string;
|
|
198
|
+
success: boolean;
|
|
199
|
+
error?: string;
|
|
200
|
+
placements: {
|
|
201
|
+
id: string; // geometry id
|
|
202
|
+
instance: number; // 0-based copy index
|
|
203
|
+
bin_index: number; // 0-based bin index
|
|
204
|
+
x: number;
|
|
205
|
+
y: number;
|
|
206
|
+
z: number; // depth/height position (min corner)
|
|
207
|
+
orientation: string; // axis permutation, e.g. "xyz", "xzy"
|
|
181
208
|
}[];
|
|
182
|
-
|
|
209
|
+
bins_used: number;
|
|
183
210
|
utilization: number;
|
|
184
211
|
unplaced: string[];
|
|
185
|
-
|
|
212
|
+
elapsed_ms: number;
|
|
186
213
|
}
|
|
187
214
|
```
|
|
188
215
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"iyulab"
|
|
6
6
|
],
|
|
7
7
|
"description": "WebAssembly bindings for U-Nesting spatial optimization engine",
|
|
8
|
-
"version": "0.3.
|
|
8
|
+
"version": "0.3.5",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
"wasm",
|
|
30
30
|
"webassembly"
|
|
31
31
|
]
|
|
32
|
-
}
|
|
32
|
+
}
|
package/u_nesting_wasm_bg.js
CHANGED
|
@@ -123,9 +123,44 @@ export function version() {
|
|
|
123
123
|
wasm.__wbindgen_export2(deferred1_0, deferred1_1, 1);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
+
export function __wbg___wbindgen_is_undefined_67b456be8673d3d7(arg0) {
|
|
127
|
+
const ret = getObject(arg0) === undefined;
|
|
128
|
+
return ret;
|
|
129
|
+
}
|
|
130
|
+
export function __wbg___wbindgen_throw_1506f2235d1bdba0(arg0, arg1) {
|
|
131
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
132
|
+
}
|
|
126
133
|
export function __wbg_getRandomValues_3f44b700395062e5() { return handleError(function (arg0, arg1) {
|
|
127
134
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
128
135
|
}, arguments); }
|
|
136
|
+
export function __wbg_now_e7c6795a7f81e10f(arg0) {
|
|
137
|
+
const ret = getObject(arg0).now();
|
|
138
|
+
return ret;
|
|
139
|
+
}
|
|
140
|
+
export function __wbg_performance_3fcf6e32a7e1ed0a(arg0) {
|
|
141
|
+
const ret = getObject(arg0).performance;
|
|
142
|
+
return addHeapObject(ret);
|
|
143
|
+
}
|
|
144
|
+
export function __wbg_static_accessor_GLOBAL_9d53f2689e622ca1() {
|
|
145
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
146
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
147
|
+
}
|
|
148
|
+
export function __wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a() {
|
|
149
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
150
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
151
|
+
}
|
|
152
|
+
export function __wbg_static_accessor_SELF_4c59f6c7ea29a144() {
|
|
153
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
154
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
155
|
+
}
|
|
156
|
+
export function __wbg_static_accessor_WINDOW_e70ae9f2eb052253() {
|
|
157
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
158
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
159
|
+
}
|
|
160
|
+
export function __wbindgen_object_clone_ref(arg0) {
|
|
161
|
+
const ret = getObject(arg0);
|
|
162
|
+
return addHeapObject(ret);
|
|
163
|
+
}
|
|
129
164
|
export function __wbindgen_object_drop_ref(arg0) {
|
|
130
165
|
takeObject(arg0);
|
|
131
166
|
}
|
|
@@ -184,6 +219,10 @@ heap.push(undefined, null, true, false);
|
|
|
184
219
|
|
|
185
220
|
let heap_next = heap.length;
|
|
186
221
|
|
|
222
|
+
function isLikeNone(x) {
|
|
223
|
+
return x === undefined || x === null;
|
|
224
|
+
}
|
|
225
|
+
|
|
187
226
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
188
227
|
if (realloc === undefined) {
|
|
189
228
|
const buf = cachedTextEncoder.encode(arg);
|
package/u_nesting_wasm_bg.wasm
CHANGED
|
Binary file
|