Restore consistent Modern zodiac traces

This commit is contained in:
vini 2026-07-19 14:48:35 -03:00
parent af65162eb0
commit 3416cac155
2 changed files with 6 additions and 25 deletions

File diff suppressed because one or more lines are too long

View file

@ -15,10 +15,6 @@ STELLARIUM_URL = (
"https://raw.githubusercontent.com/Stellarium/stellarium/master/"
"skycultures/modern/index.json"
)
STELLARIUM_ST_URL = (
"https://raw.githubusercontent.com/Stellarium/stellarium/master/"
"skycultures/modern_st/index.json"
)
D3_BASE = "https://raw.githubusercontent.com/ofrohn/d3-celestial/master/data/"
OUT = Path(__file__).resolve().parent.parent / "plugin/contents/ui/constellations.js"
@ -37,14 +33,8 @@ ZODIAC = {
"Psc": "Peixes",
}
# Avaliados signo a signo. S&T costuma usar traçados mais ricos e próximos
# aos mapas populares, enquanto a arte continua vindo do conjunto Modern.
LINE_OVERRIDES = {"Lib": "modern_st"}
LICENSE = """Constellation lines: Stellarium Modern and Modern (S&T) sky cultures,
CC BY-SA 4.0.
LICENSE = """Constellation lines: Stellarium Modern sky culture, CC BY-SA 4.0.
https://github.com/Stellarium/stellarium/tree/master/skycultures/modern
https://github.com/Stellarium/stellarium/tree/master/skycultures/modern_st
Hipparcos J2000 coordinates: d3-celestial.
Copyright (c) 2015, Olaf Frohn
@ -78,10 +68,6 @@ def rounded_point(point: list[float]) -> list[float]:
def main() -> None:
sky_culture = fetch(STELLARIUM_URL)
sky_culture_st = fetch(STELLARIUM_ST_URL)
st_constellations = {
item["id"].split()[-1]: item for item in sky_culture_st["constellations"]
}
star_data = fetch(D3_BASE + "stars.8.json")["features"]
name_data = fetch(D3_BASE + "constellations.json")["features"]
stars = {
@ -101,11 +87,8 @@ def main() -> None:
ident = constellation["id"].split()[-1]
if ident not in ZODIAC:
continue
line_source = (st_constellations[ident]
if LINE_OVERRIDES.get(ident) == "modern_st"
else constellation)
lines = []
for hip_line in line_source.get("lines", []):
for hip_line in constellation.get("lines", []):
missing = [hip for hip in hip_line if hip not in stars]
if missing:
raise RuntimeError(f"{ident}: HIP ausente no catálogo: {missing}")
@ -140,7 +123,7 @@ def main() -> None:
)
OUT.write_text(
"/* Gerado por tools/build_constellations.py.\n"
" Stellarium Modern/S&T constellation lines, coordenadas Hipparcos J2000.\n\n"
" Stellarium Modern constellation lines, coordenadas Hipparcos J2000.\n\n"
+ "\n".join((" " + line) if line else "" for line in LICENSE.rstrip().splitlines())
+ " */\nconst CONSTELLATIONS=" + payload + ";\n",
encoding="utf-8",