nc-gcode-interpreter 0.3.1__tar.gz → 0.4.0__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.1 → nc_gcode_interpreter-0.4.0}/CHANGELOG.md +71 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/Cargo.lock +1 -1
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/Cargo.toml +1 -1
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/PKG-INFO +1 -1
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/README.md +1 -1
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/build_backend/nc_build_backend.py +11 -7
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/ggroups/generate_g_commands.py +14 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/nc_gcode_interpreter/ggroups.json +199 -151
- nc_gcode_interpreter-0.4.0/python/tests/test_bspline_pl.py +293 -0
- nc_gcode_interpreter-0.4.0/python/tests/test_build_backend.py +39 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_flatten.py +30 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_g_group_enum.py +28 -4
- nc_gcode_interpreter-0.4.0/python/tests/test_g_groups.py +64 -0
- nc_gcode_interpreter-0.4.0/python/tests/test_preset.py +156 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/flatten.rs +253 -26
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/grammar.pest +4 -4
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/interpret_rules.rs +160 -9
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/interpreter.rs +1 -1
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/line_driver.rs +28 -14
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/modal_groups.rs +44 -24
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/output.rs +20 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/start.rs +2 -2
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/state.rs +3 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/vm.rs +1 -0
- nc_gcode_interpreter-0.4.0/tests/syntax_compatibility.rs +154 -0
- nc_gcode_interpreter-0.3.1/python/tests/test_g_groups.py +0 -23
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/.github/workflows/benchmark.yml +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/.github/workflows/build-and-release.yml +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/.gitignore +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/CONTRIBUTING.md +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/Development.md +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/LICENSE +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/TODO.md +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/benches/extensions.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/benches/fixtures.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/benches/workloads.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/build.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/docs/resumable-interpretation-design.md +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/docs/sinumerik-execution-model.md +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/actual_position.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/actual_position.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/arc.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/arc.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/arrays.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/arrays.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/axis_index_assignment.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/axis_index_assignment.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/basic_math.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/basic_math.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/case.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/case.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/case_insensitive_variables.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/case_insensitive_variables.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/custom_vars.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/custom_vars.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/def_string.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/def_string.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/defaults.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/defaults.def +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/defaults.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/defaults_start.json +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/edge_cases.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/edge_cases.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/flattening/flatten_demo.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/flattening/flatten_demo_flattened.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/flattening/flatten_demo_raw.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/for_loop.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/for_loop.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/function_calls.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/function_calls.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/goto.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/goto.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/if_statement.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/if_statement.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/increment.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/increment.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/logic_operators.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/logic_operators.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/loop.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/loop.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/multiple_m_codes.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/multiple_m_codes.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/precedence.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/precedence.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/r_param.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/r_param.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/repeat.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/repeat.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/rot.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/rot.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/simple.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/simple.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/spline.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/spline.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/tool.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/tool.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trans.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trans.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trans2.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trans2.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trans_ic.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trans_ic.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trans_reset.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trans_reset.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trig.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/trig.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/variables.csv +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/examples/variables.mpf +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/pyproject.toml +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/example/minimal.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/example/streaming.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/nc_gcode_interpreter/__init__.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/nc_gcode_interpreter/_internal.pyi +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/nc_gcode_interpreter/cli.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/nc_gcode_interpreter/py.typed +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/nc_gcode_interpreter/viz.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/nc_source.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_arithmetic_functions.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_batch_variables.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_batches.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_compare_benchmarks.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_diagnostics.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_expected_output.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_feed_check.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_feed_group.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_field_defects.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_flags.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_frames.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_g_vocabulary.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_jumps.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_real_comparisons.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_stage1.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_start_inputs.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_streaming.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_string_operations.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_structured_errors.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_subprograms.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/python/tests/test_unsupported.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/rustfmt.toml +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/scripts/benchmark.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/scripts/compare_benchmarks.py +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/errors.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/frame.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/lib.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/line_driver/experiments.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/main.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/structure_scan.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/subprogram.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/src/types.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/tests/cli.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/tests/performance_contract.rs +0 -0
- {nc_gcode_interpreter-0.3.1 → nc_gcode_interpreter-0.4.0}/uv.lock +0 -0
|
@@ -4,6 +4,77 @@ 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.0] - 2026-11-23
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Breaking:** four G-group columns are renamed to the group numbers of the
|
|
12
|
+
SINUMERIK G-group list (#120). `gg58_dyn_resp_path` is now
|
|
13
|
+
`gg59_dyn_resp_path` (DYNNORM and the other DYN words, confirmed by
|
|
14
|
+
`$P_GG[59]` on a controller), `gg59_area_limit` is now `gg60_area_limit`
|
|
15
|
+
(WALCS0 to WALCS10), `gg53_tool_wear` is now `gg56_tool_wear` (TOWSTD and the
|
|
16
|
+
other TOW words) and `gg56_frame_rot_tool` is now `gg53_frame_rot_tool`
|
|
17
|
+
(TOROT, TOFRAME and their variants). The `nr` fields in `GGroups.g_groups`
|
|
18
|
+
change with them. The old names are not kept as aliases.
|
|
19
|
+
- `BSPLINE` flattening honours the knot distance `PL` (#121). When every
|
|
20
|
+
control-point block of the spline carries a `PL`, the curve is built on
|
|
21
|
+
non-uniform knots with the mapping measured on a SINUMERIK ONE: for a
|
|
22
|
+
cubic (`SD=3`) the knot spans take the `PL` of the second to the
|
|
23
|
+
second-to-last block, for a quadratic (`SD=2`) the `PL` of the first to the
|
|
24
|
+
second-to-last block. Only the ratios count, and a control point that
|
|
25
|
+
repeats its predecessor is dropped together with its `PL`. Before, `PL`
|
|
26
|
+
was ignored and such a program was flattened to a different curve than
|
|
27
|
+
the control runs.
|
|
28
|
+
- A `BSPLINE` without `PL` keeps uniform knots and its output is unchanged.
|
|
29
|
+
This case is an approximation of the control, whose knot rule without
|
|
30
|
+
`PL` is not identified.
|
|
31
|
+
- A `PL` on only some of the blocks, a `PL` that is not positive, or a `PL`
|
|
32
|
+
with a degree other than 2 or 3 is ignored with a warning, and the spline
|
|
33
|
+
is flattened on uniform knots.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- `PRESETON(<axis>, <value>, ...)` and `PRESETONS` set the axis value (#122).
|
|
38
|
+
The row of the call carries the new value, and later absolute and
|
|
39
|
+
incremental values start from it: `G1 E=10` / `PRESETON(E,0)` / `G1 E=4`
|
|
40
|
+
gives E 10, 0, 4, where the preset row kept 10 before. A preset before the
|
|
41
|
+
first value of an axis defines its start, so `E=IC(...)` no longer warns
|
|
42
|
+
about an unknown start and a flattened arc ramps the axis from the preset
|
|
43
|
+
value. The value is a machine value: under `TRANS` the frame stays active.
|
|
44
|
+
A preset of a name outside the configured axes warns and is not applied,
|
|
45
|
+
and a preset of a geometry axis under an active rotation is an error.
|
|
46
|
+
The preset row is not a movement: it needs no feed, and with flattening a
|
|
47
|
+
pending spline ends at its programmed endpoint before the preset. The call
|
|
48
|
+
must be alone in its block, apart from a block number and a comment.
|
|
49
|
+
- A flattened arc that carries an axis's first value as `IC(...)` ramps the
|
|
50
|
+
axis from the start of 0 the interpreter already assumes, instead of holding
|
|
51
|
+
the end value on every sample (#123). A consumer that takes differences saw
|
|
52
|
+
the whole change on the first chord. An absolute first value is still held,
|
|
53
|
+
because no start is known, and that warning is now printed once instead of
|
|
54
|
+
twice for an axis that is both a default and an extra axis.
|
|
55
|
+
- `GFRAME[n]` has number n+1 in `GGroups.g_groups`, as in the manual. Before,
|
|
56
|
+
`GFRAME[0]` and `GFRAME[1]` both had number 1.
|
|
57
|
+
- The G-command table gains the commands it lacked against the manual: `G646`
|
|
58
|
+
(group 10), `CUT3DCP` (group 22), `COMPPATH` (group 30), `ORIANGLE`,
|
|
59
|
+
`ORICURINV` and `ORIAXESFR` (group 51), and group 38 with `SPIF1` and `SPIF2`
|
|
60
|
+
as the column `gg38_punch_fast_io`. `G646` was rejected as an unknown G code,
|
|
61
|
+
and the keywords were recorded as subprogram calls.
|
|
62
|
+
|
|
63
|
+
## [v0.3.2] - 2026-11-13
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- A local build on Windows no longer fails with "metadata version does not
|
|
68
|
+
match". The build backend restored `Cargo.toml` and `Cargo.lock` with CRLF
|
|
69
|
+
line endings, so the tree looked modified to the next build phase, which
|
|
70
|
+
then stamped a different `.dirty` version. Both files now come back byte
|
|
71
|
+
for byte, and a CRLF `Cargo.toml` is stamped too.
|
|
72
|
+
- Accept Siemens numeric literals with leading-dot decimals (`X.5`,
|
|
73
|
+
`Z-.5`, `X=IC(.375)`) and explicit positive signs (`X+0.5`, `R1=+2`).
|
|
74
|
+
Zero-padded G and M codes (`G01`, `G017`, `M03`, `M030`) now use their
|
|
75
|
+
canonical spelling for interpretation and output, including frame and curve
|
|
76
|
+
handling. `start.g_groups` accepts padded codes too.
|
|
77
|
+
|
|
7
78
|
## [v0.3.1] - 2026-11-11
|
|
8
79
|
|
|
9
80
|
### Changed
|
|
@@ -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. 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.
|
|
@@ -39,7 +39,8 @@ from maturin import (
|
|
|
39
39
|
)
|
|
40
40
|
|
|
41
41
|
PLACEHOLDER = "0.0.0-dev"
|
|
42
|
-
|
|
42
|
+
# No trailing `$`: under MULTILINE it does not match before the `\r` of a CRLF file.
|
|
43
|
+
_VERSION_LINE = re.compile(rb'^version = "[^"\r\n]*"', re.MULTILINE)
|
|
43
44
|
# v0.2.6-3-g1234abc[-dirty]
|
|
44
45
|
_DESCRIBE = re.compile(r"^v(?P<tag>.+)-(?P<distance>\d+)-g(?P<sha>[0-9a-f]+)(?P<dirty>-dirty)?$")
|
|
45
46
|
|
|
@@ -71,8 +72,10 @@ def _versioned_cargo_toml():
|
|
|
71
72
|
root = Path(__file__).resolve().parent.parent
|
|
72
73
|
cargo_toml = root / "Cargo.toml"
|
|
73
74
|
cargo_lock = root / "Cargo.lock"
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
# Bytes throughout: text mode writes CRLF on Windows, which dirties the tree on restore
|
|
76
|
+
# and makes the next build phase stamp a different (.dirty) version.
|
|
77
|
+
original = cargo_toml.read_bytes()
|
|
78
|
+
if f'version = "{PLACEHOLDER}"'.encode() not in original:
|
|
76
79
|
# CI already stamped the release version; nothing to do.
|
|
77
80
|
yield
|
|
78
81
|
return
|
|
@@ -80,15 +83,16 @@ def _versioned_cargo_toml():
|
|
|
80
83
|
if version is None:
|
|
81
84
|
yield
|
|
82
85
|
return
|
|
83
|
-
lock_original = cargo_lock.
|
|
84
|
-
|
|
86
|
+
lock_original = cargo_lock.read_bytes() if cargo_lock.exists() else None
|
|
87
|
+
stamp = f'version = "{version}"'.encode()
|
|
88
|
+
cargo_toml.write_bytes(_VERSION_LINE.sub(lambda _: stamp, original, count=1))
|
|
85
89
|
try:
|
|
86
90
|
yield
|
|
87
91
|
finally:
|
|
88
|
-
cargo_toml.
|
|
92
|
+
cargo_toml.write_bytes(original)
|
|
89
93
|
# cargo rewrites the lock to match the patched version during the build.
|
|
90
94
|
if lock_original is not None:
|
|
91
|
-
cargo_lock.
|
|
95
|
+
cargo_lock.write_bytes(lock_original)
|
|
92
96
|
|
|
93
97
|
|
|
94
98
|
def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
|
|
@@ -22,6 +22,20 @@ lines = [
|
|
|
22
22
|
"// Auto-generated by ggroups/generate_g_commands.py from",
|
|
23
23
|
"// python/nc_gcode_interpreter/ggroups.json - do not edit by hand.",
|
|
24
24
|
"",
|
|
25
|
+
"/// Canonical spelling of a G word: uppercase, and numbered codes lose",
|
|
26
|
+
"/// their leading zeros (g001 -> G1, manual 3.2.2.1). Keywords only change case.",
|
|
27
|
+
"pub fn normalize_g_command(word: &str) -> String {",
|
|
28
|
+
" let mut code = word.to_ascii_uppercase();",
|
|
29
|
+
" if let Some(digits) = code.strip_prefix('G') {",
|
|
30
|
+
" if !digits.is_empty() && digits.bytes().all(|b| b.is_ascii_digit()) {",
|
|
31
|
+
" let zeros = digits.bytes().take_while(|&b| b == b'0').count();",
|
|
32
|
+
" let remove = zeros.min(digits.len() - 1);",
|
|
33
|
+
" code.drain(1..1 + remove);",
|
|
34
|
+
" }",
|
|
35
|
+
" }",
|
|
36
|
+
" code",
|
|
37
|
+
"}",
|
|
38
|
+
"",
|
|
25
39
|
"/// Classify an (uppercased) G-command word: the G-group column it",
|
|
26
40
|
"/// belongs to, and whether that group is modal. `None` means the word",
|
|
27
41
|
"/// is not a known G command.",
|