Quellcode durchsuchen

radii from styles

Lukas Goldschmidt vor 1 Monat
Ursprung
Commit
659703bdcf
2 geänderte Dateien mit 37 neuen und 32 gelöschten Zeilen
  1. 14 28
      src/astro_mcp/chart_renderer.py
  2. 23 4
      src/astro_mcp/chart_styles.py

+ 14 - 28
src/astro_mcp/chart_renderer.py

@@ -37,6 +37,20 @@ from .chart_styles import (
     ANGULAR_HOUSES,
     font_face_css,
     r as _r,
+    _R_OUTER,
+    _R_TICK_OUTER,
+    _R_TICK_INNER_5,
+    _R_TICK_INNER_1,
+    _R_ZODIAC_OUTER,
+    _R_ZODIAC_GLYPH,
+    _R_ZODIAC_INNER,
+    _R_HOUSE_NUM,
+    _R_CUSP_INNER,
+    _R_PLANET,
+    _R_PLANET_DEG,
+    _R_CONNECTOR,
+    _R_CENTER,
+    _R_ASPECT,
 )
 from .chart_helpers import svg_to_image, render_envelope
 
@@ -117,25 +131,6 @@ def _format_degree(deg_float: float) -> str:
     return f"{d}\u00b0{m:02d}\u2019"
 
 
-# ── Ring proportion constants (as fraction of outer_r) ────────────────
-# These mirror professional chart proportions.
-# outer_r = 1.0 (the canvas half-size)
-_R_OUTER        = 1.000   # outermost edge, tick marks end here
-_R_TICK_OUTER   = 0.980   # outer tick root (5° ticks)
-_R_TICK_INNER_5 = 0.955   # 5° tick inner end
-_R_TICK_INNER_1 = 0.967   # 1° tick inner end  (not drawn at this res)
-_R_ZODIAC_OUTER = 0.940   # outer zodiac band edge (stroke circle)
-_R_ZODIAC_GLYPH = 0.855   # center of zodiac band ((0.940+0.770)/2)
-_R_ZODIAC_INNER = 0.770   # inner zodiac band edge (stroke circle)
-_R_HOUSE_NUM    = 0.700   # house number label position
-_R_CUSP_INNER   = 0.350   # house cusp lines extend inward to here
-_R_PLANET       = 0.595   # planet glyph centre
-_R_PLANET_DEG   = 0.490   # planet degree label (inside glyph)
-_R_CONNECTOR    = 0.760   # connector tick inner end (near inner zodiac edge)
-_R_CENTER       = 0.280   # inner center circle radius (was 0.18)
-_R_ASPECT       = 0.345   # aspect lines drawn at this radius from center
-
-
 # ── Main natal wheel renderer ─────────────────────────────────────────
 
 def render_natal_wheel(
@@ -305,15 +300,6 @@ def render_natal_wheel(
         c1 = _svg_angle(cusp_lon,  asc_lon)
         c2 = _svg_angle(next_cusp, asc_lon)
 
-        # Alternating sector fill inside the house ring
-        if style != "minimal" and color_mode != "bw":
-            fill_c = theme["house_fill_alt"] if i % 2 == 0 else "none"
-            if fill_c != "none":
-                sx, sy = _polar_to_cartesian(wheel_cx, wheel_cy, r_zod_in, c1)
-                arc    = _arc_path(wheel_cx, wheel_cy, r_zod_in, c1, c2, sweep=0)
-                path_d = f"M {wheel_cx:.2f},{wheel_cy:.2f} L {sx:.2f},{sy:.2f} {arc} Z"
-                dwg.add(dwg.path(d=path_d, fill=fill_c, stroke="none"))
-
         # Cusp line from inner zodiac edge inward
         is_angular = house.get("house", i + 1) in ANGULAR_HOUSES
         sx, sy = _polar_to_cartesian(wheel_cx, wheel_cy, r_cusp_in,  c1)

+ 23 - 4
src/astro_mcp/chart_styles.py

@@ -175,8 +175,27 @@ COLOR_ASPECT_STYLES: dict[str, tuple[str, float]] = {
 ANGULAR_HOUSES = {1, 4, 7, 10}
 
 # ── Ring proportion constants (as fraction of outer_r) ────────────────
-# These mirror professional chart proportions.
-# outer_r = 1.0 (the canvas half-size)
+# These are the CANONICAL ring radii, defined here in one place.
+# chart_renderer.py imports these directly — do NOT redefine them there.
+#
+# outer_r = canvas_half_size - 20  (for a 600px canvas, outer_r = 280)
+#
+# Layout (outermost → innermost):
+#   _R_OUTER (1.000)     — outermost edge, tick marks end here
+#   _R_TICK_OUTER (0.980) — outer tick root
+#   _R_ZODIAC_OUTER (0.940) — outer zodiac band edge
+#   _R_ZODIAC_GLYPH (0.855) — center of zodiac band (sign glyph position)
+#   _R_ZODIAC_INNER (0.770) — inner zodiac band edge
+#   _R_CONNECTOR (0.760) — connector tick inner end (near inner zodiac edge)
+#   _R_HOUSE_NUM (0.700) — house number label position
+#   _R_PLANET (0.595) — planet glyph centre
+#   _R_PLANET_DEG (0.490) — planet degree label position
+#   _R_CUSP_INNER (0.350) — house cusp lines inner end (= center circle radius)
+#   _R_CENTER (0.350) — center circle radius (house dividers end here)
+#   _R_ASPECT (0.350) — aspect lines touch the center circle edge
+#
+# To adjust any ring radius, edit the value below.
+# ────────────────────────────────────────────────────────────────────────
 
 _R_OUTER        = 1.000   # outermost edge, tick marks end here
 _R_TICK_OUTER   = 0.980   # outer tick root (5° ticks)
@@ -190,8 +209,8 @@ _R_CUSP_INNER   = 0.350   # house cusp lines extend inward to here
 _R_PLANET       = 0.595   # planet glyph centre
 _R_PLANET_DEG   = 0.490   # planet degree label (inside glyph)
 _R_CONNECTOR    = 0.760   # connector tick inner end (near inner zodiac edge)
-_R_CENTER       = 0.280   # inner center circle radius (was 0.18)
-_R_ASPECT       = 0.345   # aspect lines drawn at this radius from center
+_R_CENTER       = 0.350   # inner center circle radius (house dividers end here)
+_R_ASPECT       = 0.350   # aspect lines touch the center circle edge
 
 
 def r(outer_r: float, frac: float) -> float: