From da2ea10fe4a7b6d38789ce2ec1565b050578da5a Mon Sep 17 00:00:00 2001 From: denis svinarchuk Date: Thu, 16 Jul 2026 21:44:50 +0100 Subject: [PATCH] show_temp_plot: scale physical timeline by M73 trapezoid estimate Physical dist/speed ignores acceleration/deceleration, giving underestimated total time (29 min vs real 48 min). M73 from the trapezoid planner accounts for accel/decel and is closer to reality. Now we keep physical DISTRIBUTION (proportions per-filament) but scale the X-axis so total time matches M73 trapezoid estimate. --- tests/compare_analyzer/show_temp_plot.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/compare_analyzer/show_temp_plot.py b/tests/compare_analyzer/show_temp_plot.py index 667b2a88fd..e3322fb216 100755 --- a/tests/compare_analyzer/show_temp_plot.py +++ b/tests/compare_analyzer/show_temp_plot.py @@ -167,6 +167,20 @@ def build_timeline_and_interpolate(track, tool_changes, m73_points, total_lines, total_duration = t + # ── Scale physical timeline to match M73 trapezoid estimate ────── + # Physical dist/speed ignores acceleration/deceleration, giving an + # underestimated total (e.g. 29 min vs real 48 min). M73 from the + # trapezoid planner accounts for accel/decel and is closer to reality. + # We keep the physical DISTRIBUTION (proportions) but scale the X-axis + # so total time matches M73. + if m73_points and total_duration > 0: + m73_total_sec = max(p[1] for p in m73_points) * 60 # max R value → seconds + if m73_total_sec > total_duration: + scale = m73_total_sec / total_duration + for j in range(len(cumulative)): + cumulative[j] *= scale + total_duration *= scale + def get_time(line): idx = max(1, min(int(round(line)), len(cumulative) - 1)) return cumulative[idx]