three-slicer-viewer 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/TOOLPATH_SPEC.md +8 -1
- package/data/config-schema-lean.json +1 -1
- package/dist/gcode_parse.js +149 -110
- package/dist/index.js +4547 -4304
- package/dist/sl1_encode.worker.js +1 -1
- package/dist/sl1_write-B6nWmCUu.js +313 -0
- package/dist/sla_slice.worker.js +1 -1
- package/dist/toolpath.js +274 -220
- package/package.json +1 -1
- package/src/settings/bed_frame.js +28 -0
- package/src/settings/index.js +1 -0
- package/src/settings/kernel_setting_keys.js +51 -0
- package/src/settings/settings_core.js +253 -60
- package/types/gcode.d.ts +13 -0
- package/types/settings.d.ts +14 -1
- package/types/toolpath.d.ts +6 -0
- package/dist/sl1_write-BovHbg3k.js +0 -303
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "three-slicer-viewer",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "The three-slicer viewer without the slicer — model loading, G-code parsing, GPU toolpath rendering and the settings transforms, under MIT. Plug a slicer in through the `slicer` prop.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Printer coordinates. Kept apart from settings_core.js because it needs no schema: core/plate_settings.js reads it
|
|
2
|
+
// without loading the config schema behind it.
|
|
3
|
+
//
|
|
4
|
+
// The viewer and the kernel work in a plate frame centred on the bed; the printer's own coordinates start wherever
|
|
5
|
+
// printable_area does. The kernel adds the bed centre to every coordinate it writes (Params::bed_center_x/y), and
|
|
6
|
+
// every stored printer coordinate (wipe_tower_x/y, a 3mf object position, an imported G-code) converts through the
|
|
7
|
+
// same two functions. `params` is deriveKernelParams' output (bed_origin_x/y are present only when the corner is
|
|
8
|
+
// not (0,0)). Most beds start at (0,0), where the centre is half the bed; a delta bed is centred on (0,0) itself
|
|
9
|
+
// (Anycubic Predator: -185..185).
|
|
10
|
+
import { BED_FALLBACK } from './kernel_defaults.js'
|
|
11
|
+
|
|
12
|
+
export function bedOrigin(params) {
|
|
13
|
+
return { x: params?.bed_origin_x ?? 0, y: params?.bed_origin_y ?? 0 }
|
|
14
|
+
}
|
|
15
|
+
export function bedCenter(params) {
|
|
16
|
+
const origin = bedOrigin(params)
|
|
17
|
+
return { x: origin.x + (params?.bed_width ?? BED_FALLBACK.width) / 2, y: origin.y + (params?.bed_depth ?? BED_FALLBACK.depth) / 2 }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// A printable_area that is not an axis-aligned rectangle (a delta bed's circle as 72 points, a cut-corner bed), as
|
|
21
|
+
// plate-local points: printer coordinates minus the bed centre. null for a rectangle, which bed_width/bed_depth
|
|
22
|
+
// already describe exactly.
|
|
23
|
+
export function bedShapeLocal(area, center) {
|
|
24
|
+
if (!Array.isArray(area) || area.length < 3) return null
|
|
25
|
+
const xs = new Set(area.map(point => point[0])), ys = new Set(area.map(point => point[1]))
|
|
26
|
+
if (area.length === 4 && xs.size === 2 && ys.size === 2) return null
|
|
27
|
+
return area.map(([x, y]) => [x - center.x, y - center.y])
|
|
28
|
+
}
|
package/src/settings/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// three-slicer-viewer/settings — the catalog-free settings surface. See settings_core.js.
|
|
2
2
|
export * from './settings_core.js'
|
|
3
|
+
export { bedOrigin, bedCenter, bedShapeLocal } from './bed_frame.js'
|
|
3
4
|
// The derivation's own fallbacks, for callers that need the same numbers (frozen; see kernel_defaults.js).
|
|
4
5
|
export { FFF_FALLBACKS, SLA_FALLBACKS, AUTO_LINE_WIDTH, BED_FALLBACK, MACHINE_LIMITS } from './kernel_defaults.js'
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
// AUTO-GENERATED by types/gen_kernel_params.mjs — DO NOT EDIT.
|
|
2
2
|
// The schema keys deriveKernelParams consumes (the distinct "From setting" column of engine/PARAMS.md).
|
|
3
3
|
export const KERNEL_SETTING_KEYS = [
|
|
4
|
+
"accel_to_decel_enable",
|
|
5
|
+
"accel_to_decel_factor",
|
|
4
6
|
"alternate_extra_wall",
|
|
7
|
+
"before_layer_change_gcode",
|
|
5
8
|
"bottom_shell_layers",
|
|
6
9
|
"bottom_solid_infill_flow_ratio",
|
|
7
10
|
"bottom_surface_filament_id",
|
|
11
|
+
"bridge_acceleration",
|
|
8
12
|
"bridge_flow",
|
|
9
13
|
"bridge_no_support",
|
|
10
14
|
"bridge_speed",
|
|
11
15
|
"brim_flow_ratio",
|
|
12
16
|
"brim_object_gap",
|
|
13
17
|
"brim_width",
|
|
18
|
+
"change_filament_gcode",
|
|
14
19
|
"close_fan_the_first_x_layers",
|
|
20
|
+
"curr_bed_type",
|
|
15
21
|
"default_acceleration",
|
|
22
|
+
"default_jerk",
|
|
16
23
|
"detect_thin_wall",
|
|
24
|
+
"disable_m73",
|
|
25
|
+
"emit_machine_limits_to_gcode",
|
|
17
26
|
"enable_arc_fitting",
|
|
18
27
|
"enable_pressure_advance",
|
|
19
28
|
"enable_prime_tower",
|
|
@@ -30,8 +39,10 @@ export const KERNEL_SETTING_KEYS = [
|
|
|
30
39
|
"filament_retraction_minimum_travel",
|
|
31
40
|
"filament_retraction_speed",
|
|
32
41
|
"filament_settings_id",
|
|
42
|
+
"filament_start_gcode",
|
|
33
43
|
"filament_type",
|
|
34
44
|
"filament_z_hop",
|
|
45
|
+
"file_start_gcode",
|
|
35
46
|
"filter_out_gap_fill",
|
|
36
47
|
"first_layer_flow_ratio",
|
|
37
48
|
"flush_into_infill",
|
|
@@ -40,32 +51,51 @@ export const KERNEL_SETTING_KEYS = [
|
|
|
40
51
|
"full_fan_speed_layer",
|
|
41
52
|
"gap_fill_flow_ratio",
|
|
42
53
|
"gap_infill_speed",
|
|
54
|
+
"gcode_flavor",
|
|
43
55
|
"hot_plate_temp",
|
|
56
|
+
"hot_plate_temp_initial_layer",
|
|
44
57
|
"independent_support_layer_height",
|
|
45
58
|
"infill_direction",
|
|
59
|
+
"infill_jerk",
|
|
46
60
|
"infill_wall_overlap",
|
|
61
|
+
"initial_layer_acceleration",
|
|
62
|
+
"initial_layer_infill_speed",
|
|
63
|
+
"initial_layer_jerk",
|
|
47
64
|
"initial_layer_line_width",
|
|
48
65
|
"initial_layer_print_height",
|
|
49
66
|
"initial_layer_speed",
|
|
67
|
+
"initial_layer_travel_acceleration",
|
|
68
|
+
"initial_layer_travel_jerk",
|
|
69
|
+
"initial_layer_travel_speed",
|
|
70
|
+
"inner_wall_acceleration",
|
|
50
71
|
"inner_wall_filament_id",
|
|
51
72
|
"inner_wall_flow_ratio",
|
|
73
|
+
"inner_wall_jerk",
|
|
52
74
|
"inner_wall_line_width",
|
|
75
|
+
"inner_wall_speed",
|
|
53
76
|
"internal_solid_filament_id",
|
|
77
|
+
"internal_solid_infill_acceleration",
|
|
54
78
|
"internal_solid_infill_flow_ratio",
|
|
55
79
|
"internal_solid_infill_line_width",
|
|
80
|
+
"internal_solid_infill_speed",
|
|
56
81
|
"ironing_flow",
|
|
57
82
|
"ironing_spacing",
|
|
58
83
|
"ironing_speed",
|
|
59
84
|
"ironing_type",
|
|
85
|
+
"layer_change_gcode",
|
|
60
86
|
"layer_height",
|
|
61
87
|
"line_width",
|
|
62
88
|
"machine_end_gcode",
|
|
63
89
|
"machine_max_acceleration_e",
|
|
90
|
+
"machine_max_acceleration_extruding",
|
|
64
91
|
"machine_max_acceleration_retracting",
|
|
92
|
+
"machine_max_acceleration_travel",
|
|
65
93
|
"machine_max_acceleration_x",
|
|
94
|
+
"machine_max_acceleration_y",
|
|
66
95
|
"machine_max_acceleration_z",
|
|
67
96
|
"machine_max_jerk_e",
|
|
68
97
|
"machine_max_jerk_x",
|
|
98
|
+
"machine_max_jerk_y",
|
|
69
99
|
"machine_max_jerk_z",
|
|
70
100
|
"machine_max_speed_e",
|
|
71
101
|
"machine_max_speed_x",
|
|
@@ -74,9 +104,12 @@ export const KERNEL_SETTING_KEYS = [
|
|
|
74
104
|
"max_volumetric_extrusion_rate_slope",
|
|
75
105
|
"nozzle_diameter",
|
|
76
106
|
"nozzle_temperature",
|
|
107
|
+
"nozzle_temperature_initial_layer",
|
|
77
108
|
"only_one_wall_first_layer",
|
|
109
|
+
"outer_wall_acceleration",
|
|
78
110
|
"outer_wall_filament_id",
|
|
79
111
|
"outer_wall_flow_ratio",
|
|
112
|
+
"outer_wall_jerk",
|
|
80
113
|
"outer_wall_line_width",
|
|
81
114
|
"outer_wall_speed",
|
|
82
115
|
"precise_outer_wall",
|
|
@@ -90,6 +123,7 @@ export const KERNEL_SETTING_KEYS = [
|
|
|
90
123
|
"raft_expansion",
|
|
91
124
|
"raft_layers",
|
|
92
125
|
"reduce_crossing_wall",
|
|
126
|
+
"reduce_infill_retraction",
|
|
93
127
|
"resolution",
|
|
94
128
|
"retraction_length",
|
|
95
129
|
"retraction_minimum_travel",
|
|
@@ -98,15 +132,22 @@ export const KERNEL_SETTING_KEYS = [
|
|
|
98
132
|
"seam_position",
|
|
99
133
|
"seam_slope_type",
|
|
100
134
|
"set_other_flow_ratios",
|
|
135
|
+
"single_extruder_multi_material",
|
|
101
136
|
"skirt_distance",
|
|
102
137
|
"skirt_height",
|
|
103
138
|
"skirt_loops",
|
|
139
|
+
"skirt_speed",
|
|
104
140
|
"slow_down_layer_time",
|
|
141
|
+
"slow_down_layers",
|
|
142
|
+
"small_perimeter_speed",
|
|
143
|
+
"small_perimeter_threshold",
|
|
144
|
+
"sparse_infill_acceleration",
|
|
105
145
|
"sparse_infill_density",
|
|
106
146
|
"sparse_infill_filament_id",
|
|
107
147
|
"sparse_infill_flow_ratio",
|
|
108
148
|
"sparse_infill_line_width",
|
|
109
149
|
"sparse_infill_pattern",
|
|
150
|
+
"sparse_infill_speed",
|
|
110
151
|
"spiral_mode",
|
|
111
152
|
"support_angle",
|
|
112
153
|
"support_base_pattern",
|
|
@@ -120,24 +161,31 @@ export const KERNEL_SETTING_KEYS = [
|
|
|
120
161
|
"support_interface_flow_ratio",
|
|
121
162
|
"support_interface_pattern",
|
|
122
163
|
"support_interface_spacing",
|
|
164
|
+
"support_interface_speed",
|
|
123
165
|
"support_interface_top_layers",
|
|
124
166
|
"support_line_width",
|
|
125
167
|
"support_object_first_layer_gap",
|
|
126
168
|
"support_object_xy_distance",
|
|
127
169
|
"support_on_build_plate_only",
|
|
128
170
|
"support_remove_small_overhang",
|
|
171
|
+
"support_speed",
|
|
129
172
|
"support_style",
|
|
130
173
|
"support_threshold_angle",
|
|
131
174
|
"support_threshold_overlap",
|
|
132
175
|
"support_top_z_distance",
|
|
133
176
|
"support_type",
|
|
134
177
|
"thick_bridges",
|
|
178
|
+
"time_lapse_gcode",
|
|
135
179
|
"top_bottom_infill_wall_overlap",
|
|
136
180
|
"top_shell_layers",
|
|
137
181
|
"top_solid_infill_flow_ratio",
|
|
182
|
+
"top_surface_acceleration",
|
|
138
183
|
"top_surface_filament_id",
|
|
184
|
+
"top_surface_jerk",
|
|
139
185
|
"top_surface_line_width",
|
|
186
|
+
"top_surface_speed",
|
|
140
187
|
"travel_acceleration",
|
|
188
|
+
"travel_jerk",
|
|
141
189
|
"travel_speed",
|
|
142
190
|
"tree_support_angle_slow",
|
|
143
191
|
"tree_support_branch_angle",
|
|
@@ -150,6 +198,8 @@ export const KERNEL_SETTING_KEYS = [
|
|
|
150
198
|
"tree_support_tip_diameter",
|
|
151
199
|
"tree_support_top_rate",
|
|
152
200
|
"tree_support_wall_count",
|
|
201
|
+
"use_firmware_retraction",
|
|
202
|
+
"use_relative_e_distances",
|
|
153
203
|
"wall_direction",
|
|
154
204
|
"wall_generator",
|
|
155
205
|
"wall_loops",
|
|
@@ -157,4 +207,5 @@ export const KERNEL_SETTING_KEYS = [
|
|
|
157
207
|
"wipe_tower_x",
|
|
158
208
|
"wipe_tower_y",
|
|
159
209
|
"z_hop",
|
|
210
|
+
"z_offset",
|
|
160
211
|
]
|