any2orca 0.0.0-stage → 0.1.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 +70 -0
- package/LICENSE +21 -0
- package/NOTICE +28 -0
- package/README.md +99 -2
- package/dist/archive/adaptModelSettings.d.ts +1 -0
- package/dist/archive/adaptModelSettings.js +50 -0
- package/dist/archive/filamentColorNames.d.ts +8 -0
- package/dist/archive/filamentColorNames.js +760 -0
- package/dist/archive/fmtNum.d.ts +14 -0
- package/dist/archive/fmtNum.js +21 -0
- package/dist/archive/internal/escapeRegExp.d.ts +2 -0
- package/dist/archive/internal/escapeRegExp.js +5 -0
- package/dist/archive/lookupFilamentColorName.d.ts +45 -0
- package/dist/archive/lookupFilamentColorName.js +57 -0
- package/dist/archive/objectWorldBboxXY.d.ts +2 -0
- package/dist/archive/objectWorldBboxXY.js +123 -0
- package/dist/archive/parseItemPositions.d.ts +6 -0
- package/dist/archive/parseItemPositions.js +17 -0
- package/dist/archive/parseObjectMetadata.d.ts +10 -0
- package/dist/archive/parseObjectMetadata.js +97 -0
- package/dist/archive/parsePlateAssignments.d.ts +6 -0
- package/dist/archive/parsePlateAssignments.js +18 -0
- package/dist/archive/parseVertices.d.ts +7 -0
- package/dist/archive/parseVertices.js +12 -0
- package/dist/archive/paths.d.ts +5 -0
- package/dist/archive/paths.js +6 -0
- package/dist/archive/recenterAssembleItems.d.ts +9 -0
- package/dist/archive/recenterAssembleItems.js +53 -0
- package/dist/archive/recenterBuildItems.d.ts +15 -0
- package/dist/archive/recenterBuildItems.js +51 -0
- package/dist/archive/safeUnzip.d.ts +26 -0
- package/dist/archive/safeUnzip.js +126 -0
- package/dist/archive/setApplicationMetadata.d.ts +13 -0
- package/dist/archive/setApplicationMetadata.js +18 -0
- package/dist/archive/shouldDropFromBambu.d.ts +29 -0
- package/dist/archive/shouldDropFromBambu.js +39 -0
- package/dist/archive/streamObjectVertices.d.ts +19 -0
- package/dist/archive/streamObjectVertices.js +57 -0
- package/dist/archive/tolerantJsonParse.d.ts +20 -0
- package/dist/archive/tolerantJsonParse.js +71 -0
- package/dist/archive/transform.d.ts +21 -0
- package/dist/archive/transform.js +39 -0
- package/dist/archive/unwrapBundle.d.ts +24 -0
- package/dist/archive/unwrapBundle.js +41 -0
- package/dist/archive/xmlBlocks.d.ts +10 -0
- package/dist/archive/xmlBlocks.js +31 -0
- package/dist/archive/zip.d.ts +29 -0
- package/dist/archive/zip.js +141 -0
- package/dist/cli/archiveMove.d.ts +15 -0
- package/dist/cli/archiveMove.js +41 -0
- package/dist/cli/commands/convert.d.ts +89 -0
- package/dist/cli/commands/convert.js +311 -0
- package/dist/cli/commands/diff.d.ts +21 -0
- package/dist/cli/commands/diff.js +112 -0
- package/dist/cli/commands/presets.d.ts +51 -0
- package/dist/cli/commands/presets.js +280 -0
- package/dist/cli/commands/profiles.d.ts +5 -0
- package/dist/cli/commands/profiles.js +26 -0
- package/dist/cli/commands/telemetry.d.ts +6 -0
- package/dist/cli/commands/telemetry.js +45 -0
- package/dist/cli/config.d.ts +18 -0
- package/dist/cli/config.js +50 -0
- package/dist/cli/expandWildcards.d.ts +17 -0
- package/dist/cli/expandWildcards.js +81 -0
- package/dist/cli/logger.d.ts +17 -0
- package/dist/cli/logger.js +36 -0
- package/dist/cli/main.d.ts +24 -0
- package/dist/cli/main.js +598 -0
- package/dist/cli/sameFile.d.ts +9 -0
- package/dist/cli/sameFile.js +40 -0
- package/dist/cli/stats.d.ts +34 -0
- package/dist/cli/stats.js +137 -0
- package/dist/cli/table.d.ts +8 -0
- package/dist/cli/table.js +18 -0
- package/dist/cli/terminalText.d.ts +7 -0
- package/dist/cli/terminalText.js +22 -0
- package/dist/cli/updateCheck.d.ts +14 -0
- package/dist/cli/updateCheck.js +78 -0
- package/dist/cli/watchState.d.ts +18 -0
- package/dist/cli/watchState.js +33 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +10 -0
- package/dist/diff/diffSettings.d.ts +81 -0
- package/dist/diff/diffSettings.js +259 -0
- package/dist/diff/reference.d.ts +14 -0
- package/dist/diff/reference.js +22 -0
- package/dist/diff/settingsCatalog.d.ts +28 -0
- package/dist/diff/settingsCatalog.js +605 -0
- package/dist/diff/valueLayout.d.ts +20 -0
- package/dist/diff/valueLayout.js +65 -0
- package/dist/engine/aboveStock.d.ts +20 -0
- package/dist/engine/aboveStock.js +89 -0
- package/dist/engine/applyFilamentComplianceMode.d.ts +40 -0
- package/dist/engine/applyFilamentComplianceMode.js +68 -0
- package/dist/engine/applyFilamentFlowVariants.d.ts +42 -0
- package/dist/engine/applyFilamentFlowVariants.js +109 -0
- package/dist/engine/applyHighFlowHotends.d.ts +52 -0
- package/dist/engine/applyHighFlowHotends.js +115 -0
- package/dist/engine/applyPresetChanges.d.ts +12 -0
- package/dist/engine/applyPresetChanges.js +23 -0
- package/dist/engine/bedCenter.d.ts +19 -0
- package/dist/engine/bedCenter.js +34 -0
- package/dist/engine/buildFilamentConfigs.d.ts +18 -0
- package/dist/engine/buildFilamentConfigs.js +49 -0
- package/dist/engine/buildProjectSettings.d.ts +24 -0
- package/dist/engine/buildProjectSettings.js +164 -0
- package/dist/engine/carrySourceLayerHeight.d.ts +15 -0
- package/dist/engine/carrySourceLayerHeight.js +41 -0
- package/dist/engine/clampColorPenetration.d.ts +12 -0
- package/dist/engine/clampColorPenetration.js +28 -0
- package/dist/engine/clampToMachineLimits.d.ts +21 -0
- package/dist/engine/clampToMachineLimits.js +84 -0
- package/dist/engine/coerceValue.d.ts +15 -0
- package/dist/engine/coerceValue.js +56 -0
- package/dist/engine/collapseNozzleVariants.d.ts +31 -0
- package/dist/engine/collapseNozzleVariants.js +63 -0
- package/dist/engine/computeShifts.d.ts +12 -0
- package/dist/engine/computeShifts.js +339 -0
- package/dist/engine/constants.d.ts +11 -0
- package/dist/engine/constants.js +12 -0
- package/dist/engine/detectNozzleDiameter.d.ts +15 -0
- package/dist/engine/detectNozzleDiameter.js +29 -0
- package/dist/engine/detectVariantIndex.d.ts +39 -0
- package/dist/engine/detectVariantIndex.js +80 -0
- package/dist/engine/extractFilamentSlots.d.ts +18 -0
- package/dist/engine/extractFilamentSlots.js +88 -0
- package/dist/engine/filamentComplianceNames.d.ts +84 -0
- package/dist/engine/filamentComplianceNames.js +87 -0
- package/dist/engine/filamentVariantLayout.d.ts +29 -0
- package/dist/engine/filamentVariantLayout.js +38 -0
- package/dist/engine/fillFilamentSlots.d.ts +16 -0
- package/dist/engine/fillFilamentSlots.js +26 -0
- package/dist/engine/internal/jsonEqual.d.ts +2 -0
- package/dist/engine/internal/jsonEqual.js +5 -0
- package/dist/engine/parseTierName.d.ts +15 -0
- package/dist/engine/parseTierName.js +21 -0
- package/dist/engine/pickNearestProfile.d.ts +21 -0
- package/dist/engine/pickNearestProfile.js +24 -0
- package/dist/engine/pickProfile.d.ts +49 -0
- package/dist/engine/pickProfile.js +67 -0
- package/dist/engine/policy.d.ts +14 -0
- package/dist/engine/policy.js +266 -0
- package/dist/engine/remapBrimType.d.ts +30 -0
- package/dist/engine/remapBrimType.js +34 -0
- package/dist/engine/reshapeToCount.d.ts +15 -0
- package/dist/engine/reshapeToCount.js +27 -0
- package/dist/engine/resizeFlushVolumes.d.ts +27 -0
- package/dist/engine/resizeFlushVolumes.js +57 -0
- package/dist/engine/resolveMinIfLower.d.ts +21 -0
- package/dist/engine/resolveMinIfLower.js +59 -0
- package/dist/engine/runConvertPipeline.d.ts +79 -0
- package/dist/engine/runConvertPipeline.js +281 -0
- package/dist/engine/stripBambuOnlyNozzleVariantKeys.d.ts +2 -0
- package/dist/engine/stripBambuOnlyNozzleVariantKeys.js +35 -0
- package/dist/engine/types.d.ts +2 -0
- package/dist/engine/types.js +1 -0
- package/dist/errors.d.ts +18 -0
- package/dist/errors.js +9 -0
- package/dist/explain/whatChanged.d.ts +102 -0
- package/dist/explain/whatChanged.js +197 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +33 -0
- package/dist/inspect.d.ts +63 -0
- package/dist/inspect.js +103 -0
- package/dist/node.d.ts +11 -0
- package/dist/node.js +50 -0
- package/dist/plainText.d.ts +10 -0
- package/dist/plainText.js +14 -0
- package/dist/presets/extractPreset.d.ts +13 -0
- package/dist/presets/extractPreset.js +87 -0
- package/dist/presets/preset.d.ts +124 -0
- package/dist/presets/preset.js +289 -0
- package/dist/presets/presetKeys.d.ts +5 -0
- package/dist/presets/presetKeys.js +42 -0
- package/dist/profiles.d.ts +184 -0
- package/dist/profiles.js +314 -0
- package/dist/project.d.ts +146 -0
- package/dist/project.js +342 -0
- package/dist/schema.d.ts +103 -0
- package/dist/schema.js +87 -0
- package/dist/stamp.d.ts +45 -0
- package/dist/stamp.js +111 -0
- package/dist/telemetry.d.ts +101 -0
- package/dist/telemetry.js +94 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/dist/worker-entry.d.ts +1 -0
- package/dist/worker-entry.js +142 -0
- package/dist/worker.d.ts +86 -0
- package/dist/worker.js +97 -0
- package/dist/workerProtocol.d.ts +91 -0
- package/dist/workerProtocol.js +1 -0
- package/package.json +85 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# any2orca
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
### Output-affecting
|
|
8
|
+
|
|
9
|
+
Compared with b2o 0.0.12 and the bambu2orca web app. Re-convert a file if you want these:
|
|
10
|
+
|
|
11
|
+
- **Snapmaker's real stock values.** Settings the creator never changed now get Snapmaker's stock value for the matched profile. The old profiles came from one captured project that carried personal tuning (for example an outer wall speed of 50 mm/s instead of Snapmaker's 200).
|
|
12
|
+
- **Snapmaker's stock machine G-code and printer settings,** including the start G-code's purifier and chamber control, even when the source file marks its own G-code or printer settings (retraction, z-hop, wipe and the rest of the printer preset) as changed, as every Snapmaker Orca save does. A filament's own retraction and G-code still come with the filament. Converted files carry no embedded print or machine presets, like Snapmaker Orca's own stock projects.
|
|
13
|
+
- **Settings that describe the U1 keep the U1's value** from Snapmaker's profiles (arc fitting off, and a few toolchanger and layout settings). Six values the old converter forced (raft first-layer expansion, single-extruder priming and four prime tower values) now follow Snapmaker's stock unless the creator changed them.
|
|
14
|
+
- **Speeds and accelerations** from the source are capped at the U1's machine limits. Accelerations and travel speed above Snapmaker's stock aren't carried over unless you choose to keep them; a creator's lower values are kept.
|
|
15
|
+
- **Filament max volumetric speed** is capped at 22 mm³/s, or 40 on a toolhead with the Snapmaker Liber High Flow Hotend. On the 0.4 nozzle each filament carries a standard and a high-flow value, as Snapmaker Orca 2.4 stores them. Lower values are kept.
|
|
16
|
+
- **Re-converting a Snapmaker Orca project keeps its filament tuning** for both the standard and the high-flow hotend: temperatures, flow ratio, pressure advance, retraction and the rest, including in projects that mix filaments with one value and with two. Before, the high-flow values were replaced by the standard ones, and in a mixed project these settings were reset to Snapmaker's stock values.
|
|
17
|
+
- **The 0.4 nozzle is stainless steel,** the U1's stock nozzle, so Snapmaker Orca warns about abrasive filaments correctly (Snapmaker's profiles say hardened steel until their 2.4.2). `--hardened-nozzle` records hardened nozzles.
|
|
18
|
+
- **The file says it was made for Snapmaker Orca 2.4.0.** Its `Application` line now reads `Snapmaker_Orca-2.4.0`, what Snapmaker Orca 2.4.0 writes in its own saves, instead of the source slicer's (for example `BambuStudio-02.08.02.61`), and the extra `OrcaSlicer` line is gone. Snapmaker Orca's command line now slices converted files without `--allow-newer-file`; the G-code is the same.
|
|
19
|
+
- **Snapmaker and Generic filament names are real U1 presets.** `--filament-compliance snapmaker|generic` now names each filament after its product line (plain PLA, Bambu PLA Basic included, becomes Snapmaker PLA SnapSpeed; Matte stays Matte; Silk stays Silk), using the presets Snapmaker installs for the nozzle size converted to. Some of the old names didn't exist in Snapmaker Orca. The filament's id and vendor change with the name, as in Snapmaker Orca's own saves. Where Snapmaker makes no preset for a line (plain PETG, for example) the Generic one is used, and where neither exists for that nozzle size the creator's name stays; both are reported.
|
|
20
|
+
- **The Liber High Flow Hotend can be set per toolhead** (`--high-flow-toolheads 1,3`), and filaments on a high-flow toolhead now slice with their high-flow filament values (temperature, max volumetric speed up to 40, pressure advance and the rest). Before, every filament kept its standard values, so 22 mm³/s held back the high-flow speeds. Filament N prints on toolhead N; filaments 5 and up follow the toolheads only when all four are the same.
|
|
21
|
+
- **Reproducible output:** converting the same file with the same options gives byte-identical output, so checksums change only when the content does. Every entry in a converted file carries the same fixed time, so a file no longer records when it was converted.
|
|
22
|
+
- **Two-nozzle Bambu printers (H2D, H2C):** speeds and other print settings the creator changed are now carried over. These printers store such settings once per nozzle and per standard or high-flow hotend, and the old converter silently kept Snapmaker's stock value instead. Where the two nozzles disagree, the lower value is used, with a warning.
|
|
23
|
+
- **Overhang speeds** the creator changed are carried over, like their other speeds; before, they always took Snapmaker's stock value. Ones above stock can be set back with `--use-stock`.
|
|
24
|
+
- **Filament lists with stale entries** (more values than filaments, with no nozzle variants named, as in some Snapmaker Orca 2.3 saves) keep each filament's own first value, as Snapmaker Orca reads them, with one warning that lists the settings (not one per setting, which could run to dozens); before, values from different filaments were mixed. A list with too few values is reported instead of replaced silently.
|
|
25
|
+
- **An unusable layer height or a nozzle size with no U1 profile** is reported, and a layer height of 0 or below no longer picks the finest profile.
|
|
26
|
+
- **Flush volumes always fit the project's filaments,** written as Snapmaker Orca reads them. Converting a two-nozzle printer's project (H2D, H2C), or one whose flush volumes were resized, could give a file Snapmaker Orca's command line crashed on or partly ignored.
|
|
27
|
+
- **Embedded filament presets carry their own filament's id,** not the id of one of Snapmaker's stock PLA presets.
|
|
28
|
+
- **Objects are never pulled into each other** to fit a plate onto the U1's smaller bed; a plate that can't fit without that gets a warning to split it, instead of a file Snapmaker Orca refuses to slice.
|
|
29
|
+
- **A version note** in every converted file, `Metadata/any2orca.json`: the any2orca version, profile and options, so a file can be matched to a later fix and bug reports are exact. Leave it out with `--no-stamp` or `stamp: false`.
|
|
30
|
+
|
|
31
|
+
### Profiles
|
|
32
|
+
|
|
33
|
+
- Uses `any2orca-profiles` 0.1.0, the Snapmaker U1 catalog at Snapmaker Orca 2.4.0, now a package of its own.
|
|
34
|
+
|
|
35
|
+
### Breaking
|
|
36
|
+
|
|
37
|
+
- **For b2o users:** there are no API keys or quotas, and `--watch` takes its folder as its own argument (`--watch ./incoming`).
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
- **Presets:** save your own print settings from a project you tuned in Snapmaker Orca (`any2orca presets add`), convert anyone's model with them (`--preset`), and share them as a JSON file. A preset carries only what you changed from Snapmaker's stock profile.
|
|
42
|
+
- **Compare settings:** `any2orca diff a.3mf b.3mf`, `--against-stock` to see what a creator changed from Snapmaker's stock profile, or `--against-preset` to see what your preset would change. Values above stock or the U1's limits are marked; `--json` for scripts.
|
|
43
|
+
- **What changed:** `convert --explain` lists every change a conversion made, grouped by why, and `--explain-json` writes it next to the output. `--use-stock` and `--keep-higher` choose, per setting, between Snapmaker's stock value and a faster one from the file.
|
|
44
|
+
- **Paired values are explained.** In `diff` and What changed, a setting with two values (the U1's standard and Liber High Flow Hotend values, or another printer's per-nozzle ones) gets a note saying which is which, and a `layout` field in the JSON. `valueLayoutNotes()` gives the same notes for your own display.
|
|
45
|
+
- **Large projects.** Projects that unpack to up to 2 GB convert anywhere, the web app included; the command line and the library go further with `--max-unpacked` or `maxUnpackedBytes` (up to 16 GB). Above 1 GB a warning says converting takes a minute or two and a few GB of memory, and `inspect()` reports `unpackedBytes` so a UI can say so before converting. A project over the limit is refused with the `too_large` code.
|
|
46
|
+
- **A library and a Web Worker** for Node and browsers, the same engine the web app and the CLI use.
|
|
47
|
+
- **Windows, macOS and Linux.** The command line and the whole test suite run on all three. In Command Prompt and PowerShell, which leave wildcards to the program, `any2orca convert "models/*.3mf"` expands them itself (file names only, files only, at most 5,000 matches); saved presets and the config file live in `%APPDATA%\any2orca` on Windows.
|
|
48
|
+
- **Text from files is printed safely.** Conversion warnings, everything the CLI prints and its log file never carry terminal control codes or direction overrides from a file's names or values, and `plainText()` does the same for your own output. Presets files and version notes with such characters in their text are refused.
|
|
49
|
+
|
|
50
|
+
### Fixes
|
|
51
|
+
|
|
52
|
+
- **Projects with a very large mesh convert.** A single part file bigger than about 512 MB (a detailed sculpt, say) made the conversion fail with an internal error; large meshes are now read in pieces.
|
|
53
|
+
- **Sliced plate files (.gcode.3mf) are refused** with a message saying to convert the project they were sliced from. They hold G-code for the printer they were sliced for and usually no model, and a converted copy carried that G-code into a file labeled for the U1.
|
|
54
|
+
- **Stricter checks on crafted files:** a project that repeats an entry name or holds more data in an entry than it declares is refused, and models with more than 1,000 objects are refused before any work is done on them.
|
|
55
|
+
- **A setting the creator changed that can't be carried over** is now reported, with a warning, instead of being dropped silently. Filament settings, which are always carried over with the filament, no longer trigger this warning.
|
|
56
|
+
- **Safer batch and watch runs.** An output that is the input under another case or through a symlink is refused, as is `--archive-dir` on the watched folder or an input's own folder; two inputs with the same name no longer overwrite each other's output; a file that fails while it may still be copying in gets one retry. `--out-dir` is created if missing, an overwritten output says `(replaced)`, `--dry-run` names the profile, and file errors are sentences. `--json` output keeps unusual characters as JSON escapes.
|
|
57
|
+
|
|
58
|
+
## Before any2orca (as bambu2orca and b2o)
|
|
59
|
+
|
|
60
|
+
any2orca continues bambu2orca (the web app) and `@kuzuri.ao/b2o` (its CLI), whose conversion ran on a server. any2orca's first release changes some output on purpose; its "Output-affecting" list says what. Notable output-affecting changes from the earlier period, newest first, in case you have files made with the old tool:
|
|
61
|
+
|
|
62
|
+
- **2026-10-19 (b2o 0.0.12):** Per-object overrides with an empty entry, for example `inner_wall_speed` set to `50,nil` (Bambu Studio 2.8 writes these as one value per nozzle variant, even for single-nozzle printers), no longer reach the output: the first value is kept. Snapmaker Orca 2.4.0 refused to open a file containing one ("Deserializing nil into a non-nullable object"). Files made earlier that Snapmaker Orca 2.4.0 would not open can be re-converted.
|
|
63
|
+
- **2026-10-14:** Converted files use Snapmaker Orca 2.4.0's preset names (for example "0.20mm Standard @Snapmaker U1 (0.4 nozzle)"), so Snapmaker Orca 2.4.0 opens them on its own system preset. Files converted before then open in Snapmaker Orca 2.4.0 as "Project-inside presets"; re-convert them if you want them attached to the system preset.
|
|
64
|
+
- **2026-10-14:** When no profile exactly matches a file's layer height, the file keeps its own layer height instead of taking the nearest profile's.
|
|
65
|
+
- **2026-10-14:** Option for the Snapmaker Liber High Flow Hotend (all four toolheads).
|
|
66
|
+
- **2026-09:** The source file's brim setting is always kept. Before this, a source printer's default "auto" brim could become "no brim".
|
|
67
|
+
- **2026-09:** Bambu-only nozzle settings are removed, so they can't leak into U1 files.
|
|
68
|
+
- **2026-09:** Profiles synced to Snapmaker Orca 2.3.6.
|
|
69
|
+
- **2026-09:** Flush volumes are resized to the real filament count when a source file's own arrays don't match it.
|
|
70
|
+
- **2026-08:** Bambu Studio's "Painted" brim is mapped to Orca's own "painted" value instead of an unrelated Orca feature with the same internal name.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kuzuri
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
any2orca (packages/core) -- third-party data attribution
|
|
2
|
+
|
|
3
|
+
This package is MIT licensed (see LICENSE). It includes two sets of
|
|
4
|
+
reference data compiled from public sources. This file is not legal advice.
|
|
5
|
+
|
|
6
|
+
## Settings catalog (src/diff/settingsCatalog.ts)
|
|
7
|
+
|
|
8
|
+
The names, settings-page locations, types, limits and choices of Snapmaker
|
|
9
|
+
Orca's settings, used to label and group settings in comparisons, presets and
|
|
10
|
+
"What changed?". They are generated from the setting definitions in
|
|
11
|
+
Snapmaker Orca's source
|
|
12
|
+
(github.com/Snapmaker/OrcaSlicer, src/libslic3r/PrintConfig.cpp), at the
|
|
13
|
+
release named at the top of the generated file. Snapmaker Orca is
|
|
14
|
+
AGPL-3.0-or-later; the catalog records facts about its settings, not its code.
|
|
15
|
+
|
|
16
|
+
## Filament color data (src/archive/filamentColorNames.ts)
|
|
17
|
+
|
|
18
|
+
Filament color names used for display were compiled from Bambu Lab's and
|
|
19
|
+
Polymaker's own published documentation and product pages (filament names and
|
|
20
|
+
hex color codes), not copied from any single vendor's software.
|
|
21
|
+
|
|
22
|
+
## Trademarks
|
|
23
|
+
|
|
24
|
+
"Snapmaker," "OrcaSlicer," "Bambu," "Bambu Studio," "Polymaker," "Panchroma"
|
|
25
|
+
and other printer, slicer and filament names are the trademarks of their
|
|
26
|
+
respective owners, used here only to name real products accurately. any2orca
|
|
27
|
+
is an independent project and is not affiliated with, endorsed by, or
|
|
28
|
+
sponsored by any of them.
|
package/README.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
|
1
|
-
#
|
|
1
|
+
# any2orca
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Convert Bambu Studio, Creality Print and Anycubic Slicer Next `.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
|
+
|
|
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
|
+
|
|
7
|
+
## Command line
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx any2orca convert model.3mf # writes model_U1.3mf next to it
|
|
11
|
+
npx any2orca convert *.3mf --out-dir converted # also in Command Prompt and PowerShell
|
|
12
|
+
npx any2orca convert bundle.zip # a zip of several .3mf files is a batch
|
|
13
|
+
npx any2orca profiles # the profiles --profile accepts
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Useful options: `--profile <id>`, `--high-flow` or `--high-flow-toolheads 1,3` (which toolheads have the Liber High Flow Hotend), `--hardened-nozzle` (hardened steel nozzles instead of the stock stainless 0.4), `--filament-compliance generic|snapmaker`, `--dry-run`, `--watch <folder>`, `--archive-dir`, `--skip-existing`, `--profiles-dir`. Run `any2orca convert --help` for all of them. The exit code is 1 if any file failed. Full reference, including exit codes, the state file and `telemetry`: [`docs/cli.md`](../../docs/cli.md).
|
|
17
|
+
|
|
18
|
+
## Library
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
22
|
+
import { convert } from "any2orca";
|
|
23
|
+
import { bundledProfileSource } from "any2orca/node";
|
|
24
|
+
|
|
25
|
+
const { output, report } = await convert(await readFile("model.3mf"), { profiles: bundledProfileSource() });
|
|
26
|
+
await writeFile("model_U1.3mf", output);
|
|
27
|
+
console.log(report.profile.displayName, report.warnings);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
In a UI, open once and convert as often as the user changes options:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { openProject } from "any2orca";
|
|
34
|
+
|
|
35
|
+
const project = openProject(bytes);
|
|
36
|
+
const info = project.inspect(); // plates, objects and footprints, filament colors, nozzle, layer height
|
|
37
|
+
const choice = await project.matchProfile(profiles);
|
|
38
|
+
const { output, report } = await project.convert({ profiles, profileId: choice.profileId });
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Profiles come from a source you pass in; the library never fetches anything on its own:
|
|
42
|
+
|
|
43
|
+
| Source | Use |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `bundledProfileSource()` from `any2orca/node` | The installed `any2orca-profiles` package |
|
|
46
|
+
| `dirProfileSource(dir)` from `any2orca/node` | A catalog folder (newer or custom profiles) |
|
|
47
|
+
| `fetchProfileSource(url)` | A copy of `any2orca-profiles/data` served by your site |
|
|
48
|
+
| `memoryProfileSource({ index, profiles })` | Data you already have in memory |
|
|
49
|
+
| Your own `{ readIndex, readProfile }` | Anything else |
|
|
50
|
+
|
|
51
|
+
Never re-implement profile matching in a UI: use `matchProfile()` (or `pickProfile()` and `parseTierName()`), so every UI picks the same profile for the same file.
|
|
52
|
+
|
|
53
|
+
Presets (your own tuned print settings, applied to other files; see [`docs/presets.md`](../../docs/presets.md)):
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
import { extractPreset } from "any2orca";
|
|
57
|
+
|
|
58
|
+
const { preset, changes, notes } = await extractPreset(tunedBytes, { profiles }); // show changes, ask for a name
|
|
59
|
+
const { output, report } = await project.convert({ profiles, preset: { ...preset, name: "My settings" } });
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`parsePresetFile()` and `serializePresets()` read and write the `any2orca-presets` file format, with size and count limits. `report.whatChanged` records what the conversion changed, grouped by why (`formatWhatChanged()` for text, `explain: true` to add every difference; see [`docs/what-changed.md`](../../docs/what-changed.md)). `diffSettings()` compares any two sets of settings (see [`docs/compare-settings.md`](../../docs/compare-settings.md)).
|
|
63
|
+
|
|
64
|
+
## Web Worker
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
import { createConverterWorker } from "any2orca/worker";
|
|
68
|
+
import ConverterWorker from "any2orca/worker-entry?worker"; // Vite; or new Worker(new URL(...), { type: "module" })
|
|
69
|
+
|
|
70
|
+
const converter = createConverterWorker(new ConverterWorker(), { profilesUrl: "/profiles/" });
|
|
71
|
+
const { project, inspection } = await converter.open(bytes, { transfer: true });
|
|
72
|
+
const { output, report } = await project.convert({ onProgress: (stage) => console.log(stage) });
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The converter also compares settings (`converter.diff()`), and makes, checks and applies presets (`project.extractPreset()`, `converter.resolvePreset()`, `project.convert({ preset })`).
|
|
76
|
+
|
|
77
|
+
Copy `node_modules/any2orca-profiles/data/` to your site's `/profiles/` folder. The worker fetches `index.json` and only the profile files it uses.
|
|
78
|
+
|
|
79
|
+
## What leaves your machine
|
|
80
|
+
|
|
81
|
+
Your files never do. The library makes no network requests. The CLI makes at most two kinds:
|
|
82
|
+
|
|
83
|
+
| Request | Goes to | Sends | When | Turn off |
|
|
84
|
+
|---|---|---|---|---|
|
|
85
|
+
| Update check | npm registry | the package name | at most once a day, in an interactive terminal, never in CI | `NO_UPDATE_NOTIFIER=1`, `--no-update-notifier`, or `any2orca telemetry update-check off` |
|
|
86
|
+
| Usage stats | a collector you set with `ANY2ORCA_STATS_ENDPOINT` | one small event per conversion (`any2orca telemetry show` lists every field) | only if you turn it on | off unless `any2orca telemetry on`; `DO_NOT_TRACK=1` always wins |
|
|
87
|
+
|
|
88
|
+
`any2orca telemetry show` prints all of this, plus every stats event actually sent from your machine. `--dry-run-telemetry` prints the event for a file instead of sending it.
|
|
89
|
+
|
|
90
|
+
## Output stamp
|
|
91
|
+
|
|
92
|
+
Every converted file gets a small entry, `Metadata/any2orca.json`, with the any2orca version, the profile catalog version, the profile used and the options chosen. It is there so a file can be recognized later: when a bug is found and fixed, the version inside tells you whether a file came from an affected release, and bug reports get exact details. It holds no file names, paths, times or identifiers, nothing reads it back by itself, and nothing is sent anywhere. To leave it out, pass `stamp: false` to `convert()`, or `--no-stamp` on the command line. `decodeStamp()` reads it back. Details: [`docs/output-stamp.md`](../../docs/output-stamp.md).
|
|
93
|
+
|
|
94
|
+
## Limits
|
|
95
|
+
|
|
96
|
+
Files are read in memory, with limits that protect your machine from a malicious file: at most 10,000 zip entries and 2 GB unpacked in total by default (`maxUnpackedBytes` in code or `--max-unpacked` on the command line raises it, up to 16 GB; converting needs about twice the unpacked size in memory, and a project over 1 GB comes with a warning saying so), no entry over 10 MB (and no whole file) compressing more than 100:1, entry names of at most 1,024 characters and no unsafe entry paths, a main model file (`3D/3dmodel.model`) of at most 500 MB (projects saved with their meshes as separate part files have no such limit), project settings at most 2 MB and 64 levels deep, and at most 1,000 objects.
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
MIT. The profile data (`any2orca-profiles`) is AGPL-3.0-or-later, since it is derived from Snapmaker's AGPL presets; it is a separate package, loaded at runtime. [`NOTICE`](NOTICE) credits the data this package includes. any2orca is an independent project, not affiliated with, endorsed by, or sponsored by Snapmaker, Bambu Lab, OrcaSlicer or any printer, slicer or filament maker.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function adaptModelSettings(bambuXmlText: string): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
/**
|
|
3
|
+
* Orca's model_settings.config matches Bambu's schema except for two things:
|
|
4
|
+
*
|
|
5
|
+
* 1. It doesn't carry a `filament_volume_maps` metadata entry. Strip that
|
|
6
|
+
* line if present.
|
|
7
|
+
* 2. Bambu stores some per-object overrides (inner_wall_speed,
|
|
8
|
+
* sparse_infill_speed, ...) as one value per extruder variant, with `nil`
|
|
9
|
+
* for "not set", e.g. `value="50,nil"` (Standard, High Flow). Snapmaker Orca 2.4.0
|
|
10
|
+
* can't read a `nil` there and refuses the whole file ("Deserializing nil
|
|
11
|
+
* into a non-nullable object"). Orca wants a single value, and the U1 only
|
|
12
|
+
* ever prints with one nozzle at a time, so take the first entry. A first
|
|
13
|
+
* entry that is itself `nil` means no override, so the line goes.
|
|
14
|
+
*
|
|
15
|
+
* Everything else (plates, plate names, print sequence, thumbnail refs,
|
|
16
|
+
* assemble block) is left untouched.
|
|
17
|
+
*
|
|
18
|
+
* Operates on already-decoded text rather than bytes: encoding and decoding
|
|
19
|
+
* happen once, at the zip I/O boundary.
|
|
20
|
+
*/
|
|
21
|
+
const METADATA_LINE = /^(\s*<metadata\s+key="[^"]+"\s+value=")([^"]*)("\s*\/>.*)$/s;
|
|
22
|
+
// Only numbers, percentages and `nil` count as an override list, so a
|
|
23
|
+
// free-text value (an object name containing a comma, say) is never touched.
|
|
24
|
+
const NUMBER_OR_NIL = /^(?:nil|-?\d+(?:\.\d+)?%?)$/;
|
|
25
|
+
/** The line with its per-variant value list collapsed, null to drop it, or the line itself if it needs nothing. */
|
|
26
|
+
function collapseNilList(line) {
|
|
27
|
+
const match = METADATA_LINE.exec(line);
|
|
28
|
+
if (!match)
|
|
29
|
+
return line;
|
|
30
|
+
const entries = match[2].split(",");
|
|
31
|
+
if (!entries.includes("nil") || !entries.every((entry) => NUMBER_OR_NIL.test(entry.trim())))
|
|
32
|
+
return line;
|
|
33
|
+
const first = entries[0].trim();
|
|
34
|
+
return first === "nil" ? null : `${match[1]}${first}${match[3]}`;
|
|
35
|
+
}
|
|
36
|
+
export function adaptModelSettings(bambuXmlText) {
|
|
37
|
+
// Split on "\n" but re-append it to every piece except a trailing one with
|
|
38
|
+
// no newline, keeping each line's own LF or CRLF ending.
|
|
39
|
+
const parts = bambuXmlText.split("\n");
|
|
40
|
+
const lines = parts.map((part, i) => (i < parts.length - 1 ? `${part}\n` : part));
|
|
41
|
+
const adapted = [];
|
|
42
|
+
for (const line of lines) {
|
|
43
|
+
if (line.includes('key="filament_volume_maps"'))
|
|
44
|
+
continue;
|
|
45
|
+
const collapsed = collapseNilList(line);
|
|
46
|
+
if (collapsed !== null)
|
|
47
|
+
adapted.push(collapsed);
|
|
48
|
+
}
|
|
49
|
+
return adapted.join("");
|
|
50
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real product color names for Bambu Lab and Polymaker filaments, as
|
|
3
|
+
* [vendor, product line, hex, name]. Compiled from Bambu Lab's published
|
|
4
|
+
* documentation and the hex codes Polymaker publishes on its website (see
|
|
5
|
+
* NOTICE). Stored as compact tuples rather than JSON so the module loads in
|
|
6
|
+
* Node ESM, browsers and bundlers without import attributes.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FILAMENT_COLOR_ROWS: ReadonlyArray<readonly ["bambu" | "polymaker", string, string, string]>;
|