Aufbau der Planquadrate nur durch Boundingboxen. Ansonsten werden die Bereiche der Lage nicht korrekt erzeugt
This commit is contained in:
+12
-4
@@ -432,20 +432,28 @@ def bbox_columns(block):
|
||||
|
||||
|
||||
def planquadrat_column(block, planquadrat_cfg):
|
||||
"""Berechnet das Planquadrat aus x/y des Blocks (siehe export_planquadrat.py).
|
||||
"""Berechnet das Planquadrat aus der Bounding-Box des Blocks, falls
|
||||
vorhanden (siehe export_planquadrat.py), sonst aus dem Einfuegepunkt.
|
||||
|
||||
planquadrat_cfg = Rueckgabe von resolve_origins() fuer den aktuellen
|
||||
Exportlauf (x_origin_mm/y_origin_mm bereits aufgeloest).
|
||||
Leerer String, wenn keine Planquadrat-Konfiguration geladen werden konnte
|
||||
(fehlende/unvollstaendige [Planquadrate]-Sektion in cfg/export.cfg).
|
||||
|
||||
Ueberdeckt die Bounding-Box des Elements mehr als eine Zelle (z.B. ein
|
||||
Kreisel oder eine lange VarioFoerderer-Kette), liefert compute_planquadrat
|
||||
eine SPANNE "start-ende" (z.B. "A/1-J/1") statt nur der Mittelpunkt-Zelle.
|
||||
"""
|
||||
if planquadrat_cfg is None:
|
||||
return ""
|
||||
x = block.get("x")
|
||||
y = block.get("y")
|
||||
bbox = block.get("bbox") or {}
|
||||
x = bbox.get("cx", block.get("x"))
|
||||
y = bbox.get("cy", block.get("y"))
|
||||
if x is None or y is None:
|
||||
return ""
|
||||
return compute_planquadrat(float(x), float(y), planquadrat_cfg)
|
||||
dx = bbox.get("dx", 0.0)
|
||||
dy = bbox.get("dy", 0.0)
|
||||
return compute_planquadrat(float(x), float(y), planquadrat_cfg, dx_mm=float(dx), dy_mm=float(dy))
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user