nc-gcode-interpreter 0.3.2__tar.gz → 0.4.1__tar.gz
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.
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/CHANGELOG.md +82 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/Cargo.lock +1 -1
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/Cargo.toml +1 -1
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/PKG-INFO +1 -1
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/README.md +1 -1
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/nc_gcode_interpreter/__init__.py +21 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/nc_gcode_interpreter/_internal.pyi +1 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/nc_gcode_interpreter/ggroups.json +199 -151
- nc_gcode_interpreter-0.4.1/python/tests/test_bspline_pl.py +343 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_flatten.py +30 -0
- nc_gcode_interpreter-0.4.1/python/tests/test_frame_columns.py +115 -0
- nc_gcode_interpreter-0.4.1/python/tests/test_g_groups.py +64 -0
- nc_gcode_interpreter-0.4.1/python/tests/test_preset.py +156 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/flatten.rs +276 -26
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/interpret_rules.rs +145 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/lib.rs +5 -1
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/line_driver.rs +14 -2
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/modal_groups.rs +30 -24
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/output.rs +49 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/state.rs +24 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/subprogram.rs +4 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/vm.rs +5 -0
- nc_gcode_interpreter-0.3.2/python/tests/test_g_groups.py +0 -23
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/.github/workflows/benchmark.yml +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/.github/workflows/build-and-release.yml +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/.gitignore +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/CONTRIBUTING.md +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/Development.md +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/LICENSE +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/TODO.md +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/benches/extensions.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/benches/fixtures.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/benches/workloads.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/build.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/build_backend/nc_build_backend.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/docs/resumable-interpretation-design.md +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/docs/sinumerik-execution-model.md +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/actual_position.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/actual_position.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/arc.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/arc.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/arrays.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/arrays.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/axis_index_assignment.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/axis_index_assignment.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/basic_math.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/basic_math.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/case.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/case.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/case_insensitive_variables.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/case_insensitive_variables.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/custom_vars.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/custom_vars.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/def_string.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/def_string.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/defaults.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/defaults.def +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/defaults.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/defaults_start.json +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/edge_cases.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/edge_cases.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/flattening/flatten_demo.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/flattening/flatten_demo_flattened.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/flattening/flatten_demo_raw.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/for_loop.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/for_loop.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/function_calls.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/function_calls.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/goto.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/goto.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/if_statement.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/if_statement.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/increment.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/increment.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/logic_operators.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/logic_operators.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/loop.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/loop.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/multiple_m_codes.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/multiple_m_codes.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/precedence.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/precedence.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/r_param.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/r_param.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/repeat.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/repeat.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/rot.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/rot.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/simple.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/simple.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/spline.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/spline.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/tool.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/tool.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trans.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trans.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trans2.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trans2.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trans_ic.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trans_ic.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trans_reset.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trans_reset.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trig.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/trig.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/variables.csv +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/examples/variables.mpf +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/ggroups/generate_g_commands.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/pyproject.toml +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/example/minimal.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/example/streaming.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/nc_gcode_interpreter/cli.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/nc_gcode_interpreter/py.typed +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/nc_gcode_interpreter/viz.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/nc_source.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_arithmetic_functions.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_batch_variables.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_batches.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_build_backend.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_compare_benchmarks.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_diagnostics.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_expected_output.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_feed_check.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_feed_group.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_field_defects.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_flags.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_frames.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_g_group_enum.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_g_vocabulary.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_jumps.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_real_comparisons.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_stage1.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_start_inputs.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_streaming.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_string_operations.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_structured_errors.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_subprograms.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/tests/test_unsupported.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/rustfmt.toml +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/scripts/benchmark.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/scripts/compare_benchmarks.py +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/errors.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/frame.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/grammar.pest +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/interpreter.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/line_driver/experiments.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/main.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/start.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/structure_scan.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/src/types.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/tests/cli.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/tests/performance_contract.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/tests/syntax_compatibility.rs +0 -0
- {nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/uv.lock +0 -0
|
@@ -4,6 +4,88 @@ Notable changes to **nc-gcode-interpreter**. The format loosely follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/); versions are git tags,
|
|
5
5
|
released to PyPI.
|
|
6
6
|
|
|
7
|
+
## [v0.4.1] - 2026-11-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `include_frame` on `nc_to_dataframe` and `nc_to_batches` (#130). When set,
|
|
12
|
+
every row carries the programmable frame that is active on it: the rotation
|
|
13
|
+
`R` as `frame_r11` to `frame_r33` (row by row) and the translation `t` as
|
|
14
|
+
`frame_tx`, `frame_ty`, `frame_tz`, in machine XYZ = R * local XYZ + t. The
|
|
15
|
+
values are written on the first row and on the first row after a change and
|
|
16
|
+
forward-filled like the axis columns. The interpreter does not rotate
|
|
17
|
+
programmed A/B/C values, so a consumer that needs the orientation in the
|
|
18
|
+
basic system can apply `R` itself. The columns are absent by default.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- `BSPLINE` flattening accepts `PL=0` as a knot distance of zero, a repeated
|
|
23
|
+
knot (#129). Before, any `PL=0` on a control-point block made the whole
|
|
24
|
+
spline fall back to uniform knots with a warning, unless that block happened
|
|
25
|
+
to repeat the previous position and was dropped, so the same `PL` values gave
|
|
26
|
+
different knots depending on where the spline started. A `PL=0` on a block
|
|
27
|
+
whose `PL` is not used (the first and last block of a cubic) no longer has an
|
|
28
|
+
effect. Two cases still warn and use uniform knots, because they would split
|
|
29
|
+
the curve and are not measured on a control: `PL=0` as often in succession as
|
|
30
|
+
the spline degree, and `PL=0` on the first or last knot span. A negative `PL`
|
|
31
|
+
warns as before.
|
|
32
|
+
|
|
33
|
+
## [v0.4.0] - 2026-11-23
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- **Breaking:** four G-group columns are renamed to the group numbers of the
|
|
38
|
+
SINUMERIK G-group list (#120). `gg58_dyn_resp_path` is now
|
|
39
|
+
`gg59_dyn_resp_path` (DYNNORM and the other DYN words, confirmed by
|
|
40
|
+
`$P_GG[59]` on a controller), `gg59_area_limit` is now `gg60_area_limit`
|
|
41
|
+
(WALCS0 to WALCS10), `gg53_tool_wear` is now `gg56_tool_wear` (TOWSTD and the
|
|
42
|
+
other TOW words) and `gg56_frame_rot_tool` is now `gg53_frame_rot_tool`
|
|
43
|
+
(TOROT, TOFRAME and their variants). The `nr` fields in `GGroups.g_groups`
|
|
44
|
+
change with them. The old names are not kept as aliases.
|
|
45
|
+
- `BSPLINE` flattening honours the knot distance `PL` (#121). When every
|
|
46
|
+
control-point block of the spline carries a `PL`, the curve is built on
|
|
47
|
+
non-uniform knots with the mapping measured on a SINUMERIK ONE: for a
|
|
48
|
+
cubic (`SD=3`) the knot spans take the `PL` of the second to the
|
|
49
|
+
second-to-last block, for a quadratic (`SD=2`) the `PL` of the first to the
|
|
50
|
+
second-to-last block. Only the ratios count, and a control point that
|
|
51
|
+
repeats its predecessor is dropped together with its `PL`. Before, `PL`
|
|
52
|
+
was ignored and such a program was flattened to a different curve than
|
|
53
|
+
the control runs.
|
|
54
|
+
- A `BSPLINE` without `PL` keeps uniform knots and its output is unchanged.
|
|
55
|
+
This case is an approximation of the control, whose knot rule without
|
|
56
|
+
`PL` is not identified.
|
|
57
|
+
- A `PL` on only some of the blocks, a `PL` that is not positive, or a `PL`
|
|
58
|
+
with a degree other than 2 or 3 is ignored with a warning, and the spline
|
|
59
|
+
is flattened on uniform knots.
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- `PRESETON(<axis>, <value>, ...)` and `PRESETONS` set the axis value (#122).
|
|
64
|
+
The row of the call carries the new value, and later absolute and
|
|
65
|
+
incremental values start from it: `G1 E=10` / `PRESETON(E,0)` / `G1 E=4`
|
|
66
|
+
gives E 10, 0, 4, where the preset row kept 10 before. A preset before the
|
|
67
|
+
first value of an axis defines its start, so `E=IC(...)` no longer warns
|
|
68
|
+
about an unknown start and a flattened arc ramps the axis from the preset
|
|
69
|
+
value. The value is a machine value: under `TRANS` the frame stays active.
|
|
70
|
+
A preset of a name outside the configured axes warns and is not applied,
|
|
71
|
+
and a preset of a geometry axis under an active rotation is an error.
|
|
72
|
+
The preset row is not a movement: it needs no feed, and with flattening a
|
|
73
|
+
pending spline ends at its programmed endpoint before the preset. The call
|
|
74
|
+
must be alone in its block, apart from a block number and a comment.
|
|
75
|
+
- A flattened arc that carries an axis's first value as `IC(...)` ramps the
|
|
76
|
+
axis from the start of 0 the interpreter already assumes, instead of holding
|
|
77
|
+
the end value on every sample (#123). A consumer that takes differences saw
|
|
78
|
+
the whole change on the first chord. An absolute first value is still held,
|
|
79
|
+
because no start is known, and that warning is now printed once instead of
|
|
80
|
+
twice for an axis that is both a default and an extra axis.
|
|
81
|
+
- `GFRAME[n]` has number n+1 in `GGroups.g_groups`, as in the manual. Before,
|
|
82
|
+
`GFRAME[0]` and `GFRAME[1]` both had number 1.
|
|
83
|
+
- The G-command table gains the commands it lacked against the manual: `G646`
|
|
84
|
+
(group 10), `CUT3DCP` (group 22), `COMPPATH` (group 30), `ORIANGLE`,
|
|
85
|
+
`ORICURINV` and `ORIAXESFR` (group 51), and group 38 with `SPIF1` and `SPIF2`
|
|
86
|
+
as the column `gg38_punch_fast_io`. `G646` was rejected as an unknown G code,
|
|
87
|
+
and the keywords were recorded as subprogram calls.
|
|
88
|
+
|
|
7
89
|
## [v0.3.2] - 2026-11-13
|
|
8
90
|
|
|
9
91
|
### Fixed
|
|
@@ -26,7 +26,7 @@ The **NC-GCode-Interpreter** offers a streamlined and efficient solution for int
|
|
|
26
26
|
|
|
27
27
|
- **Streaming interpretation**: `nc_to_rows(program)` yields `(line_no, row)` tuples lazily while the interpreter runs on a background thread — bounded output buffering, early exit by dropping the iterator (breaking out of a `for` loop over an anonymous iterator does this; a stored iterator keeps the run alive until it is deleted or garbage-collected), and source-line numbers for mapping trace rows back to the program. With `include_variables=True` it yields `(line_no, row, variables)` instead, exposing every variable assignment (`R1=R1+1`, `DEF`, FOR counters) as it happens — including blocks that only assign variables, which are invisible in the batch DataFrame.
|
|
28
28
|
|
|
29
|
-
- **Curve flattening**: pass `flatten_tolerance` (Python) or `--flatten-tolerance` (CLI) to convert curved motions — `G2`/`G3` arcs (`I`/`J`/`K` centre offsets or `CR=` radius form, `G17`/`G18`/`G19` planes, helical third axis with `TURN=` multi-turn support, full circles) and `ASPLINE`/`BSPLINE`/`CSPLINE` splines (including `PW` weights and `SD` degree) — into runs of plain `G1` rows in the same table format. `CIP`/`CT`/`POLY`/thread/involute blocks pass through unchanged with a warning; spline start/end conditions (`BAUTO`/`BNAT`/... ) are approximated by natural (CSPLINE) / Akima (ASPLINE) boundaries — see the `flatten` module docs for the full list of checked approximations. The single tolerance is the maximum deviation between the emitted polyline and the true curve, in path units: arcs use the exact sagitta bound, splines adaptive subdivision. The interpolation addresses (`I`/`J`/`K`/`CR`/`PW`/`SD`/`PL`) are consumed and do not appear in the output; sampled rows keep the source block's line number, and its other cells (`F`, `M`, comments, ...) ride on the first sample so modal behavior is preserved. Generated samples carry a `flattened = 1` marker column (never forward-filled); programmed positions stay null there, so filtering on null recovers the original toolpath points.
|
|
29
|
+
- **Curve flattening**: pass `flatten_tolerance` (Python) or `--flatten-tolerance` (CLI) to convert curved motions — `G2`/`G3` arcs (`I`/`J`/`K` centre offsets or `CR=` radius form, `G17`/`G18`/`G19` planes, helical third axis with `TURN=` multi-turn support, full circles) and `ASPLINE`/`BSPLINE`/`CSPLINE` splines (including `PW` weights and `SD` degree) — into runs of plain `G1` rows in the same table format. `CIP`/`CT`/`POLY`/thread/involute blocks pass through unchanged with a warning; spline start/end conditions (`BAUTO`/`BNAT`/... ) are approximated by natural (CSPLINE) / Akima (ASPLINE) boundaries — see the `flatten` module docs for the full list of checked approximations. A `BSPLINE` whose control-point blocks all carry a `PL` is built on those knot distances (cubic and quadratic, mapping measured on a SINUMERIK ONE). Without `PL` it is built on uniform knots, which is an approximation: the control's knots in that case are not uniform and the rule is not identified. A `PL` on only some of the blocks is ignored with a warning. `PL=0` repeats a knot; as often in succession as the spline degree, or on the first or last knot span, it is ignored with a warning. The single tolerance is the maximum deviation between the emitted polyline and the true curve, in path units: arcs use the exact sagitta bound, splines adaptive subdivision. The interpolation addresses (`I`/`J`/`K`/`CR`/`PW`/`SD`/`PL`) are consumed and do not appear in the output; sampled rows keep the source block's line number, and its other cells (`F`, `M`, comments, ...) ride on the first sample so modal behavior is preserved. Generated samples carry a `flattened = 1` marker column (never forward-filled); programmed positions stay null there, so filtering on null recovers the original toolpath points.
|
|
30
30
|
- **Toolpath visualization** (optional): with the `viz` extra (`pip install 'nc-gcode-interpreter[viz]'`), `nc_gcode_interpreter.viz.view_toolpath(df)` renders an interpreted toolpath in [threejs-viewer](https://pypi.org/project/threejs-viewer/) as an extruded bead tube with a draw-range animation replaying the program at feed-rate-proportional speed. Combined with `flatten_tolerance`, programmed points render orange and flattener-generated samples blue. The extra also installs the `nc-view` command: `nc-view part.mpf` interprets, flattens (default tolerance 0.1, `--no-flatten` to skip) and opens the animated toolpath in the browser; `--speed` sets the time-lapse factor (default 60 = one machine-minute per second).
|
|
31
31
|
- **Custom Axes**: Allows users to define additional axes beyond the standard `X`, `Y`, `Z`.
|
|
32
32
|
- **Definitions, variables and start state**: `definitions` takes the definition files a control loads (GUD/MGUD/UGUD `.DEF`: DEF and REDEF statements, assignments, comments; M17/M30/M2 ends a file), `variables` takes variable values checked against their declared type, and `start` takes the machine state at program start in the shape of the returned `state` dict (axes, frame, variables, modal G groups, feed, tool, transformation, FGROUP and FGREF radii). The G groups, feed, tool, transformation, FGROUP and FGREF fill the first output row; seeded G groups have the same `pl.Enum` dtype as the rest of the column. They are applied in that order, before the main program. In a definition file `CHANDATA(1)` is ignored, another channel is an error, `TRAFOOF` sets the start transformation to off (a later `start["transformation"]` wins), M0 and M1 are ignored, a subprogram call is an error, and assigning to an undeclared name is an error unless it is an R parameter or `allow_undefined_variables` is set.
|
{nc_gcode_interpreter-0.3.2 → nc_gcode_interpreter-0.4.1}/python/nc_gcode_interpreter/__init__.py
RENAMED
|
@@ -107,6 +107,11 @@ def _definition_texts(
|
|
|
107
107
|
return texts
|
|
108
108
|
|
|
109
109
|
|
|
110
|
+
_FRAME_COLUMNS = frozenset(
|
|
111
|
+
[f"frame_r{row}{column}" for row in (1, 2, 3) for column in (1, 2, 3)] + ["frame_tx", "frame_ty", "frame_tz"]
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
|
|
110
115
|
def _subprogram_texts(subprograms: "Mapping[str, str] | None") -> dict[str, str] | None:
|
|
111
116
|
return None if subprograms is None else dict(subprograms)
|
|
112
117
|
|
|
@@ -129,6 +134,7 @@ def nc_to_dataframe(
|
|
|
129
134
|
m_function_subprograms: "Mapping[int, str] | None" = None,
|
|
130
135
|
required_subprograms: "Iterable[str] | None" = None,
|
|
131
136
|
stop_on_setal: bool = False,
|
|
137
|
+
include_frame: bool = False,
|
|
132
138
|
) -> tuple[pl.DataFrame, dict]:
|
|
133
139
|
"""
|
|
134
140
|
Parses Sinumerik-flavored NC G-code and converts it into a Polars DataFrame along with the final state.
|
|
@@ -200,6 +206,16 @@ def nc_to_dataframe(
|
|
|
200
206
|
across a jump, matching the streaming `nc_to_rows`. Never
|
|
201
207
|
forward-filled; `dataframe_to_nc` ignores it. Default False (column
|
|
202
208
|
absent, output schema unchanged).
|
|
209
|
+
include_frame: bool, optional
|
|
210
|
+
If True, add the programmable frame (TRANS/ATRANS, ROT/AROT) that is
|
|
211
|
+
active on each row as twelve Float64 columns: `frame_r11` to
|
|
212
|
+
`frame_r33`, the rotation R row by row, and `frame_tx`, `frame_ty`,
|
|
213
|
+
`frame_tz`, the translation t, in machine XYZ = R * local XYZ + t.
|
|
214
|
+
The values are written on the first row and on the first row after
|
|
215
|
+
each change, and forward-filled like the axis columns; with
|
|
216
|
+
`disable_forward_fill` the other rows are null. Programmed A/B/C
|
|
217
|
+
values are not rotated by the interpreter, so a consumer can apply R
|
|
218
|
+
to them. Default False (columns absent).
|
|
203
219
|
|
|
204
220
|
Returns:
|
|
205
221
|
--------
|
|
@@ -258,6 +274,7 @@ def nc_to_dataframe(
|
|
|
258
274
|
stop_on_setal,
|
|
259
275
|
# No row is read before the run ends, so a provider call need not wait for one.
|
|
260
276
|
defer_rows=True,
|
|
277
|
+
include_frame=include_frame,
|
|
261
278
|
)
|
|
262
279
|
# pl.DataFrame wraps each Arrow record batch via __arrow_c_array__ (polars
|
|
263
280
|
# >= 1.3), no pyarrow needed. Exhaust the iterator before reading .state.
|
|
@@ -391,6 +408,8 @@ def sanitize_dataframe(
|
|
|
391
408
|
# dataframe_to_nc.
|
|
392
409
|
if "line_no" in df.columns:
|
|
393
410
|
df = df.drop("line_no")
|
|
411
|
+
# The `frame_*` columns (include_frame=True) report the frame; they are not NC words.
|
|
412
|
+
df = df.drop([name for name in df.columns if name in _FRAME_COLUMNS])
|
|
394
413
|
|
|
395
414
|
modal = [g["short_name"] for g in GGroups.g_groups if g["effectiveness"] == "modal"]
|
|
396
415
|
non_modal = [g["short_name"] for g in GGroups.g_groups if g["effectiveness"] != "modal"]
|
|
@@ -688,6 +707,7 @@ def nc_to_batches(
|
|
|
688
707
|
m_function_subprograms: "Mapping[int, str] | None" = None,
|
|
689
708
|
required_subprograms: "Iterable[str] | None" = None,
|
|
690
709
|
stop_on_setal: bool = False,
|
|
710
|
+
include_frame: bool = False,
|
|
691
711
|
) -> _BatchIterator:
|
|
692
712
|
"""Interpret an NC program into a stream of columnar polars DataFrames.
|
|
693
713
|
|
|
@@ -755,5 +775,6 @@ def nc_to_batches(
|
|
|
755
775
|
None if m_function_subprograms is None else dict(m_function_subprograms),
|
|
756
776
|
None if required_subprograms is None else list(required_subprograms),
|
|
757
777
|
stop_on_setal,
|
|
778
|
+
include_frame=include_frame,
|
|
758
779
|
)
|
|
759
780
|
return _BatchIterator(inner)
|