[REFACTOR] VF: L_GF/L_VF-Solve aus Winkelberechnung zentralisiert (vf-winkel-solve)
Der L_GF/L_VF-Solve-Block (aus A/B-Restbudget) war in berechne-alle-winkel (Standard) und berechne-winkel-etage byte-identisch. Als vf-winkel-solve (winkel richtung A B sinα cosEff sinEff sin3 cos3) -> (winkel L_GF L_VF gueltig) nach vf_core gezogen; beide Winkelberechnungen nutzen ihn jetzt. Bewusst NICHT vereinheitlicht: die A/B-Berechnung (Etage hat zusaetzliche 2*schraeg-/2*gef-/2*feste-Terme, Standard nutzt feste-hz) und die Ergebnis- tabelle (unterschiedliche Message-Keys/Arg-Form) - beides birgt Geometrie-/ Ausgaberisiko fuer geringen Zeilengewinn. Der identische, geometrie-kritische Solve ist der wertvolle Teil. test_foerderer.py (Winkel-Set, Monotonie, L_GF/L_VF>0) validiert das direkt. Paren-Balance geprueft. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -592,6 +592,30 @@
|
||||
(- (cadr (car fa)) (cadr (car fe))))
|
||||
nil))))
|
||||
|
||||
;; Loest fuer einen Kandidatenwinkel L_GF/L_VF aus den vorberechneten
|
||||
;; Groessen A/B (horizontales/vertikales Rest-Budget). Identisch fuer Standard
|
||||
;; und Etage - nur die Berechnung von A/B unterscheidet sich (daher als
|
||||
;; Parameter). Rueckgabe: Ergebnistabellen-Eintrag (winkel L_GF L_VF gueltig)
|
||||
;; bzw. (winkel nil nil nil), wenn keine sinnvolle Loesung existiert.
|
||||
;; sin3/cos3 = sin/cos des Basis-Gefaellewinkels (3 Grad); sinEff/cosEff des
|
||||
;; effektiven Winkels; sinα des Kandidatenwinkels.
|
||||
(defun vf-winkel-solve (winkel richtung A B sinα cosEff sinEff sin3 cos3 / L_GF L_VF gueltig)
|
||||
(if (> (abs sinα) 0.0001)
|
||||
(progn
|
||||
(setq L_GF (/ (- (* A sinEff) (* B cosEff)) sinα))
|
||||
(if (= richtung "Auf")
|
||||
(setq L_VF (/ (+ (* A sin3) (* B cos3)) sinα))
|
||||
(setq L_VF (/ (- (* B cos3) (* A sin3)) sinα))
|
||||
)
|
||||
(if (and (numberp L_GF) (numberp L_VF))
|
||||
(progn
|
||||
(setq gueltig (and (>= L_GF 0) (>= L_VF 0)))
|
||||
(list winkel L_GF L_VF gueltig))
|
||||
(list winkel nil nil nil))
|
||||
)
|
||||
(list winkel nil nil nil))
|
||||
)
|
||||
|
||||
;; 30/90-Wahl fuer ein AS/ES-Element. Rueckgabe: "30" oder "90" (Vorgabe 90).
|
||||
;; headerkey: i18n-Key fuer die Kopfzeile ("vf-winkel-aus-header" oder
|
||||
;; "vf-winkel-ein-header"). Rueckgabe: "30" oder "90" (Default 90).
|
||||
|
||||
+3
-18
@@ -425,24 +425,9 @@
|
||||
bogen-z1
|
||||
bogen-z2))
|
||||
)
|
||||
(if (> (abs sinα) 0.0001)
|
||||
(progn
|
||||
(setq L_GF (/ (- (* A sinEff) (* B cosEff)) sinα))
|
||||
(if (= richtung "Auf")
|
||||
(setq L_VF (/ (+ (* A sin3) (* B cos3)) sinα))
|
||||
(setq L_VF (/ (- (* B cos3) (* A sin3)) sinα))
|
||||
)
|
||||
(if (and (numberp L_GF) (numberp L_VF))
|
||||
(progn
|
||||
(setq gueltig (and (>= L_GF 0) (>= L_VF 0)))
|
||||
(setq ergebnis-liste
|
||||
(cons (list winkel L_GF L_VF gueltig) ergebnis-liste))
|
||||
)
|
||||
(setq ergebnis-liste (cons (list winkel nil nil nil) ergebnis-liste))
|
||||
)
|
||||
)
|
||||
(setq ergebnis-liste (cons (list winkel nil nil nil) ergebnis-liste))
|
||||
)
|
||||
(setq ergebnis-liste
|
||||
(cons (vf-winkel-solve winkel richtung A B sinα cosEff sinEff sin3 cos3)
|
||||
ergebnis-liste))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
+3
-19
@@ -282,25 +282,9 @@
|
||||
(* feste-hz sin3))
|
||||
bogen-z1 bogen-z2))
|
||||
)
|
||||
(if (> (abs sinα) 0.0001)
|
||||
(progn
|
||||
(setq L_GF (/ (- (* A sinEff) (* B cosEff)) sinα))
|
||||
(if (= richtung "Auf")
|
||||
(setq L_VF (/ (+ (* A sin3) (* B cos3)) sinα))
|
||||
(setq L_VF (/ (- (* B cos3) (* A sin3)) sinα))
|
||||
)
|
||||
(if (and (numberp L_GF) (numberp L_VF))
|
||||
(progn
|
||||
(setq gueltig (and (>= L_GF 0) (>= L_VF 0)))
|
||||
(setq ergebnis-liste
|
||||
(cons (list winkel L_GF L_VF gueltig) ergebnis-liste))
|
||||
)
|
||||
(setq ergebnis-liste
|
||||
(cons (list winkel nil nil nil) ergebnis-liste))
|
||||
)
|
||||
)
|
||||
(setq ergebnis-liste (cons (list winkel nil nil nil) ergebnis-liste))
|
||||
)
|
||||
(setq ergebnis-liste
|
||||
(cons (vf-winkel-solve winkel richtung A B sinα cosEff sinEff sin3 cos3)
|
||||
ergebnis-liste))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user