three-slicer 0.3.2 → 0.3.4
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 +134 -0
- package/README.md +6 -0
- package/data/config-schema-lean.json +1 -1
- package/data/config-schema.json +6 -34
- package/data/filaments.js +1 -1
- package/data/printers.json +1 -1
- package/data/processes.js +1 -1
- package/engine/PARAMS.md +86 -8
- package/engine/src/contour_front_gpu.js +291 -0
- package/engine/src/contour_front_shaders.js +449 -0
- package/engine/src/contour_gpu.js +367 -0
- package/engine/src/contour_gpu_shaders.js +450 -0
- package/engine/src/contour_slice.js +131 -0
- package/engine/src/settings.js +25 -13
- package/engine/src/slicer.worker.js +50 -4
- package/engine/src/slicer_core.js +0 -0
- package/engine/src/slicer_core.mt.js +0 -0
- package/engine/src/slicer_core.mt.wasm +0 -0
- package/package.json +2 -2
- package/types/data/filaments.js.d.ts +6 -1
- package/types/data/printers.json.d.ts +13 -3
- package/types/data/processes.js.d.ts +6 -1
- package/types/settings.d.ts +16 -1
- package/types/worker.d.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,139 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.4 — 2026-10-11
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- The G-code follows the printer profile for every FFF printer in the bundled catalog. This applies when the host
|
|
8
|
+
sends a printer's custom G-code; a slice without one stays on the kernel's raw path and its output is unchanged.
|
|
9
|
+
- The custom G-code bridge sets the template variables upstream's `GCode::_do_export` sets, in its order (object
|
|
10
|
+
names, the adaptive bed mesh, preset names, pre-cooling temperatures, every `print_config_def` default).
|
|
11
|
+
`CUSTOM_GCODE_ERROR`s over the catalog: 112 -> 0.
|
|
12
|
+
- Coordinates are written in the printer's frame, centred on `printable_area`: delta and round beds and origins
|
|
13
|
+
other than (0,0) included. The scene draws the real bed outline and checks a footprint against it; 3mf
|
|
14
|
+
placement, injected G-code and the prime tower use the same frame. Profiles printing off the bed centre: 128 -> 0.
|
|
15
|
+
`bedOrigin` / `bedCenter` (`three-slicer/settings`) convert a stored printer coordinate to the plate frame.
|
|
16
|
+
- First-layer and later-layer nozzle and bed temperatures follow upstream's rules, including the `curr_bed_type`
|
|
17
|
+
plate temperatures and chamber `M191`.
|
|
18
|
+
- Machine commands are formatted per firmware flavor: temperatures, pressure advance, absolute E, firmware
|
|
19
|
+
retraction, `z_offset`, the machine envelope, Klipper's velocity limits, the Machinekit postamble.
|
|
20
|
+
- Upstream's per-role speed table, the small-perimeter slowdown, and per-role acceleration and jerk within the
|
|
21
|
+
machine limits.
|
|
22
|
+
- Upstream's `CoolingBuffer`, ported verbatim, runs over each finished layer: fan curves, layer-time slowdown, the
|
|
23
|
+
overhang, bridge, interface and ironing fans. The overhang fan is decided per wall segment from its overlap with
|
|
24
|
+
the layer below (Benchy on an A1 mini: fan commands 19 -> 665, OrcaSlicer 653).
|
|
25
|
+
- `before_layer_change_gcode`, `layer_change_gcode` and `time_lapse_gcode` are expanded in print order.
|
|
26
|
+
- A tool change runs upstream's `set_extruder` sequence: `filament_end_gcode`, `change_filament_gcode` with its
|
|
27
|
+
variables, the T command when the template does not write one (`M1020` on Bambu Lab), `filament_start_gcode`
|
|
28
|
+
and pressure advance. Two-filament sweep over the 921 FFF printers: 0 errors, 0 leftover slot lines.
|
|
29
|
+
- Thumbnails in PNG and QOI where the printer asks for them, and a 512x512 `plate_N.png` in a `.gcode.3mf`.
|
|
30
|
+
`file_start_gcode` is written at the top of the file; `@PRINT_TIME_SEC@`, `@USED_FILAMENT_LENGTH@` and the M73
|
|
31
|
+
lines are filled from the estimate.
|
|
32
|
+
- `reduce_infill_retraction`: a travel that stays inside the layer's internal region is not retracted (Benchy on an
|
|
33
|
+
A1 mini: retractions 4928 -> 2726, OrcaSlicer 1586). The region is wider than upstream's because top and bottom
|
|
34
|
+
surfaces are not split from internal solid infill yet.
|
|
35
|
+
- The slice notice names profile settings the template path does not apply, instead of dropping them silently
|
|
36
|
+
(`partialSupport`, code `PROFILE_PARTIAL_SUPPORT`) — today `retract_length_toolchange`.
|
|
37
|
+
- A user preset file can inherit from an abstract printer of the catalog.
|
|
38
|
+
- `examples/octoprint`: a demo that uploads the exported G-code to an OctoPrint server through `<Viewport onExport>`.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- A finished FFF slice is previewed from the G-code it exports, start and end G-code included, so a sliced plate and
|
|
43
|
+
the same file opened again show the same layers, segments and filament (Benchy: 241 layers, 5279.3 mm on both; it
|
|
44
|
+
was 240 / 5255.5 mm before). Reading back 13 MB of G-code took 192 ms. Economy mode and resin plates stay on the
|
|
45
|
+
kernel's stream.
|
|
46
|
+
- Consecutive toolpath beads meet at a turn instead of leaving a wedge on its outside: each endpoint carries the
|
|
47
|
+
heading of the extrusion it joins (4 more bytes per segment instance). Turns past 140 degrees keep a square end.
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
- The top layer was lost: the kernel cut each layer at its top, so the top face's plane cut nothing and a 20 mm cube
|
|
52
|
+
printed 99 layers, 19.8 mm. Layers are now cut at their middle, as upstream's `generate_object_layers`, on every
|
|
53
|
+
path. A model's G-code changes in its top shells (cube 99 -> 100 layers); every layer below them is unchanged.
|
|
54
|
+
- Vector enum settings sent by the host (`overhang_fan_threshold`, `z_hop_types`, ...) were read as empty lists, so
|
|
55
|
+
the template path ran on their defaults.
|
|
56
|
+
- A C++ float literal in a schema default list (`280.f`) was extracted as two values. Six defaults were affected,
|
|
57
|
+
`flush_volumes_matrix` among them, so a template-path tool change purged nothing.
|
|
58
|
+
- The viewer shipped the previous extraction's copy of the lean schema.
|
|
59
|
+
- Opening a 3mf whose settings name no printer replaced the chosen printer with the 200 mm default and no start
|
|
60
|
+
G-code. Such a project now keeps the chosen printer.
|
|
61
|
+
- The move scrub read 0 / 0: the toolpath handle had no `setMoveRange` and no `data`.
|
|
62
|
+
|
|
63
|
+
## 0.3.3 — 2026-10-01
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
|
|
67
|
+
- The layer contours can be computed on the GPU. The viewer's slice bar has a GPU select (`gpu_acceleration`:
|
|
68
|
+
`auto`, `on`, `off`), and the worker's slice message takes `gpu: true`. `auto` uses it on the single-threaded
|
|
69
|
+
kernel only, where a 3M-facet slice went from 9.8 to 7.6 s; the threaded kernel gains nothing measurable. A GPU
|
|
70
|
+
slice's G-code differs from the CPU slice's in its vertices (same contour area), and the result's
|
|
71
|
+
`stats.contour_engine` says which engine ran.
|
|
72
|
+
- On the single-threaded kernel the GPU also cuts the mesh into layers and chains the loops (`stats.contour_front`
|
|
73
|
+
`'gpu'`; the slice card reads "Contours cut and unioned on the GPU"). The kernel hands its mesh over instead of
|
|
74
|
+
cutting every layer itself: on a 3M-facet model that part went from 419-442 ms to 34-154 ms plus 64-153 ms on the
|
|
75
|
+
GPU. A layer the GPU cannot close is cut by the kernel as before.
|
|
76
|
+
- `support_style` `tree_slim`, `tree_strong` and `tree_hybrid` reach the kernel as `tree_style`. They used to slice
|
|
77
|
+
as organic.
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
|
|
81
|
+
- The threaded kernel ships its wasm as a file, `engine/src/slicer_core.mt.wasm`, instead of inlining it in
|
|
82
|
+
`slicer_core.mt.js` (6.4 MB -> 107 KB). Every pthread worker loads the glue, and the inlined bytes cost each of
|
|
83
|
+
them about 60 MB of V8 heap; Chrome holds every isolate of a tab in one 4 GB heap region, so slicing several plates
|
|
84
|
+
at once crashed the tab ("V8 javascript OOM"; 3 workers on a 6-plate project: 4 crashes in 6 runs). With the file,
|
|
85
|
+
3 to 8 workers ran without a crash and peaked at 1.2-1.9 GB. A bundler emits the file as an asset; see
|
|
86
|
+
"Multithreaded WASM" in the README for serving it.
|
|
87
|
+
- Tree support (slim, strong, hybrid) runs four of its loops on every thread of the threaded kernel: a 1.13M-facet
|
|
88
|
+
hybrid plate went from 91 to 21 s, with the same G-code as the single-threaded kernel.
|
|
89
|
+
- Tree support unions each layer's support circles per group of overlapping circles instead of all at once. On the
|
|
90
|
+
same plate the slice went from 21.2-21.6 to 18.9-19.0 s (threaded) and from 110.3 to 98.0 s (single-threaded).
|
|
91
|
+
The support area is unchanged; its G-code vertices come out in another order (support extrusion 4113.49 ->
|
|
92
|
+
4113.50 mm, every model path unchanged).
|
|
93
|
+
- Tree support finds overhangs on every thread of the threaded kernel (it ran on one): on the same plate the slice
|
|
94
|
+
went from 18.6-18.9 to 17.6-17.7 s, with the same G-code.
|
|
95
|
+
- Tree support no longer recomputes the same offsets while it drops branches and groups overhangs (a dilation per
|
|
96
|
+
node move, a whole-layer line clip per segment, a region offset per cluster tried): on the same plate the slice
|
|
97
|
+
went from 17.1-17.3 to 15.5-15.6 s, with the same G-code.
|
|
98
|
+
- Tree support's threads no longer queue on two locks while they move branches (one over the line-cut cache, one
|
|
99
|
+
around every new node), the branch spanning trees are built in one pass per vertex and per part on threads, and the
|
|
100
|
+
layer outlines are prepared beside overhang detection instead of after it: on the same plate 15.6 -> 13.9-14.1 s,
|
|
101
|
+
then 10.2-10.3 -> 9.7-9.8 s, with the same G-code.
|
|
102
|
+
- Tree support unions each group of overlapping circles as a tree of smaller unions, split by position: draw_circles
|
|
103
|
+
4.6 -> 2.3 s on the same plate (11.6-11.8 s slice). The support area is the same; the intermediate unions round
|
|
104
|
+
their crossings once more, so the support G-code moves slightly (support extrusion 4113.50 -> 4113.56 mm, the worst
|
|
105
|
+
layer 0.27 %, every model path unchanged). Clipper2's union measured slower and is not used.
|
|
106
|
+
- Arachne walls are written by the threaded kernel's G-code writers like every other path (they were written on one
|
|
107
|
+
thread): on the same plate emit 3.2 -> 1.7 s (11.7 -> 10.2 s slice), with the same G-code, toolpaths and widths as
|
|
108
|
+
the single-threaded kernel.
|
|
109
|
+
|
|
110
|
+
- The toolpath preview culls back faces and, far from the camera, draws every 2nd or 4th layer that many layers
|
|
111
|
+
thick (raft and skirt layers and a cut layer range keep full detail). Measured on a 6-plate project with 14.6M
|
|
112
|
+
segments: 67.8 -> 34.8 ms per frame, the overview 27.6 -> 9.6 ms.
|
|
113
|
+
- Switching plates no longer recolours every plate or builds the focused plate's G-code Blob (332-574 ms -> no task
|
|
114
|
+
over 50 ms). "Export G-code" builds its plain `.gcode` on click and hands it to the host's `onExport` like the other
|
|
115
|
+
exports; it used to be a prefilled download link that bypassed `onExport`.
|
|
116
|
+
- A 3mf loads with each part inflated by `DecompressionStream`, read from its bytes and baked (normals, bounds) in
|
|
117
|
+
the parse worker, with the build items spread over copies of that worker: 1338-1352 -> 367-372 ms on a 52 MB
|
|
118
|
+
project, with the same meshes. zip64 and encrypted archives keep the previous reader.
|
|
119
|
+
|
|
120
|
+
### Fixed
|
|
121
|
+
|
|
122
|
+
- A click on a plate in Preview did nothing; it now selects the plate.
|
|
123
|
+
- Tree support could lose a whole support island's paths on a layer: reordering a layer's paths dropped any group of
|
|
124
|
+
paths whose first or last member was empty, with every path in it (a 3M-facet tree-slim model lost 64.6 mm of
|
|
125
|
+
support paths over three layers). Only the empty members are dropped now. Models where it did not happen slice to
|
|
126
|
+
the same G-code.
|
|
127
|
+
- Tree slim, strong and hybrid crashed the kernel on any model.
|
|
128
|
+
- The same tree slim or strong input could slice to different G-code from run to run (a tie in the minimum spanning
|
|
129
|
+
tree was broken by memory address).
|
|
130
|
+
- A Bambu Lab X2D or H2D project failed every slice with `CUSTOM_GCODE_ERROR`: the start G-code reads
|
|
131
|
+
`first_filaments` and `first_non_support_filaments` per physical nozzle, which were missing or not mapped.
|
|
132
|
+
- A plate whose objects are all on one filament other than the first printed with filament 1: the start G-code
|
|
133
|
+
loaded it (`M620 S0A` on a Bambu Lab printer) and its temperature, flow and retraction were used. The kernel
|
|
134
|
+
takes `single_tool`, which the viewer sends for such a plate, and prints with that filament's values; the
|
|
135
|
+
start and end G-code see it as `initial_extruder` / `current_extruder` and the footer reports its use.
|
|
136
|
+
|
|
3
137
|
## 0.3.2 — 2026-09-21
|
|
4
138
|
|
|
5
139
|
### Added
|
package/README.md
CHANGED
|
@@ -679,6 +679,11 @@ Cross-Origin-Embedder-Policy: require-corp
|
|
|
679
679
|
|
|
680
680
|
Without those headers, the engine falls back to the single-threaded kernel.
|
|
681
681
|
|
|
682
|
+
The multithreaded kernel's wasm is a file beside its glue, `engine/src/slicer_core.mt.wasm`, reached through
|
|
683
|
+
`new URL('slicer_core.mt.wasm', import.meta.url)`; Vite and webpack emit it as an asset. Serve it as
|
|
684
|
+
`application/wasm`, and from another origin (a CDN) with `Cross-Origin-Resource-Policy: cross-origin`, or the
|
|
685
|
+
cross-origin isolated page cannot load it. The single-threaded kernel still inlines its wasm.
|
|
686
|
+
|
|
682
687
|
## Data Files
|
|
683
688
|
|
|
684
689
|
The package includes extracted OrcaSlicer metadata for custom interfaces:
|
|
@@ -737,6 +742,7 @@ the layout by hand.
|
|
|
737
742
|
| `printerSettings(name)` | Settings a vendor machine profile applies |
|
|
738
743
|
| `printerKeys` | Every key a printer profile can set — clear these before applying another |
|
|
739
744
|
| `printerDefaultPreset(name)` | The vendor's recommended process preset for that printer |
|
|
745
|
+
| `printerDefaultBedType(name)` | The bed type the printer's model defaults to — the viewer writes it to `curr_bed_type` on a pick |
|
|
740
746
|
| `machineLimitKeys` | The schema keys the kernel's machine limits are read from |
|
|
741
747
|
| `processPresets()` | Lazy facade over the print (process) preset catalog |
|
|
742
748
|
| `filamentPresets()` | Lazy facade over the material preset catalog |
|