修正 LinuxCNC NURBS 平面映射

This commit is contained in:
cnc
2026-05-24 21:52:21 +08:00
parent b4861fd618
commit efc92d0380
3 changed files with 48 additions and 10 deletions

View File

@@ -472,6 +472,10 @@ cp "$base_var_file" "$var_file"
CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_g52_offset.ngc \
>/tmp/cnc_sim_linuxcnc_source_g52_offset.json
cp "$base_var_file" "$var_file"
CNC_SIM_RS274_VAR="$var_file" \
"$build_dir/linuxcnc_rs274_source_dump" tests/gcode/linuxcnc_g52_xz_nurbs.ngc \
>/tmp/cnc_sim_linuxcnc_source_g52_xz_nurbs.json
python3 - <<'PY'
import json
@@ -2026,6 +2030,17 @@ if g52_states != expected_g52_states:
raise SystemExit(f"unexpected source-linked 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 source-linked G52 offset program end line number")
g52_xz_nurbs = json.loads(Path("/tmp/cnc_sim_linuxcnc_source_g52_xz_nurbs.json").read_text())
if not any(
event["type"] == "linear-feed" 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 source-linked G18/XZ NURBS endpoint mapped to X/Z axes")
PY
echo "linuxcnc rs274 source link smoke passed (${#objects[@]} local objects)"
@@ -2112,3 +2127,4 @@ echo "dumped /tmp/cnc_sim_linuxcnc_source_coordinate_p0.json"
echo "dumped /tmp/cnc_sim_linuxcnc_source_coordinate_select_all.json"
echo "dumped /tmp/cnc_sim_linuxcnc_source_g92_restore.json"
echo "dumped /tmp/cnc_sim_linuxcnc_source_g52_offset.json"
echo "dumped /tmp/cnc_sim_linuxcnc_source_g52_xz_nurbs.json"