From 067cb56584038b9b692af7ab1b5449d6ac3ff121 Mon Sep 17 00:00:00 2001 From: karim Date: Tue, 26 May 2026 21:24:21 +0200 Subject: [PATCH] Massstab: Diagnose-Prints fuer _apply_scale (pre/post Magnify) --- rhino/massstab.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rhino/massstab.py b/rhino/massstab.py index d1bc267..55b988d 100644 --- a/rhino/massstab.py +++ b/rhino/massstab.py @@ -852,6 +852,10 @@ def _apply_scale(doc, vp, ratio): if not ok: return False cur_w = (r - l) if cur_w <= 0: return False + print("[MASSSTAB-DIAG] pw={} dpi={} mm/u={} screen_mm={:.2f} " + "new_frustum_mm={:.2f} new_frustum_u={:.4f} cur_w={:.4f} {}".format( + pw, dpi, mm_per_u, screen_mm, new_frustum_mm, new_frustum_u, + cur_w, str(doc.ModelUnitSystem))) # RhinoViewport.SetFrustum existiert nicht — wir benutzen Magnify(factor). # factor > 1 zoomt rein (kleineres Frustum). factor = cur_w / new_w. factor = cur_w / new_frustum_u @@ -879,6 +883,18 @@ def _apply_scale(doc, vp, ratio): ex1, ex2, ex3) if not applied: return False + # POST-Magnify: aktuellen Frustum nochmal lesen — wenn Magnify nicht + # greift (Mac-Rhino-Edge-Case), sehen wir das hier. + try: + ok2, l2, r2, b2, t2, n2, f2 = vp.GetFrustum() + if ok2: + actual_w = (r2 - l2) + ratio_actual_target = actual_w / new_frustum_u if new_frustum_u > 0 else 0 + print("[MASSSTAB-DIAG] Magnify({:.6f}) → actual_w={:.4f} " + "(target={:.4f}, ratio actual/target={:.4f})".format( + factor, actual_w, new_frustum_u, ratio_actual_target)) + except Exception as ex: + print("[MASSSTAB-DIAG] post-frustum-read:", ex) # PlotWeights nur skalieren wenn Print-Mode aktiv ist. try: if _get_lineweights_enabled(doc):