From e71b9146e1bb9bc3d210a47afed42317fbec8ca6 Mon Sep 17 00:00:00 2001 From: cnc Date: Wed, 3 Jun 2026 06:09:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E8=80=83=E6=89=80=E6=9C=89=E5=88=86?= =?UTF-8?q?=E7=BB=84=EF=BC=9A=E8=A1=A5=20G76=20=E5=92=8C=20NURBS=20native?= =?UTF-8?q?=20=E8=A6=86=E7=9B=96=EF=BC=8C=E6=B5=8B=E8=AF=95=E9=80=9A?= =?UTF-8?q?=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/linuxcnc-porting.md | 5 ++- test-linuxcnc-rs274-native.sh | 72 +++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/docs/linuxcnc-porting.md b/docs/linuxcnc-porting.md index d21bc01..5a93c98 100644 --- a/docs/linuxcnc-porting.md +++ b/docs/linuxcnc-porting.md @@ -202,7 +202,7 @@ This matrix tracks LinuxCNC feature coverage for the web/WASM simulator. A featu | Spindle, coolant, program stops, and current tool number `M3/M4/M5`, `M7/M8/M9`, `M0/M1/M60/M30`, `M61 Q...` | covered through LinuxCNC native/source backends, including native/source `convert_m()` rejection of out-of-range `M3/M4/M5 $` spindle selectors and negative `M61 Q` | `tests/gcode/linuxcnc_spindle_direction.ngc`, `tests/gcode/linuxcnc_coolant.ngc`, `tests/gcode/linuxcnc_program_stops.ngc`, `tests/gcode/linuxcnc_tool_number.ngc`, `tests/gcode/linuxcnc_m3_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_m4_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_m5_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_m61_negative_q_error.ngc` | | Spindle speed mode `G96/G97` | covered with Canon `SET_SPINDLE_MODE` preserved as mode state events, including `G96 D...` max-RPM value and native/source `check_other_codes()` rejection of missing `S` with `G96` | `tests/gcode/linuxcnc_spindle_modes.ngc`, `tests/gcode/linuxcnc_g96_missing_s_word_error.ngc` | | Spindle orientation `M19 R... P... Q...` | covered with Canon `ORIENT_SPINDLE` and `WAIT_SPINDLE_ORIENT_COMPLETE` preserved as temporary mode state events, including native/source `check_other_codes()` validation for `P/R` words and `convert_m()` rejection of out-of-range `$` selectors and nonpositive `Q` waits | `tests/gcode/linuxcnc_spindle_orient.ngc`, `tests/gcode/linuxcnc_m19_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_m19_p_not_integer_error.ngc`, `tests/gcode/linuxcnc_m19_p_out_of_range_error.ngc`, `tests/gcode/linuxcnc_m19_r_out_of_range_error.ngc`, `tests/gcode/linuxcnc_m19_zero_q_error.ngc` | -| Spindle-synchronized feed and threading `G33/G33.1/G76` | covered through smoke, LinuxCNC native, and source-linked paths with Canon `START_SPEED_FEED_SYNCH`/`STOP_SPEED_FEED_SYNCH` preserved, rigid-tap line numbers normalized, G76 multi-pass threading smoke-covered, native/source `check_other_codes()` validation for required/disallowed `K/F/P/I/J` words, and source-linked `convert_straight()`/`convert_threading_cycle()` rejection of invalid spindle state, spindle selector, rotary-axis motion, and G76 `I/J/K` geometry | `tests/gcode/linuxcnc_threading_sync.ngc`, `tests/gcode/linuxcnc_threading_cycle.ngc`, `tests/gcode/linuxcnc_g33_missing_k_word_error.ngc`, `tests/gcode/linuxcnc_g33_f_word_error.ngc`, `tests/gcode/linuxcnc_g33_1_missing_k_word_error.ngc`, `tests/gcode/linuxcnc_g33_1_f_word_error.ngc`, `tests/gcode/linuxcnc_g76_missing_p_word_error.ngc`, `tests/gcode/linuxcnc_g76_missing_i_word_error.ngc`, `tests/gcode/linuxcnc_g76_missing_j_word_error.ngc`, `tests/gcode/linuxcnc_g76_missing_k_word_error.ngc`, `tests/gcode/linuxcnc_g33_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_g33_1_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_g33_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g33_1_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g76_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g76_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_g76_rotary_axis_error.ngc`, `tests/gcode/linuxcnc_g76_i_zero_error.ngc`, `tests/gcode/linuxcnc_g76_j_zero_error.ngc`, `tests/gcode/linuxcnc_g76_k_less_equal_j_error.ngc`, smoke API regression | +| Spindle-synchronized feed and threading `G33/G33.1/G76` | covered through smoke, LinuxCNC native, and source-linked paths with Canon `START_SPEED_FEED_SYNCH`/`STOP_SPEED_FEED_SYNCH` preserved, rigid-tap line numbers normalized, G76 multi-pass threading smoke-covered, native/source `check_other_codes()` validation for required/disallowed `K/F/P/I/J` words, and native/source `convert_straight()`/`convert_threading_cycle()` coverage for standalone G76 and rejection of invalid spindle state, spindle selector, rotary-axis motion, and G76 `I/J/K` geometry | `tests/gcode/linuxcnc_threading_sync.ngc`, `tests/gcode/linuxcnc_threading_cycle.ngc`, `tests/gcode/linuxcnc_g76only.ngc`, `tests/gcode/linuxcnc_g33_missing_k_word_error.ngc`, `tests/gcode/linuxcnc_g33_f_word_error.ngc`, `tests/gcode/linuxcnc_g33_1_missing_k_word_error.ngc`, `tests/gcode/linuxcnc_g33_1_f_word_error.ngc`, `tests/gcode/linuxcnc_g76_missing_p_word_error.ngc`, `tests/gcode/linuxcnc_g76_missing_i_word_error.ngc`, `tests/gcode/linuxcnc_g76_missing_j_word_error.ngc`, `tests/gcode/linuxcnc_g76_missing_k_word_error.ngc`, `tests/gcode/linuxcnc_g33_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_g33_1_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_g33_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g33_1_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g76_spindle_dollar_out_of_range_error.ngc`, `tests/gcode/linuxcnc_g76_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_g76_rotary_axis_error.ngc`, `tests/gcode/linuxcnc_g76_i_zero_error.ngc`, `tests/gcode/linuxcnc_g76_j_zero_error.ngc`, `tests/gcode/linuxcnc_g76_k_less_equal_j_error.ngc`, smoke API regression | | Lathe diameter/radius mode `G7/G8` | covered through LinuxCNC native/source backends for same-block X scaling, `G76` I/J/K threading geometry interaction, and `#<_lathe_diameter_mode>`/`#<_lathe_radius_mode>` readonly named-parameter state | `tests/gcode/linuxcnc_lathe_diameter_mode.ngc`, `tests/gcode/linuxcnc_lathe_diameter_g76.ngc` | | Digital/analog I/O `M62`-`M68` | covered with Canon digital output, analog output, and input wait callbacks preserved as temporary state events, including native/source `convert_m()` validation for required `P`/`E`, M66 input selection, M66 wait timeout, and analog wait restrictions | `tests/gcode/linuxcnc_io_controls.ngc`, `tests/gcode/linuxcnc_m62_missing_p_word_error.ngc`, `tests/gcode/linuxcnc_m63_missing_p_word_error.ngc`, `tests/gcode/linuxcnc_m64_missing_p_word_error.ngc`, `tests/gcode/linuxcnc_m65_missing_p_word_error.ngc`, `tests/gcode/linuxcnc_m66_missing_input_error.ngc`, `tests/gcode/linuxcnc_m66_both_inputs_error.ngc`, `tests/gcode/linuxcnc_m66_zero_timeout_error.ngc`, `tests/gcode/linuxcnc_m66_analog_wait_error.ngc`, `tests/gcode/linuxcnc_m67_missing_e_word_error.ngc`, `tests/gcode/linuxcnc_m68_missing_e_word_error.ngc` | | Override controls `M48`-`M53` | covered with Canon feed override, spindle speed override, adaptive feed, and feed hold callbacks preserved as temporary state events | `tests/gcode/linuxcnc_override_controls.ngc` | @@ -210,8 +210,9 @@ This matrix tracks LinuxCNC feature coverage for the web/WASM simulator. A featu | LinuxCNC read-only named parameters | common modal/unit/feed/spindle reads and additional ccomp/spindle-mode readonly reads are covered through LinuxCNC native/source backends | `tests/gcode/linuxcnc_readonly_named_parameters.ngc`, `tests/gcode/linuxcnc_readonly_named_parameters_extra.ngc`, `tests/gcode/linuxcnc_lathe_diameter_mode.ngc` | | LinuxCNC numbered parameters | native/source coverage checks readonly numbered-parameter rejection plus probe, tool, G28/G30, G52/G92, G5X/G59.3, debug/M66 result, tool-offset, and current-position numbered parameters from LinuxCNC source state | `tests/gcode/linuxcnc_numbered_parameters.ngc`, `tests/gcode/linuxcnc_rotary_probe_numbered_parameters.ngc`, `tests/gcode/linuxcnc_multi_rotary_probe_numbered_parameters.ngc`, `tests/gcode/linuxcnc_tool_info_zero_parameter.ngc`, `tests/gcode/linuxcnc_spindle_tool_info_parameter.ngc`, `tests/gcode/linuxcnc_readonly_numbered_parameter_assign_error.ngc`, `tests/gcode/linuxcnc_g28_g30_numbered_parameters.ngc`, `tests/gcode/linuxcnc_rotary_g28_g30_numbered_parameters.ngc`, `tests/gcode/linuxcnc_g92_numbered_parameters.ngc`, `tests/gcode/linuxcnc_rotary_g92_numbered_parameters.ngc`, `tests/gcode/linuxcnc_g52_g92_numbered_interaction.ngc`, `tests/gcode/linuxcnc_g5x_numbered_parameters.ngc`, `tests/gcode/linuxcnc_g59_3_numbered_parameters.ngc`, `tests/gcode/linuxcnc_g59_3_rotary_numbered_parameters.ngc`, `tests/gcode/linuxcnc_g5x_rotary_numbered_parameters.ngc`, `tests/gcode/linuxcnc_g54_rotary_numbered_parameters.ngc`, `tests/gcode/linuxcnc_debug_level_parameter.ngc`, `tests/gcode/linuxcnc_m66_result_parameter.ngc`, `tests/gcode/linuxcnc_tool_offset_numbered_parameters.ngc`, `tests/gcode/linuxcnc_rotary_tool_offset_numbered_parameters.ngc`, `tests/gcode/linuxcnc_current_position_numbered_parameters.ngc` | | Feed and motion control modes `G93/G94/G95`, `G61/G61.1/G64` | covered through LinuxCNC native/source backends | `tests/gcode/linuxcnc_feed_modes.ngc`, `tests/gcode/linuxcnc_motion_modes.ngc` | -| Canned cycle `G73`-`G89`/`G80` | covered for drilling expand-to-canon path, `G18/G19` plane-specific depth-axis mapping for representative drilling/boring cycles, and native/source LinuxCNC `interp_cycles.cc` validation of repeat counts, required R/depth words, invalid rotary axes including follow-up modal-cycle blocks, Q/P words, and spindle state | `tests/gcode/linuxcnc_canned_cycle.ngc`, `tests/gcode/linuxcnc_canned_cycles_extended.ngc`, `tests/gcode/linuxcnc_canned_cycle_planes.ngc`, `tests/gcode/linuxcnc_canned_cycle_l0_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_missing_r_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_missing_z_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g18_missing_y_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g19_missing_x_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_r_less_z_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g18_r_less_y_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g19_r_less_x_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_u_in_xy_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_a_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_b_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_c_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_reject_rotary_followup.ngc`, `tests/gcode/linuxcnc_canned_cycle_g73_missing_q_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g83_missing_q_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g73_q0_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g83_q0_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g82_missing_p_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g86_missing_p_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g88_missing_p_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g89_missing_p_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g74_clockwise_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g84_counterclockwise_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g74_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g84_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g86_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g88_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g87_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g87_missing_k_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g87_missing_i_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g87_missing_j_error.ngc` | +| Canned cycle `G73`-`G89`/`G80` | covered for drilling expand-to-canon path, `G18/G19` plane-specific depth-axis mapping for representative drilling/boring cycles, `G17.1` extended-plane depth/retract mapping, and native/source LinuxCNC `interp_cycles.cc` validation of repeat counts, required R/depth words, invalid rotary axes including follow-up modal-cycle blocks, Q/P words, and spindle state | `tests/gcode/linuxcnc_canned_cycle.ngc`, `tests/gcode/linuxcnc_canned_cycles_extended.ngc`, `tests/gcode/linuxcnc_canned_cycle_planes.ngc`, `tests/gcode/linuxcnc_extended_plane_cycle.ngc`, `tests/gcode/linuxcnc_canned_cycle_l0_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_missing_r_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_missing_z_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g18_missing_y_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g19_missing_x_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_r_less_z_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g18_r_less_y_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g19_r_less_x_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_u_in_xy_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_a_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_b_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_c_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_reject_rotary_followup.ngc`, `tests/gcode/linuxcnc_canned_cycle_g73_missing_q_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g83_missing_q_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g73_q0_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g83_q0_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g82_missing_p_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g86_missing_p_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g88_missing_p_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g89_missing_p_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g74_clockwise_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g84_counterclockwise_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g74_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g84_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g86_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g88_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g87_stopped_spindle_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g87_missing_k_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g87_missing_i_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g87_missing_j_error.ngc` | | Coordinate offset Canon events `G10 L2`, `G10 L20`, `G10 P0 active-system targeting`, `G54`-`G59.3` selection, `G52`, `G92/G92.1/G92.2/G92.3` | covered through LinuxCNC native/source backends, including all nine G5X indices | `tests/gcode/linuxcnc_coordinate_offsets.ngc`, `tests/gcode/linuxcnc_coordinate_l20.ngc`, `tests/gcode/linuxcnc_coordinate_p0.ngc`, `tests/gcode/linuxcnc_coordinate_select_all.ngc`, `tests/gcode/linuxcnc_g92_restore.ngc`, `tests/gcode/linuxcnc_g52_offset.ngc` | +| NURBS `G5.2/G5.3/G6.2` | covered through LinuxCNC native/source backends for `G18` XZ-plane endpoint mapping from `convert_nurbs()` | `tests/gcode/linuxcnc_g52_xz_nurbs.ngc`, `tests/gcode/linuxcnc_g62_xz_nurbs.ngc` | | Cutter compensation | covered for tool-table `G41/G42 D...` and explicit-radius `G41.1/G42.1/G40` through LinuxCNC native/source backends, plus native/source LinuxCNC rejection of tool changes, M66 waits, G71.0, retract-mode changes, arc exits, and gouging while compensation is active | `tests/gcode/linuxcnc_cutter_comp.ngc`, `tests/gcode/linuxcnc_cutter_comp_tool_change_error.ngc`, `tests/gcode/linuxcnc_cutter_comp_wait_input_error.ngc`, `tests/gcode/linuxcnc_cutter_comp_g71_error.ngc`, `tests/gcode/linuxcnc_canned_cycle_g98_retract_error.ngc`, `tests/gcode/linuxcnc_ccomp_arcexit_error.ngc`, `tests/gcode/linuxcnc_ccomp_gouging_error.ngc` | | Probe moves `G38.2/G38.3/G38.4/G38.5` | covered as distinct probe events with LinuxCNC `probe_type` preserved through smoke, native, and source-linked paths | `tests/gcode/linuxcnc_probe_no_error.ngc` | | O-word and Fanuc subroutines, calls, and control flow | covered for numeric and named `O... sub/call/return/endsub`, Fanuc-style `M98 P... L...`/`M99`, plus `if`/`elseif`/`else`, `while`, `repeat`, `do`/`while`, `break`, and `continue` through LinuxCNC file mode; native/source read errors cover malformed O-word commands, missing control-expression brackets, too many or empty call parameters, Fanuc-style `M98` missing `P`, and midline/comment-prefixed `M98` falling through to normal M-code handling; native/source execution errors cover duplicate/undefined/unmatched labels, out-of-context `return`/`endsub`, wrong subroutine close style, nested subroutine definitions, too many nested call levels, lowercase numeric labels, O-word state parameters, `EXISTS[]` word-value checks, and M98/O-word local-parameter style differences; smoke parser also covers named `O` sub/call/return/endsub and loop-control forms | `tests/gcode/smoke_oword_subprogram.ngc`, `tests/gcode/linuxcnc_named_oword_subprogram.ngc`, `tests/gcode/smoke_subprogram_m98.ngc`, `tests/gcode/linuxcnc_oword_control_flow.ngc`, `tests/gcode/linuxcnc_value_returned.ngc`, `tests/gcode/linuxcnc_call_level.ngc`, `tests/gcode/linuxcnc_exists_word_value.ngc`, `tests/gcode/linuxcnc_lowercase_numeric_oword.ngc`, `tests/gcode/linuxcnc_m98_mixed_styles_variables.ngc`, `tests/gcode/linuxcnc_oword_unknown_command_error.ngc`, `tests/gcode/linuxcnc_oword_unexpected_trailing_item_error.ngc`, `tests/gcode/linuxcnc_oword_if_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_oword_elseif_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_oword_while_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_oword_repeat_missing_bracket_error.ngc`, `tests/gcode/linuxcnc_oword_too_many_call_parameters_error.ngc`, `tests/gcode/linuxcnc_oword_empty_call_parameter_error.ngc`, `tests/gcode/linuxcnc_oword_too_many_call_levels_error.ngc`, `tests/gcode/linuxcnc_oword_endsub_without_sub_error.ngc`, `tests/gcode/linuxcnc_oword_return_without_sub_error.ngc`, `tests/gcode/linuxcnc_oword_duplicate_if_label_error.ngc`, `tests/gcode/linuxcnc_oword_elseif_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_else_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_endif_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_break_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_continue_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_endwhile_undefined_label_error.ngc`, `tests/gcode/linuxcnc_oword_elseif_no_matching_if_error.ngc`, `tests/gcode/linuxcnc_oword_break_no_matching_loop_error.ngc`, `tests/gcode/linuxcnc_oword_continue_no_matching_loop_error.ngc`, `tests/gcode/linuxcnc_oword_endrepeat_no_matching_repeat_error.ngc`, `tests/gcode/linuxcnc_oword_endif_no_matching_if_error.ngc`, `tests/gcode/linuxcnc_oword_endwhile_no_matching_while_error.ngc`, `tests/gcode/linuxcnc_oword_fanuc_requires_m99_error.ngc`, `tests/gcode/linuxcnc_oword_sub_requires_endsub_error.ngc`, `tests/gcode/linuxcnc_nested_subroutine_definition_error.ngc`, `tests/gcode/linuxcnc_m98_missing_p_word_error.ngc`, `tests/gcode/linuxcnc_midline_m98_error.ngc`, `tests/gcode/linuxcnc_comment_prefixed_m98_error.ngc` | diff --git a/test-linuxcnc-rs274-native.sh b/test-linuxcnc-rs274-native.sh index abf517b..08c30f1 100755 --- a/test-linuxcnc-rs274-native.sh +++ b/test-linuxcnc-rs274-native.sh @@ -459,6 +459,7 @@ CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linux # #<_lathe_radius_mode>. CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_lathe_diameter_mode.ngc >"$output_dir/cnc_sim_linuxcnc_lathe_diameter_mode.json" CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_lathe_diameter_g76.ngc >"$output_dir/cnc_sim_linuxcnc_lathe_diameter_g76.json" +CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g76only.ngc >"$output_dir/cnc_sim_linuxcnc_g76only.json" CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_tool_number.ngc >"$output_dir/cnc_sim_linuxcnc_tool_number.json" # Source basis: LinuxCNC src/emc/rs274ngc/interp_convert.cc # convert_tool_select() and convert_m() M61 both route through @@ -563,6 +564,7 @@ grep -Fq "Cannot put an a in canned cycle" \ "$output_dir/cnc_sim_linuxcnc_canned_cycle_reject_rotary_followup.err" CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_canned_cycles_extended.ngc >"$output_dir/cnc_sim_linuxcnc_canned_cycles_extended.json" CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_canned_cycle_planes.ngc >"$output_dir/cnc_sim_linuxcnc_canned_cycle_planes.json" +CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_extended_plane_cycle.ngc >"$output_dir/cnc_sim_linuxcnc_extended_plane_cycle.json" CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_arc_planes.ngc >"$output_dir/cnc_sim_linuxcnc_arc_planes.json" CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_arc_distance_modes.ngc >"$output_dir/cnc_sim_linuxcnc_arc_distance_modes.json" # Source basis: LinuxCNC src/emc/rs274ngc/interp_convert.cc convert_arc() @@ -916,6 +918,8 @@ cp "$base_var_file" "$var_file" CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g92_restore.ngc >"$output_dir/cnc_sim_linuxcnc_g92_restore.json" cp "$base_var_file" "$var_file" CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g52_offset.ngc >"$output_dir/cnc_sim_linuxcnc_g52_offset.json" +CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g52_xz_nurbs.ngc >"$output_dir/cnc_sim_linuxcnc_g52_xz_nurbs.json" +CNC_SIM_RS274_FILE_MODE=1 CNC_SIM_RS274_VAR="$var_file" "$build_dir/linuxcnc_rs274_dump" tests/gcode/linuxcnc_g62_xz_nurbs.ngc >"$output_dir/cnc_sim_linuxcnc_g62_xz_nurbs.json" CNC_SIM_RS274_NATIVE_OUTPUT_DIR="$output_dir" python3 - <<'PY' import json import os @@ -1198,6 +1202,21 @@ if not any( ): raise SystemExit("missing G7 diameter-mode G76 taper sync pitch") +g76only = load("cnc_sim_linuxcnc_g76only.json") +if not any( + event["type"] == "comment" and + event["line"] == 8 and + event["reserved"] == 3301 + for event in g76only +): + raise SystemExit("missing native G76 speed-feed sync start in g76only fixture") +if not any( + event["type"] == "program-end" and + event["line"] == 13 + for event in g76only +): + raise SystemExit("missing native G76-only program end") + tool_number = load("cnc_sim_linuxcnc_tool_number.json") if not any( event["type"] == "tool-change" and @@ -1442,6 +1461,31 @@ expected_plane_g87_sequence = [ if plane_g87_sequence != expected_plane_g87_sequence: raise SystemExit(f"unexpected G19 G87 plane sequence: {plane_g87_sequence!r}") +extended_plane_cycle = load("cnc_sim_linuxcnc_extended_plane_cycle.json") +if not any( + event["type"] == "linear-feed" and + event["line"] == 3 and + event["end"]["u"] == 1 and + event["end"]["v"] == 2 and + event["end"]["w"] == -1 + for event in extended_plane_cycle +): + raise SystemExit("missing native G17.1 G81 feed along W depth axis") +if not any( + event["type"] == "rapid" and + event["line"] == 3 and + event["end"]["u"] == 1 and + event["end"]["v"] == 2 and + event["end"]["w"] == 1 + for event in extended_plane_cycle +): + raise SystemExit("missing native G17.1 G81 retract to W R plane") +if not any( + event["type"] == "set-plane" and event["line"] == 7 and event["plane"] == 171 + for event in extended_plane_cycle +): + raise SystemExit("missing native cutter-comp-active G17.1 plane selection") + extended_cycle = load("cnc_sim_linuxcnc_canned_cycles_extended.json") if not any( event["type"] == "linear-feed" and @@ -2434,6 +2478,30 @@ if g52_states != expected_g52_states: raise SystemExit(f"unexpected G52 shared offset sequence: {g52_states!r}") if not any(event["type"] == "program-end" and event["line"] == 7 for event in g52_offset): raise SystemExit("missing G52 offset program end line number") + +g52_xz_nurbs = load("cnc_sim_linuxcnc_g52_xz_nurbs.json") +if not any( + event["type"] == "linear-feed" and + event["line"] == 6 and + event["plane"] == 18 and + event["end"]["x"] == 3 and + event["end"]["y"] == 0 and + event["end"]["z"] == 3 + for event in g52_xz_nurbs +): + raise SystemExit("missing native G18/XZ NURBS endpoint mapped to X/Z axes") + +g62_xz_nurbs = load("cnc_sim_linuxcnc_g62_xz_nurbs.json") +if not any( + event["type"] == "linear-feed" and + event["line"] == 16 and + event["plane"] == 18 and + event["end"]["x"] == 100 and + event["end"]["y"] == 0 and + event["end"]["z"] == 10 + for event in g62_xz_nurbs +): + raise SystemExit("missing native G18/XZ G6.2 NURBS point mapped to X/Z axes") PY echo "linuxcnc rs274 native smoke passed" @@ -2454,6 +2522,7 @@ echo "dumped $output_dir/cnc_sim_linuxcnc_threading_sync.json" echo "dumped $output_dir/cnc_sim_linuxcnc_threading_cycle.json" echo "dumped $output_dir/cnc_sim_linuxcnc_lathe_diameter_mode.json" echo "dumped $output_dir/cnc_sim_linuxcnc_lathe_diameter_g76.json" +echo "dumped $output_dir/cnc_sim_linuxcnc_g76only.json" echo "dumped $output_dir/cnc_sim_linuxcnc_tool_number.json" echo "dumped $output_dir/cnc_sim_linuxcnc_program_stops.json" echo "dumped $output_dir/cnc_sim_linuxcnc_coolant.json" @@ -2464,6 +2533,7 @@ echo "dumped $output_dir/cnc_sim_linuxcnc_dynamic_tool_length.json" echo "dumped $output_dir/cnc_sim_linuxcnc_canned_cycle.json" echo "dumped $output_dir/cnc_sim_linuxcnc_canned_cycles_extended.json" echo "dumped $output_dir/cnc_sim_linuxcnc_canned_cycle_planes.json" +echo "dumped $output_dir/cnc_sim_linuxcnc_extended_plane_cycle.json" echo "dumped $output_dir/cnc_sim_linuxcnc_arc_planes.json" echo "dumped $output_dir/cnc_sim_linuxcnc_arc_distance_modes.json" echo "dumped $output_dir/cnc_sim_linuxcnc_arc_center_tolerance_good_imperial.json" @@ -2514,3 +2584,5 @@ echo "dumped $output_dir/cnc_sim_linuxcnc_coordinate_p0.json" echo "dumped $output_dir/cnc_sim_linuxcnc_coordinate_select_all.json" echo "dumped $output_dir/cnc_sim_linuxcnc_g92_restore.json" echo "dumped $output_dir/cnc_sim_linuxcnc_g52_offset.json" +echo "dumped $output_dir/cnc_sim_linuxcnc_g52_xz_nurbs.json" +echo "dumped $output_dir/cnc_sim_linuxcnc_g62_xz_nurbs.json"