any2orca 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/cli/main.js +1 -1
- package/dist/engine/policy.d.ts +10 -2
- package/dist/engine/policy.js +13 -5
- package/dist/engine/runConvertPipeline.js +2 -2
- package/dist/explain/whatChanged.js +4 -2
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/profiles.js +7 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# any2orca
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Output-affecting
|
|
6
|
+
|
|
7
|
+
- **A filament's start and end G-code is now always the U1's own,** like every other kind of G-code. Source filament presets carry code for their own printer: Bambu's switches its chamber fan, and Creality Print 7.3's moves Z for the K2, with a variable Snapmaker Orca doesn't know, so those files didn't slice. Files converted from Bambu Studio and Creality Print change, and so does any other file whose filaments use those presets (an ElegooSlicer project with Bambu PLA, for example); re-convert them to get this. What changed counts the filament G-code with the printer settings that use the U1's own, and the filaments' line says their G-code is the U1's.
|
|
8
|
+
|
|
9
|
+
### Other
|
|
10
|
+
|
|
11
|
+
- **ElegooSlicer and Flash Studio (Flashforge's slicer) are named as supported sources** in the CLI's help, the README and the package description. Projects from both were already detected and converted. All five source slicers are now tested on one shared project, which converts, slices in Snapmaker Orca, and uploads to Snapmaker Space with Snapmaker filament names.
|
|
12
|
+
|
|
3
13
|
## 0.1.0
|
|
4
14
|
|
|
5
15
|
First release under the any2orca name, formerly bambu2orca and its `@kuzuri.ao/b2o` command-line tool. The whole conversion now runs on your own machine: no account, no API key, no quota, and nothing you convert is sent anywhere.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# any2orca
|
|
2
2
|
|
|
3
|
-
Convert Bambu Studio, Creality Print
|
|
3
|
+
Convert Bambu Studio, Creality Print, Anycubic Slicer Next, ElegooSlicer and Flash Studio `.3mf` projects to Snapmaker U1 / Orca format, entirely on your own machine. One package: a command-line tool, a library for Node and browsers, and a ready-made Web Worker.
|
|
4
4
|
|
|
5
5
|
Formerly bambu2orca and the `@kuzuri.ao/b2o` CLI. Same conversion, now local: no account, no API key, no quota, and nothing you convert is sent anywhere.
|
|
6
6
|
|
package/dist/cli/main.js
CHANGED
|
@@ -45,7 +45,7 @@ function wrapText(text, width) {
|
|
|
45
45
|
lines.push(line);
|
|
46
46
|
return lines;
|
|
47
47
|
}
|
|
48
|
-
const TOP_LEVEL_HELP = `any2orca ${VERSION}: convert Bambu Studio, Creality Print
|
|
48
|
+
const TOP_LEVEL_HELP = `any2orca ${VERSION}: convert Bambu Studio, Creality Print, Anycubic Slicer Next, ElegooSlicer and Flash Studio .3mf projects to Snapmaker U1 / Orca format, entirely on this machine.
|
|
49
49
|
|
|
50
50
|
Usage: any2orca <command> [options]
|
|
51
51
|
|
package/dist/engine/policy.d.ts
CHANGED
|
@@ -9,6 +9,14 @@ export declare const MIN_COMPARISON_KEYS: readonly string[];
|
|
|
9
9
|
export declare const ALWAYS_TRANSFER_KEYS: readonly string[];
|
|
10
10
|
export declare const U1_VALUE_KEYS: readonly string[];
|
|
11
11
|
export declare const MACHINE_SETTINGS_KEYS: readonly string[];
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Every kind of G-code: start, end, by object, layer change, time lapse, filament
|
|
14
|
+
* change, extrusion role change, pause, template, a filament's own start and end,
|
|
15
|
+
* and any added later. It runs on the printer, and a source file's G-code was
|
|
16
|
+
* written for another printer (even a filament preset's: Bambu's switches its
|
|
17
|
+
* chamber fan, Creality Print's moves Z for the K2), so it always keeps the U1
|
|
18
|
+
* profile's value. Snapmaker's U1 filaments carry only a comment there.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isGcodeKey(key: string): boolean;
|
|
21
|
+
/** Filament keys that always keep the U1 profile's value, besides every G-code key (see {@link isGcodeKey}). */
|
|
14
22
|
export declare const FILAMENT_KEY_BLOCKLIST: readonly string[];
|
package/dist/engine/policy.js
CHANGED
|
@@ -166,8 +166,8 @@ export const U1_VALUE_KEYS = [
|
|
|
166
166
|
// Printer (machine) settings never transfer from a source file: they belong
|
|
167
167
|
// to the U1 printer profile. This is the key set of Snapmaker's U1 machine
|
|
168
168
|
// preset (packages/profiles/templates/machine_settings_1.config; a test keeps
|
|
169
|
-
// the two in step). Together with every
|
|
170
|
-
//
|
|
169
|
+
// the two in step). Together with every G-code key (see isGcodeKey) and
|
|
170
|
+
// `from`, these always keep the U1 profile's value.
|
|
171
171
|
export const MACHINE_SETTINGS_KEYS = [
|
|
172
172
|
"auxiliary_fan",
|
|
173
173
|
"bed_exclude_area",
|
|
@@ -254,10 +254,18 @@ export const MACHINE_SETTINGS_KEYS = [
|
|
|
254
254
|
"z_hop_when_prime",
|
|
255
255
|
"from",
|
|
256
256
|
];
|
|
257
|
-
/**
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
/**
|
|
258
|
+
* Every kind of G-code: start, end, by object, layer change, time lapse, filament
|
|
259
|
+
* change, extrusion role change, pause, template, a filament's own start and end,
|
|
260
|
+
* and any added later. It runs on the printer, and a source file's G-code was
|
|
261
|
+
* written for another printer (even a filament preset's: Bambu's switches its
|
|
262
|
+
* chamber fan, Creality Print's moves Z for the K2), so it always keeps the U1
|
|
263
|
+
* profile's value. Snapmaker's U1 filaments carry only a comment there.
|
|
264
|
+
*/
|
|
265
|
+
export function isGcodeKey(key) {
|
|
266
|
+
return key.endsWith("_gcode");
|
|
260
267
|
}
|
|
268
|
+
/** Filament keys that always keep the U1 profile's value, besides every G-code key (see {@link isGcodeKey}). */
|
|
261
269
|
export const FILAMENT_KEY_BLOCKLIST = [
|
|
262
270
|
"compatible_printers",
|
|
263
271
|
"compatible_printers_condition",
|
|
@@ -122,7 +122,7 @@ export function runConvertPipeline(profile, request, application, options = {})
|
|
|
122
122
|
});
|
|
123
123
|
if (filamentKeyArrays && slots.length > 0) {
|
|
124
124
|
tracker.add("creator", {
|
|
125
|
-
label: `${slots.length} filament${slots.length === 1 ? "" : "s"}: colors, materials and filament settings kept as the creator set them`,
|
|
125
|
+
label: `${slots.length} filament${slots.length === 1 ? "" : "s"}: colors, materials and filament settings kept as the creator set them, except G-code, which is the U1's own`,
|
|
126
126
|
before: null,
|
|
127
127
|
after: null,
|
|
128
128
|
});
|
|
@@ -225,7 +225,7 @@ export function runConvertPipeline(profile, request, application, options = {})
|
|
|
225
225
|
changes: tracker.build(request.projectSettings, p.baselineProjectSettings, newSettings, (key) => {
|
|
226
226
|
if (U1_VALUE_KEY_SET.has(key))
|
|
227
227
|
return "always the U1's own value";
|
|
228
|
-
if (p.blocklist.has(key))
|
|
228
|
+
if (p.blocklist.has(key) || p.filamentKeyBlocklist.has(key))
|
|
229
229
|
return "always the U1's own value";
|
|
230
230
|
if (p.minComparisonKeys.has(key)) {
|
|
231
231
|
// In Snapmaker Orca and Bambu Studio, an acceleration of 0 means "the same as normal printing".
|
|
@@ -113,11 +113,13 @@ export class ChangeTracker {
|
|
|
113
113
|
if (this.recorded.has(key) || BOOKKEEPING_KEYS.has(key))
|
|
114
114
|
continue;
|
|
115
115
|
const info = Object.hasOwn(SETTINGS_CATALOG, key) ? SETTINGS_CATALOG[key] : undefined;
|
|
116
|
-
|
|
116
|
+
// A filament's G-code is printer code, so it's counted with the printer settings, not summarized as the creator's filament.
|
|
117
|
+
const gcode = key.endsWith("_gcode");
|
|
118
|
+
if (!info || (info.group === "filament" && !gcode) || !Object.hasOwn(stock, key) || !Object.hasOwn(output, key))
|
|
117
119
|
continue;
|
|
118
120
|
if (sameSetting(source[key], stock[key]) || !sameSetting(output[key], stock[key]))
|
|
119
121
|
continue;
|
|
120
|
-
if (info.group === "machine") {
|
|
122
|
+
if (info.group === "machine" || gcode) {
|
|
121
123
|
printerSettings++;
|
|
122
124
|
continue;
|
|
123
125
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* any2orca: convert Bambu Studio, Creality Print
|
|
3
|
-
* projects for the Snapmaker U1 (Snapmaker
|
|
4
|
-
* process. The library makes no network
|
|
5
|
-
* comes from a {@link ProfileSource} the
|
|
2
|
+
* any2orca: convert Bambu Studio, Creality Print, Anycubic Slicer Next,
|
|
3
|
+
* ElegooSlicer and Flash Studio 3MF projects for the Snapmaker U1 (Snapmaker
|
|
4
|
+
* Orca), entirely in the caller's own process. The library makes no network
|
|
5
|
+
* requests of its own; profile data comes from a {@link ProfileSource} the
|
|
6
|
+
* caller provides.
|
|
6
7
|
*
|
|
7
8
|
* Runs in browsers, Web Workers and Node. For Node file-based profile
|
|
8
9
|
* sources see `any2orca/node`; for a ready-made Web Worker see
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
/**
|
|
3
|
-
* any2orca: convert Bambu Studio, Creality Print
|
|
4
|
-
* projects for the Snapmaker U1 (Snapmaker
|
|
5
|
-
* process. The library makes no network
|
|
6
|
-
* comes from a {@link ProfileSource} the
|
|
3
|
+
* any2orca: convert Bambu Studio, Creality Print, Anycubic Slicer Next,
|
|
4
|
+
* ElegooSlicer and Flash Studio 3MF projects for the Snapmaker U1 (Snapmaker
|
|
5
|
+
* Orca), entirely in the caller's own process. The library makes no network
|
|
6
|
+
* requests of its own; profile data comes from a {@link ProfileSource} the
|
|
7
|
+
* caller provides.
|
|
7
8
|
*
|
|
8
9
|
* Runs in browsers, Web Workers and Node. For Node file-based profile
|
|
9
10
|
* sources see `any2orca/node`; for a ready-made Web Worker see
|
package/dist/profiles.js
CHANGED
|
@@ -17,7 +17,7 @@ import { z } from "zod";
|
|
|
17
17
|
import { Any2orcaError } from "./errors.js";
|
|
18
18
|
import { APPLICATION_VALUE } from "./archive/setApplicationMetadata.js";
|
|
19
19
|
import { parseTierName } from "./engine/parseTierName.js";
|
|
20
|
-
import { ALWAYS_TRANSFER_KEYS, BLOCKLIST, FILAMENT_KEY_BLOCKLIST,
|
|
20
|
+
import { ALWAYS_TRANSFER_KEYS, BLOCKLIST, FILAMENT_KEY_BLOCKLIST, isGcodeKey, MACHINE_SETTINGS_KEYS, MIN_COMPARISON_KEYS, U1_VALUE_KEYS } from "./engine/policy.js";
|
|
21
21
|
/** Largest index file accepted from any source. */
|
|
22
22
|
export const MAX_INDEX_BYTES = 1024 * 1024;
|
|
23
23
|
/** Largest single profile file accepted from any source. A real one is about 100 KB. */
|
|
@@ -208,11 +208,15 @@ function toLoadedProfile(raw, summary, filamentNames) {
|
|
|
208
208
|
...BLOCKLIST,
|
|
209
209
|
...U1_VALUE_KEYS,
|
|
210
210
|
...MACHINE_SETTINGS_KEYS,
|
|
211
|
-
...Object.keys(file.baselineProjectSettings).filter(
|
|
211
|
+
...Object.keys(file.baselineProjectSettings).filter(isGcodeKey),
|
|
212
212
|
]),
|
|
213
213
|
minComparisonKeys: new Set(MIN_COMPARISON_KEYS),
|
|
214
214
|
alwaysTransferKeys: new Set(ALWAYS_TRANSFER_KEYS),
|
|
215
|
-
filamentKeyBlocklist: new Set(
|
|
215
|
+
filamentKeyBlocklist: new Set([
|
|
216
|
+
...FILAMENT_KEY_BLOCKLIST,
|
|
217
|
+
...Object.keys(file.filamentShape).filter(isGcodeKey),
|
|
218
|
+
...Object.keys(file.baselineProjectSettings).filter(isGcodeKey),
|
|
219
|
+
]),
|
|
216
220
|
highFlowOverrides: file.highFlowOverrides,
|
|
217
221
|
},
|
|
218
222
|
},
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.2.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "any2orca",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Convert Bambu Studio, Creality Print
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Convert Bambu Studio, Creality Print, Anycubic Slicer Next, ElegooSlicer and Flash Studio 3MF projects for the Snapmaker U1 (Snapmaker Orca), entirely on your own machine. Library, CLI and Web Worker in one package.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"3mf",
|
|
7
7
|
"snapmaker",
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
"bambu-studio",
|
|
12
12
|
"creality-print",
|
|
13
13
|
"anycubic",
|
|
14
|
+
"elegoo",
|
|
15
|
+
"flashforge",
|
|
14
16
|
"3d-printing",
|
|
15
17
|
"slicer",
|
|
16
18
|
"converter",
|
|
@@ -83,5 +85,5 @@
|
|
|
83
85
|
"bugs": {
|
|
84
86
|
"url": "https://github.com/KuzuriAo/any2orca/issues"
|
|
85
87
|
},
|
|
86
|
-
"outputAffecting": "
|
|
88
|
+
"outputAffecting": "A filament's start and end G-code is now always the U1's own, like every other kind of G-code, so files from Bambu Studio and Creality Print change."
|
|
87
89
|
}
|