three-slicer 0.2.2 → 0.2.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 +97 -0
- package/README.md +143 -19
- package/components/README.md +6 -3
- package/data/README.md +10 -9
- package/engine/PARAMS.md +248 -0
- package/engine/README.md +18 -264
- package/engine/examples/headless.mjs +4 -0
- package/engine/index.d.ts +26 -0
- package/engine/index.js +24 -4
- package/engine/src/client.js +17 -2
- package/engine/src/kernel_setting_keys.js +132 -0
- package/engine/src/settings.js +36 -2
- package/engine/src/slicer.worker.js +70 -6
- package/engine/src/slicer_core.js +0 -0
- package/engine/src/slicer_core.mt.js +0 -0
- package/engine/src/throughput.js +53 -0
- package/engine/src/warnings.js +23 -0
- package/package.json +1 -1
- package/types/.omc/state/sessions/02e5ddf5-4378-46e1-8fca-e90412c30804/pre-tool-advisory-throttle.json +10 -0
- package/types/settings.d.ts +20 -0
- package/types/viewer.d.ts +50 -1
- package/types/worker.d.ts +32 -3
- package/viewer/README.md +112 -16
- package/viewer/dist/Viewport.js +3772 -3295
- package/viewer/styles.css +18 -1
package/engine/PARAMS.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# three-slicer — kernel parameter reference
|
|
2
|
+
|
|
3
|
+
The FFF kernel's accepted parameter set, generated from the kernel's own reader (`params.cpp`) — see
|
|
4
|
+
[README.md](README.md) for install/usage and how these params are produced from an OrcaSlicer settings map.
|
|
5
|
+
|
|
6
|
+
Generated from the kernel's own reader (`params.cpp`) — it is the definition of the accepted key set, so this table
|
|
7
|
+
cannot drift from what `slice()` actually honours. Regenerate with `node types/gen_kernel_params.mjs`.
|
|
8
|
+
|
|
9
|
+
<!-- KERNEL-PARAMS:BEGIN — generated by types/gen_kernel_params.mjs, do not edit by hand -->
|
|
10
|
+
|
|
11
|
+
The kernel accepts **159 parameters**. `deriveKernelParams()` produces 131 of them from the
|
|
12
|
+
OrcaSlicer settings map; the remaining 28 have no schema key behind them and can only be set by writing
|
|
13
|
+
the params object directly — those rows show `—` in the *From setting* column.
|
|
14
|
+
|
|
15
|
+
A parameter left out of the object keeps the default listed here, so sending a partial object is normal and is
|
|
16
|
+
what `deriveKernelParams()` itself does.
|
|
17
|
+
|
|
18
|
+
*From setting* names the schema key the value is read from, which is often **not** the same name and not the
|
|
19
|
+
same unit — `first_layer_height` comes from `initial_layer_print_height`, and `infill_density` is
|
|
20
|
+
`sparse_infill_density` divided by 100 (a settings map holding `20` produces `0.2` here).
|
|
21
|
+
|
|
22
|
+
### Geometry and walls
|
|
23
|
+
|
|
24
|
+
| Kernel param | Type | Default | From setting | Notes |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
| `auto_center` | `boolean` | `false` | — | stage 28: true = realign the combined bbox to the origin (stage-3 legacy). false (default) = trust the viewer coordinates (no realignment, only Z seating) -> the toolpath overlaps the on-screen model exactly. Upstream = only the plate origin offset (GCode.cpp:932). |
|
|
27
|
+
| `first_layer_height` | `number` | `0.2` | `initial_layer_print_height` | |
|
|
28
|
+
| `gcode_resolution` | `number` | `0.01` | `resolution` | resolution (mm): path simplification tolerance. Upstream PrintConfig default 0.01 |
|
|
29
|
+
| `initial_layer_line_width` | `number` | `0` | `initial_layer_line_width` | |
|
|
30
|
+
| `inner_wall_line_width` | `number` | `0` | `inner_wall_line_width` | |
|
|
31
|
+
| `internal_solid_infill_line_width` | `number` | `0` | `internal_solid_infill_line_width` | |
|
|
32
|
+
| `layer_height` | `number` | `0.2` | `layer_height` | |
|
|
33
|
+
| `line_width` | `number` | `0.42` | `line_width` | |
|
|
34
|
+
| `outer_wall_line_width` | `number` | `0` | `outer_wall_line_width` | |
|
|
35
|
+
| `sparse_infill_line_width` | `number` | `0` | `sparse_infill_line_width` | |
|
|
36
|
+
| `spiral_mode` | `boolean` | `false` | `spiral_mode` | spiral_mode (vase) |
|
|
37
|
+
| `support_line_width` | `number` | `0.0` | `support_line_width` | support_line_width (0=auto; the real tree support extrusion width) |
|
|
38
|
+
| `top_surface_line_width` | `number` | `0` | `top_surface_line_width` | |
|
|
39
|
+
| `wall_generator` | `string` | `'classic'` | `wall_generator` | classic\|arachne (arachne = the real ported WallToolPaths) |
|
|
40
|
+
| `wall_loops` | `number` | `2` | `wall_loops` | |
|
|
41
|
+
|
|
42
|
+
### Infill
|
|
43
|
+
|
|
44
|
+
| Kernel param | Type | Default | From setting | Notes |
|
|
45
|
+
| --- | --- | --- | --- | --- |
|
|
46
|
+
| `bottom_shell_layers` | `number` | `3` | `bottom_shell_layers` | top_shell_layers/bottom_shell_layers |
|
|
47
|
+
| `infill_angle` | `number` | `45.0` | `infill_direction` | infill_direction |
|
|
48
|
+
| `infill_density` | `number` | `0.15` | `sparse_infill_density` | |
|
|
49
|
+
| `ironing_flow` | `number` | `10.0` | `ironing_flow` | ironing flow (%) |
|
|
50
|
+
| `ironing_spacing` | `number` | `0.1` | `ironing_spacing` | ironing line spacing (mm) |
|
|
51
|
+
| `ironing_speed` | `number` | `30.0` | `ironing_speed` | ironing speed (mm/s) |
|
|
52
|
+
| `ironing_type` | `string` | `'none'` | `ironing_type` | none\|top\|topmost\|solid (the top family = on) |
|
|
53
|
+
| `sparse_infill_filament_id` | `number` | `0` | `sparse_infill_filament_id` | |
|
|
54
|
+
| `sparse_infill_pattern` | `string` | `'rectilinear'` | `sparse_infill_pattern` | rectilinear\|grid\|triangles\|zigzag\|gyroid |
|
|
55
|
+
| `top_shell_layers` | `number` | `4` | `top_shell_layers` | top_shell_layers/bottom_shell_layers |
|
|
56
|
+
|
|
57
|
+
### Speeds, flow and temperature
|
|
58
|
+
|
|
59
|
+
| Kernel param | Type | Default | From setting | Notes |
|
|
60
|
+
| --- | --- | --- | --- | --- |
|
|
61
|
+
| `bed_temp` | `number` | `60` | `hot_plate_temp` | |
|
|
62
|
+
| `bridge_speed` | `number` | `25.0` | `bridge_speed` | bridge_speed[0] (slowdown for unsupported bottoms) |
|
|
63
|
+
| `close_fan_the_first_x_layers` | `number` | `1` | `close_fan_the_first_x_layers` | close_fan_the_first_x_layers |
|
|
64
|
+
| `enable_pressure_advance` | `boolean` | `false` | `enable_pressure_advance` | enable_pressure_advance[0] |
|
|
65
|
+
| `fan_speed` | `number` | `100.0` | `fan_max_speed` | fan_speed (%) |
|
|
66
|
+
| `filament_diameter` | `number` | `1.75` | `filament_diameter` | |
|
|
67
|
+
| `first_layer_speed` | `number` | `20` | `initial_layer_speed` | |
|
|
68
|
+
| `flow_ratio` | `number` | `1.0` | `filament_flow_ratio` | |
|
|
69
|
+
| `full_fan_speed_layer` | `number` | `3` | `full_fan_speed_layer` | full_fan_speed_layer |
|
|
70
|
+
| `machine_accel_print` | `number` | `5000` | `default_acceleration` | mm/s² |
|
|
71
|
+
| `machine_accel_retract` | `number` | `5000` | `machine_max_acceleration_retracting` | mm/s² |
|
|
72
|
+
| `machine_accel_travel` | `number` | `5000` | `travel_acceleration` | mm/s² |
|
|
73
|
+
| `machine_jerk_e` | `number` | `2.5` | `machine_max_jerk_e` | mm/s |
|
|
74
|
+
| `machine_jerk_xy` | `number` | `9.0` | `machine_max_jerk_x` | mm/s |
|
|
75
|
+
| `machine_jerk_z` | `number` | `0.4` | `machine_max_jerk_z` | mm/s |
|
|
76
|
+
| `machine_max_accel_e` | `number` | `5000` | `machine_max_acceleration_e` | mm/s² (machine_max_acceleration_*) — per-axis ceiling, distinct from the accel_* feedrates above |
|
|
77
|
+
| `machine_max_accel_xy` | `number` | `5000` | `machine_max_acceleration_x` | mm/s² (machine_max_acceleration_*) — per-axis ceiling, distinct from the accel_* feedrates above |
|
|
78
|
+
| `machine_max_accel_z` | `number` | `500` | `machine_max_acceleration_z` | mm/s² (machine_max_acceleration_*) — per-axis ceiling, distinct from the accel_* feedrates above |
|
|
79
|
+
| `machine_max_speed_e` | `number` | `30` | `machine_max_speed_e` | mm/s |
|
|
80
|
+
| `machine_max_speed_xy` | `number` | `500` | `machine_max_speed_x` | mm/s |
|
|
81
|
+
| `machine_max_speed_z` | `number` | `12` | `machine_max_speed_z` | mm/s |
|
|
82
|
+
| `max_volumetric_extrusion_rate_slope` | `number` | `0.0` | `max_volumetric_extrusion_rate_slope` | PE-lite flow change rate limit (mm³/s², 0=off) |
|
|
83
|
+
| `nozzle_diameter` | `number` | `0.4` | `nozzle_diameter` | |
|
|
84
|
+
| `nozzle_temp` | `number` | `210` | `nozzle_temperature` | |
|
|
85
|
+
| `pressure_advance` | `number` | `0.02` | `pressure_advance` | pressure_advance[0] |
|
|
86
|
+
| `print_speed` | `number` | `60` | `outer_wall_speed` | |
|
|
87
|
+
| `slow_down_layer_time` | `number` | `8.0` | `slow_down_layer_time` | slow_down_layer_time (s) |
|
|
88
|
+
| `travel_speed` | `number` | `150` | `travel_speed` | |
|
|
89
|
+
|
|
90
|
+
### Retraction and seams
|
|
91
|
+
|
|
92
|
+
| Kernel param | Type | Default | From setting | Notes |
|
|
93
|
+
| --- | --- | --- | --- | --- |
|
|
94
|
+
| `retract_length` | `number` | `0.8` | `filament_retraction_length`, `retraction_length` | retraction_length/speed[0], z_hop[0] |
|
|
95
|
+
| `retract_speed` | `number` | `30.0` | `filament_retraction_speed`, `retraction_speed` | retraction_length/speed[0], z_hop[0] |
|
|
96
|
+
| `retraction_minimum_travel` | `number` | `2.0` | `filament_retraction_minimum_travel`, `retraction_minimum_travel` | retraction_minimum_travel (mm): minimum travel that triggers a retraction |
|
|
97
|
+
| `scarf_length` | `number` | `10.0` | — | length of the scarf z/flow ramp (mm) |
|
|
98
|
+
| `seam_position` | `string` | `'back'` | `seam_position` | nearest\|aligned\|back\|random |
|
|
99
|
+
| `seam_slope_type` | `string` | `'none'` | `seam_slope_type` | none\|external\|all -> scarf seam (external/all = on) |
|
|
100
|
+
| `z_hop` | `number` | `0.4` | `filament_z_hop`, `z_hop` | retraction_length/speed[0], z_hop[0] |
|
|
101
|
+
|
|
102
|
+
### Adhesion (skirt, brim, raft)
|
|
103
|
+
|
|
104
|
+
| Kernel param | Type | Default | From setting | Notes |
|
|
105
|
+
| --- | --- | --- | --- | --- |
|
|
106
|
+
| `brim_object_gap` | `number` | `0.0` | `brim_object_gap` | brim_object_gap (mm): gap between brim and object |
|
|
107
|
+
| `brim_width` | `number` | `0.0` | `brim_width` | skirt_distance / brim_width |
|
|
108
|
+
| `raft_contact_distance` | `number` | `0.1` | `raft_contact_distance` | raft_contact_distance (mm) |
|
|
109
|
+
| `raft_expansion` | `number` | `1.5` | `raft_expansion` | raft_expansion (mm). Upstream default 1.5 (previously hardcoded to 3.0) |
|
|
110
|
+
| `raft_first_layer_height` | `number` | `0.30` | — | raft first layer height (mm) |
|
|
111
|
+
| `raft_layers` | `number` | `0` | `raft_layers` | raft_layers |
|
|
112
|
+
| `skirt_distance` | `number` | `2.0` | `skirt_distance` | skirt_distance / brim_width |
|
|
113
|
+
| `skirt_height` | `number` | `1` | `skirt_height` | skirt_height: how many layers the skirt is drawn on |
|
|
114
|
+
| `skirt_loops` | `number` | `1` | `skirt_loops` | skirt_loops |
|
|
115
|
+
|
|
116
|
+
### Support
|
|
117
|
+
|
|
118
|
+
| Kernel param | Type | Default | From setting | Notes |
|
|
119
|
+
| --- | --- | --- | --- | --- |
|
|
120
|
+
| `bridge_no_support` | `boolean` | `false` | `bridge_no_support` | bridge_no_support: no support under bridge regions |
|
|
121
|
+
| `enable_support` | `boolean` | `false` | `enable_support` | enable_support |
|
|
122
|
+
| `support_angle` | `number` | `0.0` | `support_angle` | support_angle: base angle of the support body (°). Upstream SupportParameters::base_angle |
|
|
123
|
+
| `support_auto` | `boolean` | `true` | — | stage 20: true = automatic overhang detection, false = manual (painted enforcers only) |
|
|
124
|
+
| `support_base_pattern` | `string` | `'default'` | `support_base_pattern` | support_base_pattern: default\|rectilinear\|rectilinear-grid\|honeycomb\|... |
|
|
125
|
+
| `support_base_pattern_spacing` | `number` | `2.5` | `support_base_pattern_spacing` | support_base_pattern_spacing (mm). Determines spacing together with density |
|
|
126
|
+
| `support_bottom_z_distance` | `number` | `0.2` | `support_bottom_z_distance` | stage 32: z gap under support resting on a model top surface (default 0.2 = equivalent to today's 1 layer -> default behavior and golden unchanged) |
|
|
127
|
+
| `support_density` | `number` | `0.15` | — | density of the support body |
|
|
128
|
+
| `support_expansion` | `number` | `0.0` | `support_expansion` | support_expansion (mm): expands the overhang region |
|
|
129
|
+
| `support_filament` | `number` | `0` | `support_filament` | filament for the support base (and, upstream, the raft) |
|
|
130
|
+
| `support_grid_snap` | `boolean` | `true` | — | equivalent of the upstream SupportGridPattern (default behavior of the grid style) |
|
|
131
|
+
| `support_interface_bottom_layers` | `number` | `0` | `support_interface_bottom_layers` | support_interface_bottom_layers (0 = none) |
|
|
132
|
+
| `support_interface_filament` | `number` | `0` | `support_interface_filament` | filament for the support interface |
|
|
133
|
+
| `support_interface_pattern` | `string` | `'auto'` | `support_interface_pattern` | support_interface_pattern: auto\|rectilinear\|concentric\|rectilinear_interlaced\|grid |
|
|
134
|
+
| `support_interface_spacing` | `number` | `0.5` | `support_interface_spacing` | support_interface_spacing (mm, 0=solid). Upstream default 0.5 |
|
|
135
|
+
| `support_interface_top_layers` | `number` | `2` | `support_interface_top_layers` | support_interface_top_layers |
|
|
136
|
+
| `support_object_first_layer_gap` | `number` | `0.2` | `support_object_first_layer_gap` | support_object_first_layer_gap (mm) |
|
|
137
|
+
| `support_on_build_plate_only` | `boolean` | `false` | `support_on_build_plate_only` | support_on_build_plate_only: only support reaching the bed |
|
|
138
|
+
| `support_overhang_min_area` | `number` | `0.0` | — | minimum overhang area (mm², 0 = auto w²). Replaces the morphological opening filter |
|
|
139
|
+
| `support_remove_small_overhang` | `boolean` | `true` | `support_remove_small_overhang` | support_remove_small_overhang (upstream default true) |
|
|
140
|
+
| `support_style` | `string` | `'grid'` | `support_style`, `support_type` | grid\|tree_lite |
|
|
141
|
+
| `support_threshold_angle` | `number` | `30.0` | `support_threshold_angle` | support_threshold_angle |
|
|
142
|
+
| `support_threshold_overlap` | `number` | `0.5` | `support_threshold_overlap` | support_threshold_overlap: the overlap criterion when θ=0 (as a fraction of extrusion width) |
|
|
143
|
+
| `support_top_z_distance` | `number` | `0.2` | `support_top_z_distance` | support_top_z_distance |
|
|
144
|
+
| `support_xy_distance` | `number` | `0.35` | `support_object_xy_distance` | support_object_xy_distance |
|
|
145
|
+
| `tree_lite_min_radius` | `number` | `1.5` | — | tree_lite taper constants (our own approximation — no matching upstream key) |
|
|
146
|
+
| `tree_lite_shrink` | `number` | `0.5` | — | tree_lite taper constants (our own approximation — no matching upstream key) |
|
|
147
|
+
| `tree_style` | `string` | `'organic'` | — | organic\|slim\|strong\|hybrid (upstream support_style smsTree*) |
|
|
148
|
+
| `tree_support_angle_slow` | `number` | `25.0` | `tree_support_angle_slow` | tree_support_angle_slow (deg) |
|
|
149
|
+
| `tree_support_branch_angle` | `number` | `40.0` | `tree_support_branch_angle` | fallback spelling — `tree_support_branch_angle_organic` wins when both are sent |
|
|
150
|
+
| `tree_support_branch_angle_organic` | `number` | `40.0` | `tree_support_branch_angle_organic` | tree_support_branch_angle_organic (deg) |
|
|
151
|
+
| `tree_support_branch_diameter` | `number` | `2.0` | `tree_support_branch_diameter` | fallback spelling — `tree_support_branch_diameter_organic` wins when both are sent |
|
|
152
|
+
| `tree_support_branch_diameter_angle` | `number` | `5.0` | `tree_support_branch_diameter_angle` | tree_support_branch_diameter_angle (deg) |
|
|
153
|
+
| `tree_support_branch_diameter_organic` | `number` | `2.0` | `tree_support_branch_diameter_organic` | tree_support_branch_diameter_organic (mm) |
|
|
154
|
+
| `tree_support_branch_distance` | `number` | `1.0` | `tree_support_branch_distance` | fallback spelling — `tree_support_branch_distance_organic` wins when both are sent |
|
|
155
|
+
| `tree_support_branch_distance_organic` | `number` | `1.0` | `tree_support_branch_distance_organic` | tree_support_branch_distance_organic (mm) |
|
|
156
|
+
| `tree_support_tip_diameter` | `number` | `0.8` | `tree_support_tip_diameter` | tree_support_tip_diameter (mm) |
|
|
157
|
+
| `tree_support_top_rate` | `number` | `30.0` | `tree_support_top_rate` | tree_support_top_rate (%) |
|
|
158
|
+
| `tree_support_wall_count` | `number` | `0` | `tree_support_wall_count` | tree_support_wall_count (organic applies max(1,·) internally) |
|
|
159
|
+
|
|
160
|
+
### Multi-material and prime tower
|
|
161
|
+
|
|
162
|
+
| Kernel param | Type | Default | From setting | Notes |
|
|
163
|
+
| --- | --- | --- | --- | --- |
|
|
164
|
+
| `bottom_surface_filament_id` | `number` | `0` | `bottom_surface_filament_id` | |
|
|
165
|
+
| `enable_prime_tower` | `boolean` | `true` | `enable_prime_tower` | |
|
|
166
|
+
| `filament_cost` | `number[]` | `[]` | `filament_cost` | currency per kg, per filament |
|
|
167
|
+
| `filament_density` | `number[]` | `[]` | `filament_density` | g/cm3, per filament |
|
|
168
|
+
| `filament_map` | `number[]` | `[]` | `filament_map` | |
|
|
169
|
+
| `filament_settings_id` | `vector<std::string>` | `[]` | `filament_settings_id` | |
|
|
170
|
+
| `filament_type` | `vector<std::string>` | `[]` | `filament_type` | |
|
|
171
|
+
| `inner_wall_filament_id` | `number` | `0` | `inner_wall_filament_id` | |
|
|
172
|
+
| `internal_solid_filament_id` | `number` | `0` | `internal_solid_filament_id` | |
|
|
173
|
+
| `outer_wall_filament_id` | `number` | `0` | `outer_wall_filament_id` | |
|
|
174
|
+
| `top_surface_filament_id` | `number` | `0` | `top_surface_filament_id` | |
|
|
175
|
+
| `wipe_tower_real` | `boolean` | `false` | — | stage 12: use the real WipeTower.generate() on MM changes instead of the stage-6 square ring |
|
|
176
|
+
|
|
177
|
+
### Bed and machine G-code
|
|
178
|
+
|
|
179
|
+
| Kernel param | Type | Default | From setting | Notes |
|
|
180
|
+
| --- | --- | --- | --- | --- |
|
|
181
|
+
| `bed_depth` | `number` | `256.0` | `printable_area` | bed size (offset = bed/2) |
|
|
182
|
+
| `bed_height` | `number` | `0.0` | `printable_height` | printable_height (mm). 0 = no ceiling (backwards compatible) |
|
|
183
|
+
| `bed_width` | `number` | `256.0` | `printable_area` | bed size (offset = bed/2) |
|
|
184
|
+
| `enable_arc_fitting` | `boolean` | `false` | `enable_arc_fitting` | enable_arc_fitting |
|
|
185
|
+
| `machine_end_gcode` | `string` | — | `machine_end_gcode` | printer profile custom G-code. Empty = the mini-kernel's own preamble/footer only |
|
|
186
|
+
| `machine_start_gcode` | `string` | — | `machine_start_gcode` | printer profile custom G-code. Empty = the mini-kernel's own preamble/footer only |
|
|
187
|
+
| `printable_height` | `number` | `250.0` | `printable_height` | printable_height (mm) — the tree BuildVolume height |
|
|
188
|
+
|
|
189
|
+
### Engine, streaming and diagnostics
|
|
190
|
+
|
|
191
|
+
| Kernel param | Type | Default | From setting | Notes |
|
|
192
|
+
| --- | --- | --- | --- | --- |
|
|
193
|
+
| `arachne_dump` | `boolean` | `false` | — | temporary diagnostic: dump the PASS1 arachne input polygons to stderr |
|
|
194
|
+
| `economy` | `boolean` | `false` | — | |
|
|
195
|
+
| `emit_pe_tags` | `boolean` | `false` | — | emit PE tags on extrusion runs (enabled automatically when the real PE is used). Default false (backwards compatible) |
|
|
196
|
+
| `extruder_count` | `number` | `1` | — | multi-material: how many extruders are used (1\|2) |
|
|
197
|
+
| `extruder_filament_diameter` | `number[]` | `[]` | `filament_diameter` | |
|
|
198
|
+
| `extruder_flow_ratio` | `number[]` | `[]` | `filament_flow_ratio` | |
|
|
199
|
+
| `extruder_nozzle_temp` | `number[]` | `[]` | `nozzle_temperature` | |
|
|
200
|
+
| `extruder_retract_length` | `?` | `[]` | `filament_retraction_length` | undefined |
|
|
201
|
+
| `extruder_retract_speed` | `?` | `[]` | `filament_retraction_speed` | undefined |
|
|
202
|
+
| `extruder_z_hop` | `?` | `[]` | `filament_z_hop` | undefined |
|
|
203
|
+
| `extrusion_rate_slope_segment_length` | `number` | `1.0` | — | segment split length for the real PE (mm) |
|
|
204
|
+
| `flush_into_infill` | `boolean` | `false` | `flush_into_infill` | |
|
|
205
|
+
| `flush_multiplier` | `number` | `1.0` | `flush_multiplier` | upstream scales the whole table by this |
|
|
206
|
+
| `flush_volumes_matrix` | `number[]` | `[]` | `flush_volumes_matrix` | |
|
|
207
|
+
| `gcode_config_block` | `boolean` | `false` | — | ; CONFIG_BLOCK_START … the parameters this slice ran with … END |
|
|
208
|
+
| `gcode_stats_block` | `boolean` | `false` | — | ; filament used [mm]/[cm3]/[g], cost, total filament change |
|
|
209
|
+
| `independent_support_layer_height` | `boolean` | `false` | `independent_support_layer_height` | false by default because of the kernel z grid constraint (gap quantized to layers) |
|
|
210
|
+
| `keep_stages` | `boolean` | `false` | — | keep the stages cached after slicing (skips the early release — a memory trade-off) |
|
|
211
|
+
| `mm_group_split` | `number` | `0` | — | triangle group boundary index ([0,split)=T0, [split,N)=T1) |
|
|
212
|
+
| `mm_group_splits` | `number[]` | `[]` | — | |
|
|
213
|
+
| `mm_group_tools` | `number[]` | `[]` | — | |
|
|
214
|
+
| `pe_external_perimeter_only` | `boolean` | `false` | — | real PE: smooth outer walls only |
|
|
215
|
+
| `pe_lite` | `boolean` | `true` | — | true = the effective PE-lite (default), false = the ported real PE (tagged g-code) |
|
|
216
|
+
| `pe_strip_tags` | `boolean` | `true` | — | strip the tags from the final output after real PE post-processing |
|
|
217
|
+
| `prime_tower_ring_size` | `number` | `15.0` | — | side length of the fallback square ring (mm) |
|
|
218
|
+
| `prime_tower_width` | `number` | `30.0` | `prime_tower_width` | width of the real WipeTower (mm). Separate from the square ring width (15). |
|
|
219
|
+
| `prime_tower_x` | `number` | `10.0` | `wipe_tower_x` | |
|
|
220
|
+
| `prime_tower_y` | `number` | `10.0` | `wipe_tower_y` | |
|
|
221
|
+
| `prime_volume` | `number` | `0.0` | `prime_volume` | extra volume primed on every change, on top of the pair's |
|
|
222
|
+
| `reduce_crossing_wall` | `boolean` | `false` | `reduce_crossing_wall` | wall-avoiding travel |
|
|
223
|
+
| `reuse_stages` | `number` | `0` | — | |
|
|
224
|
+
| `time_engine` | `string` | `'full'` | — | |
|
|
225
|
+
|
|
226
|
+
<!-- KERNEL-PARAMS:END -->
|
|
227
|
+
|
|
228
|
+
## The parameters no setting reaches
|
|
229
|
+
|
|
230
|
+
A `—` in *From setting* means there is no OrcaSlicer option behind that parameter, so it exists only if you put it
|
|
231
|
+
in the params object yourself. They are not one kind of thing, and the difference matters before you reach for one:
|
|
232
|
+
|
|
233
|
+
- **Host runtime flags** — `economy`, `keep_stages`, `reuse_stages`, `time_engine`, `wipe_tower_real`,
|
|
234
|
+
`gcode_stats_block`, `gcode_config_block`. Decisions the *caller* makes about a particular run, not properties of
|
|
235
|
+
the print. `economy` is the last rung of an out-of-memory retry: it streams G-code and skips the preview
|
|
236
|
+
toolpaths and the time estimate, so a model that cannot finish any other way still finishes.
|
|
237
|
+
- **Values the viewer computes** — `extruder_count`, `mm_group_split`, `mm_group_splits`, `mm_group_tools`,
|
|
238
|
+
`auto_center`. These come from the scene (how many extruders are loaded, which triangle ranges belong to which
|
|
239
|
+
tool), so there is nothing for a settings map to hold. `<Viewport/>` fills them in at slice time.
|
|
240
|
+
- **Kernel-only tuning** — `support_density`, `support_auto`, `support_grid_snap`, `support_overhang_min_area`,
|
|
241
|
+
`tree_style`, `tree_lite_shrink`, `tree_lite_min_radius`, `scarf_length`, `prime_tower_ring_size`,
|
|
242
|
+
`raft_first_layer_height`, `extrusion_rate_slope_segment_length`. Real knobs with no upstream option of the same
|
|
243
|
+
name — some are this kernel's own approximations (the `tree_lite_*` taper), others are upstream behaviour that
|
|
244
|
+
upstream never exposed as a setting.
|
|
245
|
+
- **Diagnostics** — `arachne_dump`, `pe_lite`, `pe_strip_tags`, `pe_external_perimeter_only`, `emit_pe_tags`. Left
|
|
246
|
+
at their defaults unless you are working on the kernel itself. `pe_lite` in particular defaults to `true` because
|
|
247
|
+
the real pressure equalizer only acts on G-code carrying OrcaSlicer's `;_EXTRUDE_SET_SPEED` tags, which this
|
|
248
|
+
kernel emits only when asked.
|
package/engine/README.md
CHANGED
|
@@ -17,7 +17,7 @@ npm i three-slicer
|
|
|
17
17
|
```js
|
|
18
18
|
import { createSlicer } from 'three-slicer'
|
|
19
19
|
|
|
20
|
-
const slicer = await createSlicer() // loads the WASM kernel (~
|
|
20
|
+
const slicer = await createSlicer() // loads the WASM kernel (embedded in the ~4.8 MB JS glue)
|
|
21
21
|
|
|
22
22
|
// Batch: full result at once
|
|
23
23
|
const r = slicer.slice(stlArrayBuffer, { layer_height: 0.2, wall_loops: 2 })
|
|
@@ -31,288 +31,45 @@ slicer.slice(stlArrayBuffer, params, {
|
|
|
31
31
|
slicer.dispose()
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Off-main-thread (browser): `new Worker(engineWorkerURL(), { type: 'module' })` — the worker speaks a streaming protocol (`{type: 'layer' | 'done' | 'error' | 'progress'}`). Subpath `three-slicer/worker` exposes the worker entry for bundler-specific setups.
|
|
34
|
+
Off-main-thread (browser): `new Worker(engineWorkerURL(), { type: 'module' })` — the worker speaks a streaming protocol (`{type: 'layer' | 'done' | 'error' | 'progress'}`). Subpath `three-slicer/worker` exposes the worker entry for bundler-specific setups, and `three-slicer/client` wraps the protocol in promises (`createSlicerClient()` — `warmup()`, `slice()`, `sliceSla()`, `cancel()`; cancellation needs the multithreaded kernel, i.e. a cross-origin-isolated page).
|
|
35
|
+
|
|
36
|
+
The handle also carries `sliceSla(stl, slaParams)` for the resin path (see [SLA parameters](#sla-parameters)) and the painting surface `paintPrepare` / `paint` / `paintClear` / `overlay`.
|
|
35
37
|
|
|
36
38
|
## Parameters
|
|
37
39
|
|
|
38
40
|
Two levels — use whichever fits:
|
|
39
41
|
|
|
40
|
-
1. **Kernel params (this package's native contract)** — a flat JSON object (`layer_height`, `wall_loops`, `infill_density` 0–1, `sparse_infill_pattern`, `enable_support`, `wall_generator: 'classic' | 'arachne'`, …). Every accepted key is listed
|
|
41
|
-
2. **OrcaSlicer settings map** — a sparse `{schemaKey: value}` map using original OrcaSlicer option keys (
|
|
42
|
+
1. **Kernel params (this package's native contract)** — a flat JSON object (`layer_height`, `wall_loops`, `infill_density` 0–1, `sparse_infill_pattern`, `enable_support`, `wall_generator: 'classic' | 'arachne'`, …). Every accepted key is listed in [PARAMS.md](PARAMS.md).
|
|
43
|
+
2. **OrcaSlicer settings map** — a sparse `{schemaKey: value}` map using original OrcaSlicer option keys (976 defined in `three-slicer/data`); unset keys fall back to schema defaults:
|
|
42
44
|
|
|
43
45
|
```js
|
|
44
46
|
import { deriveKernelParams } from 'three-slicer/settings'
|
|
45
47
|
slicer.slice(stl, deriveKernelParams({ layer_height: 0.25, sparse_infill_density: 15 }))
|
|
46
48
|
```
|
|
47
49
|
|
|
48
|
-
**Known limit:** `deriveKernelParams` maps a curated subset of schema keys to kernel params. Editing other schema keys has no slicing effect (they exist for UI/metadata). Scalar options use their first element only; the filament options listed under *Materials* below are the exception — those keep every extruder's entry. Kernel parameters with no schema key behind them are reachable only by writing the params object yourself —
|
|
50
|
+
**Known limit:** `deriveKernelParams` maps a curated subset of schema keys to kernel params. Editing other schema keys has no slicing effect (they exist for UI/metadata). Scalar options use their first element only; the filament options listed under *Materials* below are the exception — those keep every extruder's entry. Kernel parameters with no schema key behind them are reachable only by writing the params object yourself — [PARAMS.md](PARAMS.md) marks which those are.
|
|
49
51
|
|
|
50
52
|
## Kernel parameter reference
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<!-- KERNEL-PARAMS:BEGIN — generated by types/gen_kernel_params.mjs, do not edit by hand -->
|
|
56
|
-
|
|
57
|
-
The kernel accepts **159 parameters**. `deriveKernelParams()` produces 131 of them from the
|
|
58
|
-
OrcaSlicer settings map; the remaining 28 have no schema key behind them and can only be set by writing
|
|
59
|
-
the params object directly — those rows show `—` in the *From setting* column.
|
|
60
|
-
|
|
61
|
-
A parameter left out of the object keeps the default listed here, so sending a partial object is normal and is
|
|
62
|
-
what `deriveKernelParams()` itself does.
|
|
63
|
-
|
|
64
|
-
*From setting* names the schema key the value is read from, which is often **not** the same name and not the
|
|
65
|
-
same unit — `first_layer_height` comes from `initial_layer_print_height`, and `infill_density` is
|
|
66
|
-
`sparse_infill_density` divided by 100 (a settings map holding `20` produces `0.2` here).
|
|
67
|
-
|
|
68
|
-
### Geometry and walls
|
|
69
|
-
|
|
70
|
-
| Kernel param | Type | Default | From setting | Notes |
|
|
71
|
-
| --- | --- | --- | --- | --- |
|
|
72
|
-
| `auto_center` | `boolean` | `false` | — | stage 28: true = realign the combined bbox to the origin (stage-3 legacy). false (default) = trust the viewer coordinates (no realignment, only Z seating) -> the toolpath overlaps the on-screen model exactly. Upstream = only the plate origin offset (GCode.cpp:932). |
|
|
73
|
-
| `first_layer_height` | `number` | `0.2` | `initial_layer_print_height` | |
|
|
74
|
-
| `gcode_resolution` | `number` | `0.01` | `resolution` | resolution (mm): path simplification tolerance. Upstream PrintConfig default 0.01 |
|
|
75
|
-
| `initial_layer_line_width` | `number` | `0` | `initial_layer_line_width` | |
|
|
76
|
-
| `inner_wall_line_width` | `number` | `0` | `inner_wall_line_width` | |
|
|
77
|
-
| `internal_solid_infill_line_width` | `number` | `0` | `internal_solid_infill_line_width` | |
|
|
78
|
-
| `layer_height` | `number` | `0.2` | `layer_height` | |
|
|
79
|
-
| `line_width` | `number` | `0.42` | `line_width` | |
|
|
80
|
-
| `outer_wall_line_width` | `number` | `0` | `outer_wall_line_width` | |
|
|
81
|
-
| `sparse_infill_line_width` | `number` | `0` | `sparse_infill_line_width` | |
|
|
82
|
-
| `spiral_mode` | `boolean` | `false` | `spiral_mode` | spiral_mode (vase) |
|
|
83
|
-
| `support_line_width` | `number` | `0.0` | `support_line_width` | support_line_width (0=auto; the real tree support extrusion width) |
|
|
84
|
-
| `top_surface_line_width` | `number` | `0` | `top_surface_line_width` | |
|
|
85
|
-
| `wall_generator` | `string` | `'classic'` | `wall_generator` | classic\|arachne (arachne = the real ported WallToolPaths) |
|
|
86
|
-
| `wall_loops` | `number` | `2` | `wall_loops` | |
|
|
87
|
-
|
|
88
|
-
### Infill
|
|
89
|
-
|
|
90
|
-
| Kernel param | Type | Default | From setting | Notes |
|
|
91
|
-
| --- | --- | --- | --- | --- |
|
|
92
|
-
| `bottom_shell_layers` | `number` | `3` | `bottom_shell_layers` | top_shell_layers/bottom_shell_layers |
|
|
93
|
-
| `infill_angle` | `number` | `45.0` | `infill_direction` | infill_direction |
|
|
94
|
-
| `infill_density` | `number` | `0.15` | `sparse_infill_density` | |
|
|
95
|
-
| `ironing_flow` | `number` | `10.0` | `ironing_flow` | ironing flow (%) |
|
|
96
|
-
| `ironing_spacing` | `number` | `0.1` | `ironing_spacing` | ironing line spacing (mm) |
|
|
97
|
-
| `ironing_speed` | `number` | `30.0` | `ironing_speed` | ironing speed (mm/s) |
|
|
98
|
-
| `ironing_type` | `string` | `'none'` | `ironing_type` | none\|top\|topmost\|solid (the top family = on) |
|
|
99
|
-
| `sparse_infill_filament_id` | `number` | `0` | `sparse_infill_filament_id` | |
|
|
100
|
-
| `sparse_infill_pattern` | `string` | `'rectilinear'` | `sparse_infill_pattern` | rectilinear\|grid\|triangles\|zigzag\|gyroid |
|
|
101
|
-
| `top_shell_layers` | `number` | `4` | `top_shell_layers` | top_shell_layers/bottom_shell_layers |
|
|
102
|
-
|
|
103
|
-
### Speeds, flow and temperature
|
|
104
|
-
|
|
105
|
-
| Kernel param | Type | Default | From setting | Notes |
|
|
106
|
-
| --- | --- | --- | --- | --- |
|
|
107
|
-
| `bed_temp` | `number` | `60` | `hot_plate_temp` | |
|
|
108
|
-
| `bridge_speed` | `number` | `25.0` | `bridge_speed` | bridge_speed[0] (slowdown for unsupported bottoms) |
|
|
109
|
-
| `close_fan_the_first_x_layers` | `number` | `1` | `close_fan_the_first_x_layers` | close_fan_the_first_x_layers |
|
|
110
|
-
| `enable_pressure_advance` | `boolean` | `false` | `enable_pressure_advance` | enable_pressure_advance[0] |
|
|
111
|
-
| `fan_speed` | `number` | `100.0` | `fan_max_speed` | fan_speed (%) |
|
|
112
|
-
| `filament_diameter` | `number` | `1.75` | `filament_diameter` | |
|
|
113
|
-
| `first_layer_speed` | `number` | `20` | `initial_layer_speed` | |
|
|
114
|
-
| `flow_ratio` | `number` | `1.0` | `filament_flow_ratio` | |
|
|
115
|
-
| `full_fan_speed_layer` | `number` | `3` | `full_fan_speed_layer` | full_fan_speed_layer |
|
|
116
|
-
| `machine_accel_print` | `number` | `5000` | `default_acceleration` | mm/s² |
|
|
117
|
-
| `machine_accel_retract` | `number` | `5000` | `machine_max_acceleration_retracting` | mm/s² |
|
|
118
|
-
| `machine_accel_travel` | `number` | `5000` | `travel_acceleration` | mm/s² |
|
|
119
|
-
| `machine_jerk_e` | `number` | `2.5` | `machine_max_jerk_e` | mm/s |
|
|
120
|
-
| `machine_jerk_xy` | `number` | `9.0` | `machine_max_jerk_x` | mm/s |
|
|
121
|
-
| `machine_jerk_z` | `number` | `0.4` | `machine_max_jerk_z` | mm/s |
|
|
122
|
-
| `machine_max_accel_e` | `number` | `5000` | `machine_max_acceleration_e` | mm/s² (machine_max_acceleration_*) — per-axis ceiling, distinct from the accel_* feedrates above |
|
|
123
|
-
| `machine_max_accel_xy` | `number` | `5000` | `machine_max_acceleration_x` | mm/s² (machine_max_acceleration_*) — per-axis ceiling, distinct from the accel_* feedrates above |
|
|
124
|
-
| `machine_max_accel_z` | `number` | `500` | `machine_max_acceleration_z` | mm/s² (machine_max_acceleration_*) — per-axis ceiling, distinct from the accel_* feedrates above |
|
|
125
|
-
| `machine_max_speed_e` | `number` | `30` | `machine_max_speed_e` | mm/s |
|
|
126
|
-
| `machine_max_speed_xy` | `number` | `500` | `machine_max_speed_x` | mm/s |
|
|
127
|
-
| `machine_max_speed_z` | `number` | `12` | `machine_max_speed_z` | mm/s |
|
|
128
|
-
| `max_volumetric_extrusion_rate_slope` | `number` | `0.0` | `max_volumetric_extrusion_rate_slope` | PE-lite flow change rate limit (mm³/s², 0=off) |
|
|
129
|
-
| `nozzle_diameter` | `number` | `0.4` | `nozzle_diameter` | |
|
|
130
|
-
| `nozzle_temp` | `number` | `210` | `nozzle_temperature` | |
|
|
131
|
-
| `pressure_advance` | `number` | `0.02` | `pressure_advance` | pressure_advance[0] |
|
|
132
|
-
| `print_speed` | `number` | `60` | `outer_wall_speed` | |
|
|
133
|
-
| `slow_down_layer_time` | `number` | `8.0` | `slow_down_layer_time` | slow_down_layer_time (s) |
|
|
134
|
-
| `travel_speed` | `number` | `150` | `travel_speed` | |
|
|
135
|
-
|
|
136
|
-
### Retraction and seams
|
|
137
|
-
|
|
138
|
-
| Kernel param | Type | Default | From setting | Notes |
|
|
139
|
-
| --- | --- | --- | --- | --- |
|
|
140
|
-
| `retract_length` | `number` | `0.8` | `filament_retraction_length`, `retraction_length` | retraction_length/speed[0], z_hop[0] |
|
|
141
|
-
| `retract_speed` | `number` | `30.0` | `filament_retraction_speed`, `retraction_speed` | retraction_length/speed[0], z_hop[0] |
|
|
142
|
-
| `retraction_minimum_travel` | `number` | `2.0` | `filament_retraction_minimum_travel`, `retraction_minimum_travel` | retraction_minimum_travel (mm): minimum travel that triggers a retraction |
|
|
143
|
-
| `scarf_length` | `number` | `10.0` | — | length of the scarf z/flow ramp (mm) |
|
|
144
|
-
| `seam_position` | `string` | `'back'` | `seam_position` | nearest\|aligned\|back\|random |
|
|
145
|
-
| `seam_slope_type` | `string` | `'none'` | `seam_slope_type` | none\|external\|all -> scarf seam (external/all = on) |
|
|
146
|
-
| `z_hop` | `number` | `0.4` | `filament_z_hop`, `z_hop` | retraction_length/speed[0], z_hop[0] |
|
|
147
|
-
|
|
148
|
-
### Adhesion (skirt, brim, raft)
|
|
149
|
-
|
|
150
|
-
| Kernel param | Type | Default | From setting | Notes |
|
|
151
|
-
| --- | --- | --- | --- | --- |
|
|
152
|
-
| `brim_object_gap` | `number` | `0.0` | `brim_object_gap` | brim_object_gap (mm): gap between brim and object |
|
|
153
|
-
| `brim_width` | `number` | `0.0` | `brim_width` | skirt_distance / brim_width |
|
|
154
|
-
| `raft_contact_distance` | `number` | `0.1` | `raft_contact_distance` | raft_contact_distance (mm) |
|
|
155
|
-
| `raft_expansion` | `number` | `1.5` | `raft_expansion` | raft_expansion (mm). Upstream default 1.5 (previously hardcoded to 3.0) |
|
|
156
|
-
| `raft_first_layer_height` | `number` | `0.30` | — | raft first layer height (mm) |
|
|
157
|
-
| `raft_layers` | `number` | `0` | `raft_layers` | raft_layers |
|
|
158
|
-
| `skirt_distance` | `number` | `2.0` | `skirt_distance` | skirt_distance / brim_width |
|
|
159
|
-
| `skirt_height` | `number` | `1` | `skirt_height` | skirt_height: how many layers the skirt is drawn on |
|
|
160
|
-
| `skirt_loops` | `number` | `1` | `skirt_loops` | skirt_loops |
|
|
161
|
-
|
|
162
|
-
### Support
|
|
163
|
-
|
|
164
|
-
| Kernel param | Type | Default | From setting | Notes |
|
|
165
|
-
| --- | --- | --- | --- | --- |
|
|
166
|
-
| `bridge_no_support` | `boolean` | `false` | `bridge_no_support` | bridge_no_support: no support under bridge regions |
|
|
167
|
-
| `enable_support` | `boolean` | `false` | `enable_support` | enable_support |
|
|
168
|
-
| `support_angle` | `number` | `0.0` | `support_angle` | support_angle: base angle of the support body (°). Upstream SupportParameters::base_angle |
|
|
169
|
-
| `support_auto` | `boolean` | `true` | — | stage 20: true = automatic overhang detection, false = manual (painted enforcers only) |
|
|
170
|
-
| `support_base_pattern` | `string` | `'default'` | `support_base_pattern` | support_base_pattern: default\|rectilinear\|rectilinear-grid\|honeycomb\|... |
|
|
171
|
-
| `support_base_pattern_spacing` | `number` | `2.5` | `support_base_pattern_spacing` | support_base_pattern_spacing (mm). Determines spacing together with density |
|
|
172
|
-
| `support_bottom_z_distance` | `number` | `0.2` | `support_bottom_z_distance` | stage 32: z gap under support resting on a model top surface (default 0.2 = equivalent to today's 1 layer -> default behavior and golden unchanged) |
|
|
173
|
-
| `support_density` | `number` | `0.15` | — | density of the support body |
|
|
174
|
-
| `support_expansion` | `number` | `0.0` | `support_expansion` | support_expansion (mm): expands the overhang region |
|
|
175
|
-
| `support_filament` | `number` | `0` | `support_filament` | filament for the support base (and, upstream, the raft) |
|
|
176
|
-
| `support_grid_snap` | `boolean` | `true` | — | equivalent of the upstream SupportGridPattern (default behavior of the grid style) |
|
|
177
|
-
| `support_interface_bottom_layers` | `number` | `0` | `support_interface_bottom_layers` | support_interface_bottom_layers (0 = none) |
|
|
178
|
-
| `support_interface_filament` | `number` | `0` | `support_interface_filament` | filament for the support interface |
|
|
179
|
-
| `support_interface_pattern` | `string` | `'auto'` | `support_interface_pattern` | support_interface_pattern: auto\|rectilinear\|concentric\|rectilinear_interlaced\|grid |
|
|
180
|
-
| `support_interface_spacing` | `number` | `0.5` | `support_interface_spacing` | support_interface_spacing (mm, 0=solid). Upstream default 0.5 |
|
|
181
|
-
| `support_interface_top_layers` | `number` | `2` | `support_interface_top_layers` | support_interface_top_layers |
|
|
182
|
-
| `support_object_first_layer_gap` | `number` | `0.2` | `support_object_first_layer_gap` | support_object_first_layer_gap (mm) |
|
|
183
|
-
| `support_on_build_plate_only` | `boolean` | `false` | `support_on_build_plate_only` | support_on_build_plate_only: only support reaching the bed |
|
|
184
|
-
| `support_overhang_min_area` | `number` | `0.0` | — | minimum overhang area (mm², 0 = auto w²). Replaces the morphological opening filter |
|
|
185
|
-
| `support_remove_small_overhang` | `boolean` | `true` | `support_remove_small_overhang` | support_remove_small_overhang (upstream default true) |
|
|
186
|
-
| `support_style` | `string` | `'grid'` | `support_style` | grid\|tree_lite |
|
|
187
|
-
| `support_threshold_angle` | `number` | `30.0` | `support_threshold_angle` | support_threshold_angle |
|
|
188
|
-
| `support_threshold_overlap` | `number` | `0.5` | `support_threshold_overlap` | support_threshold_overlap: the overlap criterion when θ=0 (as a fraction of extrusion width) |
|
|
189
|
-
| `support_top_z_distance` | `number` | `0.2` | `support_top_z_distance` | support_top_z_distance |
|
|
190
|
-
| `support_xy_distance` | `number` | `0.35` | `support_object_xy_distance` | support_object_xy_distance |
|
|
191
|
-
| `tree_lite_min_radius` | `number` | `1.5` | — | tree_lite taper constants (our own approximation — no matching upstream key) |
|
|
192
|
-
| `tree_lite_shrink` | `number` | `0.5` | — | tree_lite taper constants (our own approximation — no matching upstream key) |
|
|
193
|
-
| `tree_style` | `string` | `'organic'` | — | organic\|slim\|strong\|hybrid (upstream support_style smsTree*) |
|
|
194
|
-
| `tree_support_angle_slow` | `number` | `25.0` | `tree_support_angle_slow` | tree_support_angle_slow (deg) |
|
|
195
|
-
| `tree_support_branch_angle` | `number` | `40.0` | `tree_support_branch_angle` | fallback spelling — `tree_support_branch_angle_organic` wins when both are sent |
|
|
196
|
-
| `tree_support_branch_angle_organic` | `number` | `40.0` | `tree_support_branch_angle_organic` | tree_support_branch_angle_organic (deg) |
|
|
197
|
-
| `tree_support_branch_diameter` | `number` | `2.0` | `tree_support_branch_diameter` | fallback spelling — `tree_support_branch_diameter_organic` wins when both are sent |
|
|
198
|
-
| `tree_support_branch_diameter_angle` | `number` | `5.0` | `tree_support_branch_diameter_angle` | tree_support_branch_diameter_angle (deg) |
|
|
199
|
-
| `tree_support_branch_diameter_organic` | `number` | `2.0` | `tree_support_branch_diameter_organic` | tree_support_branch_diameter_organic (mm) |
|
|
200
|
-
| `tree_support_branch_distance` | `number` | `1.0` | `tree_support_branch_distance` | fallback spelling — `tree_support_branch_distance_organic` wins when both are sent |
|
|
201
|
-
| `tree_support_branch_distance_organic` | `number` | `1.0` | `tree_support_branch_distance_organic` | tree_support_branch_distance_organic (mm) |
|
|
202
|
-
| `tree_support_tip_diameter` | `number` | `0.8` | `tree_support_tip_diameter` | tree_support_tip_diameter (mm) |
|
|
203
|
-
| `tree_support_top_rate` | `number` | `30.0` | `tree_support_top_rate` | tree_support_top_rate (%) |
|
|
204
|
-
| `tree_support_wall_count` | `number` | `0` | `tree_support_wall_count` | tree_support_wall_count (organic applies max(1,·) internally) |
|
|
205
|
-
|
|
206
|
-
### Multi-material and prime tower
|
|
207
|
-
|
|
208
|
-
| Kernel param | Type | Default | From setting | Notes |
|
|
209
|
-
| --- | --- | --- | --- | --- |
|
|
210
|
-
| `bottom_surface_filament_id` | `number` | `0` | `bottom_surface_filament_id` | |
|
|
211
|
-
| `enable_prime_tower` | `boolean` | `true` | `enable_prime_tower` | |
|
|
212
|
-
| `filament_cost` | `number[]` | `[]` | `filament_cost` | currency per kg, per filament |
|
|
213
|
-
| `filament_density` | `number[]` | `[]` | `filament_density` | g/cm3, per filament |
|
|
214
|
-
| `filament_map` | `number[]` | `[]` | `filament_map` | |
|
|
215
|
-
| `filament_settings_id` | `vector<std::string>` | `[]` | `filament_settings_id` | |
|
|
216
|
-
| `filament_type` | `vector<std::string>` | `[]` | `filament_type` | |
|
|
217
|
-
| `inner_wall_filament_id` | `number` | `0` | `inner_wall_filament_id` | |
|
|
218
|
-
| `internal_solid_filament_id` | `number` | `0` | `internal_solid_filament_id` | |
|
|
219
|
-
| `outer_wall_filament_id` | `number` | `0` | `outer_wall_filament_id` | |
|
|
220
|
-
| `top_surface_filament_id` | `number` | `0` | `top_surface_filament_id` | |
|
|
221
|
-
| `wipe_tower_real` | `boolean` | `false` | — | stage 12: use the real WipeTower.generate() on MM changes instead of the stage-6 square ring |
|
|
222
|
-
|
|
223
|
-
### Bed and machine G-code
|
|
224
|
-
|
|
225
|
-
| Kernel param | Type | Default | From setting | Notes |
|
|
226
|
-
| --- | --- | --- | --- | --- |
|
|
227
|
-
| `bed_depth` | `number` | `256.0` | `printable_area` | bed size (offset = bed/2) |
|
|
228
|
-
| `bed_height` | `number` | `0.0` | `printable_height` | printable_height (mm). 0 = no ceiling (backwards compatible) |
|
|
229
|
-
| `bed_width` | `number` | `256.0` | `printable_area` | bed size (offset = bed/2) |
|
|
230
|
-
| `enable_arc_fitting` | `boolean` | `false` | `enable_arc_fitting` | enable_arc_fitting |
|
|
231
|
-
| `machine_end_gcode` | `string` | — | `machine_end_gcode` | printer profile custom G-code. Empty = the mini-kernel's own preamble/footer only |
|
|
232
|
-
| `machine_start_gcode` | `string` | — | `machine_start_gcode` | printer profile custom G-code. Empty = the mini-kernel's own preamble/footer only |
|
|
233
|
-
| `printable_height` | `number` | `250.0` | `printable_height` | printable_height (mm) — the tree BuildVolume height |
|
|
234
|
-
|
|
235
|
-
### Engine, streaming and diagnostics
|
|
236
|
-
|
|
237
|
-
| Kernel param | Type | Default | From setting | Notes |
|
|
238
|
-
| --- | --- | --- | --- | --- |
|
|
239
|
-
| `arachne_dump` | `boolean` | `false` | — | temporary diagnostic: dump the PASS1 arachne input polygons to stderr |
|
|
240
|
-
| `economy` | `boolean` | `false` | — | |
|
|
241
|
-
| `emit_pe_tags` | `boolean` | `false` | — | emit PE tags on extrusion runs (enabled automatically when the real PE is used). Default false (backwards compatible) |
|
|
242
|
-
| `extruder_count` | `number` | `1` | — | multi-material: how many extruders are used (1\|2) |
|
|
243
|
-
| `extruder_filament_diameter` | `number[]` | `[]` | `filament_diameter` | |
|
|
244
|
-
| `extruder_flow_ratio` | `number[]` | `[]` | `filament_flow_ratio` | |
|
|
245
|
-
| `extruder_nozzle_temp` | `number[]` | `[]` | `nozzle_temperature` | |
|
|
246
|
-
| `extruder_retract_length` | `?` | `[]` | `filament_retraction_length` | undefined |
|
|
247
|
-
| `extruder_retract_speed` | `?` | `[]` | `filament_retraction_speed` | undefined |
|
|
248
|
-
| `extruder_z_hop` | `?` | `[]` | `filament_z_hop` | undefined |
|
|
249
|
-
| `extrusion_rate_slope_segment_length` | `number` | `1.0` | — | segment split length for the real PE (mm) |
|
|
250
|
-
| `flush_into_infill` | `boolean` | `false` | `flush_into_infill` | |
|
|
251
|
-
| `flush_multiplier` | `number` | `1.0` | `flush_multiplier` | upstream scales the whole table by this |
|
|
252
|
-
| `flush_volumes_matrix` | `number[]` | `[]` | `flush_volumes_matrix` | |
|
|
253
|
-
| `gcode_config_block` | `boolean` | `false` | — | ; CONFIG_BLOCK_START … the parameters this slice ran with … END |
|
|
254
|
-
| `gcode_stats_block` | `boolean` | `false` | — | ; filament used [mm]/[cm3]/[g], cost, total filament change |
|
|
255
|
-
| `independent_support_layer_height` | `boolean` | `false` | `independent_support_layer_height` | false by default because of the kernel z grid constraint (gap quantized to layers) |
|
|
256
|
-
| `keep_stages` | `boolean` | `false` | — | keep the stages cached after slicing (skips the early release — a memory trade-off) |
|
|
257
|
-
| `mm_group_split` | `number` | `0` | — | triangle group boundary index ([0,split)=T0, [split,N)=T1) |
|
|
258
|
-
| `mm_group_splits` | `number[]` | `[]` | — | |
|
|
259
|
-
| `mm_group_tools` | `number[]` | `[]` | — | |
|
|
260
|
-
| `pe_external_perimeter_only` | `boolean` | `false` | — | real PE: smooth outer walls only |
|
|
261
|
-
| `pe_lite` | `boolean` | `true` | — | true = the effective PE-lite (default), false = the ported real PE (tagged g-code) |
|
|
262
|
-
| `pe_strip_tags` | `boolean` | `true` | — | strip the tags from the final output after real PE post-processing |
|
|
263
|
-
| `prime_tower_ring_size` | `number` | `15.0` | — | side length of the fallback square ring (mm) |
|
|
264
|
-
| `prime_tower_width` | `number` | `30.0` | `prime_tower_width` | width of the real WipeTower (mm). Separate from the square ring width (15). |
|
|
265
|
-
| `prime_tower_x` | `number` | `10.0` | `wipe_tower_x` | |
|
|
266
|
-
| `prime_tower_y` | `number` | `10.0` | `wipe_tower_y` | |
|
|
267
|
-
| `prime_volume` | `number` | `0.0` | `prime_volume` | extra volume primed on every change, on top of the pair's |
|
|
268
|
-
| `reduce_crossing_wall` | `boolean` | `false` | `reduce_crossing_wall` | wall-avoiding travel |
|
|
269
|
-
| `reuse_stages` | `number` | `0` | — | |
|
|
270
|
-
| `time_engine` | `string` | `'full'` | — | |
|
|
271
|
-
|
|
272
|
-
<!-- KERNEL-PARAMS:END -->
|
|
273
|
-
|
|
274
|
-
### The parameters no setting reaches
|
|
275
|
-
|
|
276
|
-
A `—` in *From setting* means there is no OrcaSlicer option behind that parameter, so it exists only if you put it
|
|
277
|
-
in the params object yourself. They are not one kind of thing, and the difference matters before you reach for one:
|
|
278
|
-
|
|
279
|
-
- **Host runtime flags** — `economy`, `keep_stages`, `reuse_stages`, `time_engine`, `wipe_tower_real`,
|
|
280
|
-
`gcode_stats_block`, `gcode_config_block`. Decisions the *caller* makes about a particular run, not properties of
|
|
281
|
-
the print. `economy` is the last rung of an out-of-memory retry: it streams G-code and skips the preview
|
|
282
|
-
toolpaths and the time estimate, so a model that cannot finish any other way still finishes.
|
|
283
|
-
- **Values the viewer computes** — `extruder_count`, `mm_group_split`, `mm_group_splits`, `mm_group_tools`,
|
|
284
|
-
`auto_center`. These come from the scene (how many extruders are loaded, which triangle ranges belong to which
|
|
285
|
-
tool), so there is nothing for a settings map to hold. `<Viewport/>` fills them in at slice time.
|
|
286
|
-
- **Kernel-only tuning** — `support_density`, `support_auto`, `support_grid_snap`, `support_overhang_min_area`,
|
|
287
|
-
`tree_style`, `tree_lite_shrink`, `tree_lite_min_radius`, `scarf_length`, `prime_tower_ring_size`,
|
|
288
|
-
`raft_first_layer_height`, `extrusion_rate_slope_segment_length`. Real knobs with no upstream option of the same
|
|
289
|
-
name — some are this kernel's own approximations (the `tree_lite_*` taper), others are upstream behaviour that
|
|
290
|
-
upstream never exposed as a setting.
|
|
291
|
-
- **Diagnostics** — `arachne_dump`, `pe_lite`, `pe_strip_tags`, `pe_external_perimeter_only`, `emit_pe_tags`. Left
|
|
292
|
-
at their defaults unless you are working on the kernel itself. `pe_lite` in particular defaults to `true` because
|
|
293
|
-
the real pressure equalizer only acts on G-code carrying OrcaSlicer's `;_EXTRUDE_SET_SPEED` tags, which this
|
|
294
|
-
kernel emits only when asked.
|
|
54
|
+
The full table — 159 parameters, generated from the kernel's own reader (`params.cpp`) so it cannot drift from
|
|
55
|
+
what `slice()` actually honours — lives in [PARAMS.md](PARAMS.md), including the classification of the 28
|
|
56
|
+
parameters no setting reaches. Regenerate with `node types/gen_kernel_params.mjs`.
|
|
295
57
|
|
|
296
58
|
## Materials and multi-material
|
|
297
59
|
|
|
298
60
|
A material is a **filament preset**: a set of schema values (temperatures, flow, diameter, cooling, retraction/z-hop overrides) that a printer profile declares itself compatible with. Read the catalog through the facade, never by decoding `three-slicer/data/filaments.js` by hand:
|
|
299
61
|
|
|
300
62
|
```js
|
|
301
|
-
import { filamentPresets, deriveKernelParams } from 'three-slicer/settings'
|
|
63
|
+
import { filamentPresets, applyPreset, deriveKernelParams } from 'three-slicer/settings'
|
|
302
64
|
|
|
303
65
|
const filaments = await filamentPresets() // lazy — the artifact loads on first call
|
|
304
66
|
filaments.listFor('Bambu Lab X1 Carbon 0.4 nozzle') // [{name, type, vendor}, …]
|
|
305
67
|
filaments.recommendedFor('Bambu Lab X1 Carbon 0.4 nozzle') // the vendor's shortlist, filtered to the compatible set
|
|
306
68
|
|
|
307
|
-
// Applying one:
|
|
308
|
-
// behind whatever the previous material set and this one does not — a PLA pick after an
|
|
309
|
-
// chamber temperature. `keys` is the exact set to clear,
|
|
310
|
-
// clearing one never disturbs the other.
|
|
311
|
-
function applyPreset(settings, preset, keys) {
|
|
312
|
-
const next = { ...settings }
|
|
313
|
-
for (const key of keys) delete next[key]
|
|
314
|
-
return Object.assign(next, preset)
|
|
315
|
-
}
|
|
69
|
+
// Applying one: applyPreset CLEARS the preset's key set first. A preset carries only the keys it sets, so a
|
|
70
|
+
// plain merge leaves behind whatever the previous material set and this one does not — a PLA pick after an
|
|
71
|
+
// ABS pick keeps ABS's chamber temperature. `keys` is the exact set to clear, the filament and process key
|
|
72
|
+
// sets are disjoint (clearing one never disturbs the other), and a null preset applies nothing.
|
|
316
73
|
settings = applyPreset(settings, filaments.settingsFor('Bambu PLA Basic @BBL X1C'), filaments.keys)
|
|
317
74
|
```
|
|
318
75
|
|
|
@@ -337,7 +94,7 @@ The kernel reads those arrays **positionally** and reloads the whole loaded-fila
|
|
|
337
94
|
|
|
338
95
|
Painting is the only way a **single** object can print in two materials — there is no triangle boundary to split on, only painted facets. The painted facets of each state are projected per layer and the sliced polygon is partitioned against them; where two extruders claim the same area the higher-numbered one wins (a total order on a small integer, so the result never depends on paint or clipper ordering).
|
|
339
96
|
|
|
340
|
-
Painting states are upstream's `EnforcerBlockerType`, one enum serving two jobs: `1` = ENFORCER = **Extruder1**, `2` = BLOCKER = **Extruder2**, `3..16` = Extruder3..16. The state-addressed protocol lives on the worker (`three-slicer/worker`); the direct handle's `
|
|
97
|
+
Painting states are upstream's `EnforcerBlockerType`, one enum serving two jobs: `1` = ENFORCER = **Extruder1**, `2` = BLOCKER = **Extruder2**, `3..16` = Extruder3..16. The state-addressed protocol lives on the worker (`three-slicer/worker`); the direct handle's `slicer.paint({enforcer})` is the original boolean pair only.
|
|
341
98
|
|
|
342
99
|
```js
|
|
343
100
|
worker.postMessage({ cmd: 'prepare', stl }) // -> {type:'prepared', facets}
|
|
@@ -348,16 +105,13 @@ worker.postMessage({ cmd: 'erase', facet, hx, hy, hz, cx, cy, cz, radius }) //
|
|
|
348
105
|
|
|
349
106
|
`erase` is its **own command**, not `{cmd:'paint', state: 0}`: embind coerces a JS `false` to the int `0` == NONE, and the legacy blocker brush sends exactly that `false` — so the state path rejects `0` outright and only `erase`, which takes no state argument, can clear anything. A message without `state`/`states` gets the original reply verbatim, so existing listeners are unaffected.
|
|
350
107
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
- Because one selector serves both jobs, **a support BLOCKER paint and an Extruder2 paint are the same mark**, and a facet can hold only one of them. The two brushes are therefore mutually exclusive, which is a data constraint, not a UI simplification.
|
|
354
|
-
- The painted multi-material path is taken only when support is **off** — it emits no support at all. **Paint and support cannot currently produce two materials together.**
|
|
108
|
+
One consequence worth knowing before you build on this: because one selector serves both jobs, **a support BLOCKER paint and an Extruder2 paint are the same mark**, and a facet can hold only one of them. The two brushes are therefore mutually exclusive on a model, which is a data constraint, not a UI simplification. (Support itself is fine — the painted multi-material path runs the same support pass the single-material path does, so paint and generated support coexist on one slice.)
|
|
355
109
|
|
|
356
110
|
Results carry the split: `stats.filament_mm_by_tool` (indexed by tool number, one slot per extruder, sums to `filament_mm`) and `stats.filament_mm_purge` (the prime/wipe tower share, already included in the per-tool figures). In the streamed toolpath, `paths[k+3]` encodes `role + tool * 16` — mask with `& 15` for the role and `>>> 4` for the tool.
|
|
357
111
|
|
|
358
112
|
## SLA parameters
|
|
359
113
|
|
|
360
|
-
The table
|
|
114
|
+
The table in [PARAMS.md](PARAMS.md) is the FFF kernel's reader. The SLA entry (`slice_sla`) reads its own parameter set, produced
|
|
361
115
|
by `deriveSlaParams(settings)` — unlike `deriveKernelParams` it always emits every key (54 today), filling
|
|
362
116
|
schema/reference-machine defaults, because the SLA keys are not shared with another technology whose defaults
|
|
363
117
|
could disagree. The groups:
|
|
@@ -26,6 +26,10 @@ const slicer = await createSlicer()
|
|
|
26
26
|
// (a) batch slice
|
|
27
27
|
const r = slicer.slice(cube, params)
|
|
28
28
|
console.log(`batch : layers=${r.stats.layers} segments=${r.stats.path_segments} filament=${r.stats.filament_mm.toFixed(1)}mm gcode=${r.gcode.length} chars`)
|
|
29
|
+
// What a SUCCESSFUL slice got away with — empty here. It is not empty if you hand in a bed-centred model:
|
|
30
|
+
// the kernel takes plate-local coordinates, so pre-centring adds the bed offset twice and the part slices
|
|
31
|
+
// off the plate with plausible time and material and no error.
|
|
32
|
+
console.log(`warn : ${r.warnings.length ? r.warnings.join(', ') : 'none'}`)
|
|
29
33
|
|
|
30
34
|
// (b) streaming slice via onLayer (stage 30) — assemble G-code from per-layer chunks
|
|
31
35
|
let chunks = 0, gbytes = 0
|