diff --git a/CLAUDE.md b/CLAUDE.md index 7bd1631..87fe52a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -34,8 +34,7 @@ plugin/ main.qml # Plasma WallpaperItem — hosts everything dancer.html # Self-contained animation (HTML + CSS + JS) starcatalog.js # Generated star data (Yale BSC) — see tools/build_catalog.py - constellations.js # Generated zodiac lines/anchors — see tools/build_constellations.py - constellation-art/ # 12 zodiac PNGs (black background → alpha at load) + constellations.js # Generated zodiac lines — see tools/build_constellations.py milkyway.jpg # Gaia all-sky photo, plate carrée — see tools/build_skymap.py astronomy.browser.min.js # Astronomy Engine (MIT) — Moon/planet ephemerides tools/ @@ -59,7 +58,7 @@ Pure HTML/CSS/JS, no external dependencies. All visuals are self-contained: | Realistic sky (stars) | ``; real-time alt-az projection of `starcatalog.js` (8,404 Yale BSC stars, V ≤ 6.5) for the configured lat/long (default Toledo-PR). Static layer pre-rendered offscreen with triple-buffer + 1.4 s crossfade between reprojections (every 30 s; 4 s during timelapse/camera rotation); bright stars twinkle per frame. Debug: `window.__skyTimeOffset` (ms) fast-forwards the sky | | Milky Way | Per-pixel sampling of `milkyway.jpg` (Gaia photo, full res): `buildMwGrid` caches viewport unit vectors + extinction/glare, `renderMilkyWay` applies only the sidereal rotation (camera azimuth folded into the equatorial→galactic matrix) and stylized "development" (deep blacks, saturation, cool shadows). Decoded texture stays resident (~75 MB) | | Moon & planets | Astronomy Engine topocentric ephemerides: Moon with real phase texture + bright-limb angle, 7 planets with magnitude-scaled dots (labels only in constellation mode) | -| Zodiac constellations | Stellarium Modern lines + anchored PNG art (similarity transform, no shear); toggled via `/tmp` file or `C` key | +| Zodiac constellations | Stellarium Modern lines (traces only, no artwork); toggled via `/tmp` file or `C` key | | Nebula blobs, grid floor, horizon | CSS animations | | DANCEBOT-9000 robot | Pure CSS (divs + `@keyframes`) | | Chest EQ bars & VU meter | JS-driven `requestAnimationFrame` | diff --git a/plugin/contents/ui/constellation-art/LICENSE.md b/plugin/contents/ui/constellation-art/LICENSE.md deleted file mode 100644 index dafcb4e..0000000 --- a/plugin/contents/ui/constellation-art/LICENSE.md +++ /dev/null @@ -1,11 +0,0 @@ -# Stellarium Modern constellation illustrations - -The twelve PNG illustrations in this directory are taken from the -[Stellarium Modern sky culture](https://github.com/Stellarium/stellarium/tree/master/skycultures/modern/illustrations). - -The Stellarium sky-culture description licenses the illustrations under the -[Free Art License 1.3](https://artlibre.org/licence/lal/en/). - -The images are redistributed here with their original names and are rendered -with an affine transformation so their three Hipparcos anchor stars remain -aligned with the simulated sky. diff --git a/plugin/contents/ui/constellation-art/aquarius.png b/plugin/contents/ui/constellation-art/aquarius.png deleted file mode 100644 index 025dc01..0000000 Binary files a/plugin/contents/ui/constellation-art/aquarius.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/aries.png b/plugin/contents/ui/constellation-art/aries.png deleted file mode 100644 index 53acad7..0000000 Binary files a/plugin/contents/ui/constellation-art/aries.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/cancer.png b/plugin/contents/ui/constellation-art/cancer.png deleted file mode 100644 index c8a7b7c..0000000 Binary files a/plugin/contents/ui/constellation-art/cancer.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/capricornus.png b/plugin/contents/ui/constellation-art/capricornus.png deleted file mode 100644 index 45e6711..0000000 Binary files a/plugin/contents/ui/constellation-art/capricornus.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/gemini.png b/plugin/contents/ui/constellation-art/gemini.png deleted file mode 100644 index ad355cd..0000000 Binary files a/plugin/contents/ui/constellation-art/gemini.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/leo.png b/plugin/contents/ui/constellation-art/leo.png deleted file mode 100644 index 80abe97..0000000 Binary files a/plugin/contents/ui/constellation-art/leo.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/libra.png b/plugin/contents/ui/constellation-art/libra.png deleted file mode 100644 index 93ff885..0000000 Binary files a/plugin/contents/ui/constellation-art/libra.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/pisces.png b/plugin/contents/ui/constellation-art/pisces.png deleted file mode 100644 index 8570c22..0000000 Binary files a/plugin/contents/ui/constellation-art/pisces.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/sagittarius.png b/plugin/contents/ui/constellation-art/sagittarius.png deleted file mode 100644 index 7b1faee..0000000 Binary files a/plugin/contents/ui/constellation-art/sagittarius.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/scorpius.png b/plugin/contents/ui/constellation-art/scorpius.png deleted file mode 100644 index 9a50e22..0000000 Binary files a/plugin/contents/ui/constellation-art/scorpius.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/taurus.png b/plugin/contents/ui/constellation-art/taurus.png deleted file mode 100644 index 323b0b5..0000000 Binary files a/plugin/contents/ui/constellation-art/taurus.png and /dev/null differ diff --git a/plugin/contents/ui/constellation-art/virgo.png b/plugin/contents/ui/constellation-art/virgo.png deleted file mode 100644 index f2b6b4c..0000000 Binary files a/plugin/contents/ui/constellation-art/virgo.png and /dev/null differ diff --git a/plugin/contents/ui/constellations.js b/plugin/contents/ui/constellations.js index 8093c6a..0204c22 100644 --- a/plugin/contents/ui/constellations.js +++ b/plugin/contents/ui/constellations.js @@ -22,4 +22,4 @@ AND ANY EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE. */ -const CONSTELLATIONS=[{"id":"Ari","name":"Áries","rank":1,"label":[42.0,22.0],"lines":[[[42.496,27.2605],[31.7934,23.4624],[28.66,20.808],[28.3826,19.2939]]],"art":{"file":"constellation-art/aries.png","size":[256,256],"anchors":[{"pos":[12,130],"sky":[42.496,27.2605]},{"pos":[58,206],"sky":[44.803,21.3404]},{"pos":[210,47],"sky":[28.3826,19.2939]}]}},{"id":"Tau","name":"Touro","rank":1,"label":[54.0,15.0],"lines":[[[81.573,28.6075],[70.5613,22.9569],[67.1542,19.1804]],[[68.9802,16.5093],[84.4112,21.1425]],[[64.9483,15.6276],[65.7337,17.5425]],[[64.9483,15.6276],[60.1701,12.4903],[51.2033,9.0289]],[[68.9802,16.5093],[67.1542,19.1804]],[[68.9802,16.5093],[67.1656,15.8709],[64.9483,15.6276]],[[67.1542,19.1804],[66.3724,17.9279],[65.7337,17.5425],[57.2906,24.0534]]],"art":{"file":"constellation-art/taurus.png","size":[512,512],"anchors":[{"pos":[13,92],"sky":[84.4112,21.1425]},{"pos":[399,438],"sky":[51.2033,9.0289]},{"pos":[382,192],"sky":[57.7184,23.9615]}]}},{"id":"Gem","name":"Gêmeos","rank":1,"label":[107.25,23.5],"lines":[[[99.4279,16.3993],[106.0272,20.5703],[110.0307,21.9823],[109.5232,16.5404],[101.3224,12.8956]],[[110.0307,21.9823],[113.9806,26.8957],[116.1119,24.398]],[[113.9806,26.8957],[116.329,28.0262]],[[113.9806,26.8957],[111.4317,27.7981],[107.7849,30.2452],[113.6494,31.8883]],[[107.7849,30.2452],[103.1972,33.9613]],[[107.7849,30.2452],[100.983,25.1311],[97.2408,20.2121]],[[100.983,25.1311],[95.7401,22.5136],[93.7194,22.5068],[91.0301,23.2633]]],"art":{"file":"constellation-art/gemini.png","size":[256,256],"anchors":[{"pos":[14,81],"sky":[116.1119,24.398]},{"pos":[117,252],"sky":[101.3224,12.8956]},{"pos":[249,165],"sky":[91.0301,23.2633]}]}},{"id":"Cnc","name":"Câncer","rank":2,"label":[128.25,27.0],"lines":[[[131.6743,28.7599],[130.8214,21.4685],[125.0161,27.2177]],[[130.8214,21.4685],[131.1712,18.1543],[124.1288,9.1855]],[[131.1712,18.1543],[134.6218,11.8577]]],"art":{"file":"constellation-art/cancer.png","size":[256,256],"anchors":[{"pos":[29,166],"sky":[134.6218,11.8577]},{"pos":[101,255],"sky":[124.1288,9.1855]},{"pos":[206,91],"sky":[125.0161,27.2177]}]}},{"id":"Leo","name":"Leão","rank":1,"label":[159.0,15.0],"lines":[[[177.2649,14.5721],[168.56,15.4296],[152.093,11.9672],[151.8331,16.7627],[154.9931,19.8415],[168.5271,20.5237],[177.2649,14.5721]],[[154.9931,19.8415],[154.1726,23.4173],[148.1909,26.007],[146.4628,23.7743]],[[168.5271,20.5237],[168.56,15.4296]]],"art":{"file":"constellation-art/leo.png","size":[512,512],"anchors":[{"pos":[69,411],"sky":[177.2649,14.5721]},{"pos":[383,186],"sky":[152.093,11.9672]},{"pos":[321,32],"sky":[146.4628,23.7743]}]}},{"id":"Vir","name":"Virgem","rank":1,"label":[-160.5,-4.0],"lines":[[[176.4648,6.5294],[-175.0235,-0.6668],[-169.5848,-1.4494],[-158.7018,-11.1613],[-146.7761,-10.2737],[-145.9964,-6.0005],[-139.2349,-5.6582]],[[-158.7018,-11.1613],[-156.3267,-0.5958],[-149.5884,1.5445],[-138.4378,1.8929]],[[-156.3267,-0.5958],[-166.0991,3.3975],[-164.4558,10.9592]],[[-166.0991,3.3975],[-169.5848,-1.4494]]],"art":{"file":"constellation-art/virgo.png","size":[512,512],"anchors":[{"pos":[65,389],"sky":[-138.4378,1.8929]},{"pos":[454,57],"sky":[176.4648,6.5294]},{"pos":[338,382],"sky":[-158.7018,-11.1613]}]}},{"id":"Lib","name":"Libra","rank":2,"label":[-129.0,-26.0],"lines":[[[-121.5436,-16.7293],[-126.1184,-14.7895],[-130.7483,-9.3829],[-137.2804,-16.0418],[-133.9824,-25.282],[-126.1184,-14.7895]]],"art":{"file":"constellation-art/libra.png","size":[256,256],"anchors":[{"pos":[41,27],"sky":[-130.7483,-9.3829]},{"pos":[58,170],"sky":[-121.5436,-16.7293]},{"pos":[224,107],"sky":[-133.9824,-25.282]}]}},{"id":"Sco","name":"Escorpião","rank":1,"label":[-111.0,-38.0],"lines":[[[-96.5978,-37.1038],[-94.378,-39.03],[-93.1038,-40.127],[-95.6703,-42.9978],[-101.9617,-43.2392],[-106.5011,-42.362],[-107.0324,-38.0474],[-107.4591,-34.2932],[-111.0294,-28.216],[-112.6481,-26.432],[-119.9166,-22.6217]],[[-112.6481,-26.432],[-120.287,-26.1141]],[[-112.6481,-26.432],[-118.6407,-19.8055]]],"art":{"file":"constellation-art/scorpius.png","size":[512,512],"anchors":[{"pos":[447,29],"sky":[-118.6407,-19.8055]},{"pos":[62,365],"sky":[-96.5978,-37.1038]},{"pos":[217,462],"sky":[-106.3541,-42.3613]}]}},{"id":"Sgr","name":"Sagitário","rank":1,"label":[-67.5,-34.0],"lines":[[[-84.7515,-29.8281],[-83.0073,-25.4217]],[[-85.5932,-36.7617],[-83.957,-34.3846],[-88.548,-30.4241],[-93.1099,-27.8308]],[[-88.548,-30.4241],[-84.7515,-29.8281],[-83.957,-34.3846],[-74.347,-29.8801],[-78.5859,-26.9908],[-84.7515,-29.8281]],[[-78.5859,-26.9908],[-83.0073,-25.4217],[-86.5591,-21.0588]],[[-74.347,-29.8801],[-73.265,-27.6704],[-76.1836,-26.2967],[-78.5859,-26.9908]],[[-76.1836,-26.2967],[-75.5675,-21.1067],[-73.8292,-21.7415],[-70.5913,-18.9529],[-69.5818,-17.8472]],[[-73.265,-27.6704],[-65.9931,-24.7191],[-59.3355,-27.7098],[-60.0659,-35.2763],[-61.1846,-41.8683],[-69.0284,-40.6159]],[[-61.1846,-41.8683],[-69.1953,-44.7998]]],"art":{"file":"constellation-art/sagittarius.png","size":[512,512],"anchors":[{"pos":[96,82],"sky":[-69.5818,-17.8472]},{"pos":[307,492],"sky":[-69.1953,-44.7998]},{"pos":[506,100],"sky":[-93.1099,-27.8308]}]}},{"id":"Cap","name":"Capricórnio","rank":2,"label":[-45.0,-22.0],"lines":[[[-55.4864,-12.5449],[-54.7472,-14.7814],[-43.5132,-17.2329],[-39.4383,-16.8345],[-34.9773,-16.6623],[-33.2398,-16.1273]],[[-39.4383,-16.8345],[-38.3332,-22.4113],[-43.5132,-17.2329]],[[-54.7472,-14.7814],[-48.4761,-25.2709]],[[-43.5132,-17.2329],[-47.0446,-26.9191]]],"art":{"file":"constellation-art/capricornus.png","size":[512,512],"anchors":[{"pos":[15,436],"sky":[-33.2398,-16.1273]},{"pos":[403,7],"sky":[-55.4864,-12.5449]},{"pos":[460,438],"sky":[-47.0446,-26.9191]}]}},{"id":"Aqr","name":"Aquário","rank":2,"label":[-22.5,-5.0],"lines":[[[-37.1103,-5.5712],[-28.554,-0.3199],[-24.5859,-1.3873],[-22.792,-0.02],[-21.1609,-0.1175],[-16.8464,-7.5796],[-11.0271,-9.0877],[-9.2574,-20.1006]],[[-28.554,-0.3199],[-25.7915,-7.7833],[-28.3907,-13.8697]],[[-25.7915,-7.7833],[-22.3383,-10.678],[-17.6021,-13.5926],[-16.3374,-15.8208],[-12.6383,-21.1724]],[[-48.081,-9.4958],[-37.1103,-5.5712]]],"art":{"file":"constellation-art/aquarius.png","size":[512,512],"anchors":[{"pos":[144,464],"sky":[-9.2574,-20.1006]},{"pos":[179,98],"sky":[-28.554,-0.3199]},{"pos":[465,49],"sky":[-48.081,-9.4958]}]}},{"id":"Psc","name":"Peixes","rank":2,"label":[19.5,15.0],"lines":[[[15.7046,31.8043],[18.4373,24.5837]],[[15.7046,31.8043],[19.8666,27.2641],[18.4373,24.5837],[22.8709,15.3458],[26.3485,9.1577],[30.5118,2.7638],[28.389,3.1875],[25.3579,5.4876],[22.5463,6.1438],[15.7359,7.8901],[12.0725,7.2999],[5.1494,8.1903],[-0.1721,6.8633],[-5.0123,5.6263],[-3.402,3.4868],[-4.4883,1.78],[-8.2669,1.2556],[-10.7086,3.2823],[-9.9142,5.3813],[-8.0079,6.379],[-5.0123,5.6263]]],"art":{"file":"constellation-art/pisces.png","size":[512,512],"anchors":[{"pos":[24,104],"sky":[15.7046,31.8043]},{"pos":[111,489],"sky":[30.5118,2.7638]},{"pos":[481,155],"sky":[-10.7086,3.2823]}]}}]; +const CONSTELLATIONS=[{"id":"Ari","name":"Áries","rank":1,"label":[42.0,22.0],"lines":[[[42.496,27.2605],[31.7934,23.4624],[28.66,20.808],[28.3826,19.2939]]]},{"id":"Tau","name":"Touro","rank":1,"label":[54.0,15.0],"lines":[[[81.573,28.6075],[70.5613,22.9569],[67.1542,19.1804]],[[68.9802,16.5093],[84.4112,21.1425]],[[64.9483,15.6276],[65.7337,17.5425]],[[64.9483,15.6276],[60.1701,12.4903],[51.2033,9.0289]],[[68.9802,16.5093],[67.1542,19.1804]],[[68.9802,16.5093],[67.1656,15.8709],[64.9483,15.6276]],[[67.1542,19.1804],[66.3724,17.9279],[65.7337,17.5425],[57.2906,24.0534]]]},{"id":"Gem","name":"Gêmeos","rank":1,"label":[107.25,23.5],"lines":[[[99.4279,16.3993],[106.0272,20.5703],[110.0307,21.9823],[109.5232,16.5404],[101.3224,12.8956]],[[110.0307,21.9823],[113.9806,26.8957],[116.1119,24.398]],[[113.9806,26.8957],[116.329,28.0262]],[[113.9806,26.8957],[111.4317,27.7981],[107.7849,30.2452],[113.6494,31.8883]],[[107.7849,30.2452],[103.1972,33.9613]],[[107.7849,30.2452],[100.983,25.1311],[97.2408,20.2121]],[[100.983,25.1311],[95.7401,22.5136],[93.7194,22.5068],[91.0301,23.2633]]]},{"id":"Cnc","name":"Câncer","rank":2,"label":[128.25,27.0],"lines":[[[131.6743,28.7599],[130.8214,21.4685],[125.0161,27.2177]],[[130.8214,21.4685],[131.1712,18.1543],[124.1288,9.1855]],[[131.1712,18.1543],[134.6218,11.8577]]]},{"id":"Leo","name":"Leão","rank":1,"label":[159.0,15.0],"lines":[[[177.2649,14.5721],[168.56,15.4296],[152.093,11.9672],[151.8331,16.7627],[154.9931,19.8415],[168.5271,20.5237],[177.2649,14.5721]],[[154.9931,19.8415],[154.1726,23.4173],[148.1909,26.007],[146.4628,23.7743]],[[168.5271,20.5237],[168.56,15.4296]]]},{"id":"Vir","name":"Virgem","rank":1,"label":[-160.5,-4.0],"lines":[[[176.4648,6.5294],[-175.0235,-0.6668],[-169.5848,-1.4494],[-158.7018,-11.1613],[-146.7761,-10.2737],[-145.9964,-6.0005],[-139.2349,-5.6582]],[[-158.7018,-11.1613],[-156.3267,-0.5958],[-149.5884,1.5445],[-138.4378,1.8929]],[[-156.3267,-0.5958],[-166.0991,3.3975],[-164.4558,10.9592]],[[-166.0991,3.3975],[-169.5848,-1.4494]]]},{"id":"Lib","name":"Libra","rank":2,"label":[-129.0,-26.0],"lines":[[[-121.5436,-16.7293],[-126.1184,-14.7895],[-130.7483,-9.3829],[-137.2804,-16.0418],[-133.9824,-25.282],[-126.1184,-14.7895]]]},{"id":"Sco","name":"Escorpião","rank":1,"label":[-111.0,-38.0],"lines":[[[-96.5978,-37.1038],[-94.378,-39.03],[-93.1038,-40.127],[-95.6703,-42.9978],[-101.9617,-43.2392],[-106.5011,-42.362],[-107.0324,-38.0474],[-107.4591,-34.2932],[-111.0294,-28.216],[-112.6481,-26.432],[-119.9166,-22.6217]],[[-112.6481,-26.432],[-120.287,-26.1141]],[[-112.6481,-26.432],[-118.6407,-19.8055]]]},{"id":"Sgr","name":"Sagitário","rank":1,"label":[-67.5,-34.0],"lines":[[[-84.7515,-29.8281],[-83.0073,-25.4217]],[[-85.5932,-36.7617],[-83.957,-34.3846],[-88.548,-30.4241],[-93.1099,-27.8308]],[[-88.548,-30.4241],[-84.7515,-29.8281],[-83.957,-34.3846],[-74.347,-29.8801],[-78.5859,-26.9908],[-84.7515,-29.8281]],[[-78.5859,-26.9908],[-83.0073,-25.4217],[-86.5591,-21.0588]],[[-74.347,-29.8801],[-73.265,-27.6704],[-76.1836,-26.2967],[-78.5859,-26.9908]],[[-76.1836,-26.2967],[-75.5675,-21.1067],[-73.8292,-21.7415],[-70.5913,-18.9529],[-69.5818,-17.8472]],[[-73.265,-27.6704],[-65.9931,-24.7191],[-59.3355,-27.7098],[-60.0659,-35.2763],[-61.1846,-41.8683],[-69.0284,-40.6159]],[[-61.1846,-41.8683],[-69.1953,-44.7998]]]},{"id":"Cap","name":"Capricórnio","rank":2,"label":[-45.0,-22.0],"lines":[[[-55.4864,-12.5449],[-54.7472,-14.7814],[-43.5132,-17.2329],[-39.4383,-16.8345],[-34.9773,-16.6623],[-33.2398,-16.1273]],[[-39.4383,-16.8345],[-38.3332,-22.4113],[-43.5132,-17.2329]],[[-54.7472,-14.7814],[-48.4761,-25.2709]],[[-43.5132,-17.2329],[-47.0446,-26.9191]]]},{"id":"Aqr","name":"Aquário","rank":2,"label":[-22.5,-5.0],"lines":[[[-37.1103,-5.5712],[-28.554,-0.3199],[-24.5859,-1.3873],[-22.792,-0.02],[-21.1609,-0.1175],[-16.8464,-7.5796],[-11.0271,-9.0877],[-9.2574,-20.1006]],[[-28.554,-0.3199],[-25.7915,-7.7833],[-28.3907,-13.8697]],[[-25.7915,-7.7833],[-22.3383,-10.678],[-17.6021,-13.5926],[-16.3374,-15.8208],[-12.6383,-21.1724]],[[-48.081,-9.4958],[-37.1103,-5.5712]]]},{"id":"Psc","name":"Peixes","rank":2,"label":[19.5,15.0],"lines":[[[15.7046,31.8043],[18.4373,24.5837]],[[15.7046,31.8043],[19.8666,27.2641],[18.4373,24.5837],[22.8709,15.3458],[26.3485,9.1577],[30.5118,2.7638],[28.389,3.1875],[25.3579,5.4876],[22.5463,6.1438],[15.7359,7.8901],[12.0725,7.2999],[5.1494,8.1903],[-0.1721,6.8633],[-5.0123,5.6263],[-3.402,3.4868],[-4.4883,1.78],[-8.2669,1.2556],[-10.7086,3.2823],[-9.9142,5.3813],[-8.0079,6.379],[-5.0123,5.6263]]]}]; diff --git a/plugin/contents/ui/dancer.html b/plugin/contents/ui/dancer.html index 073c4a5..bed22b8 100644 --- a/plugin/contents/ui/dancer.html +++ b/plugin/contents/ui/dancer.html @@ -1233,40 +1233,6 @@ const ctx = canvas.getContext('2d'); let obsLat = -24.72, obsLon = -53.74; // Toledo-PR; sobrescrito pela config let showConstellations = false; let constellationPreviewId = null; -const constellationArtImages = new Map(); -if (typeof CONSTELLATIONS !== 'undefined') { - for (const constellation of CONSTELLATIONS) { - if (!constellation.art) continue; - const img = new Image(); - const entry = { img, render: null }; - img.onload = () => { - /* Os originais usam preto como transparência. Convertê-lo em alpha - evita que a transformação afim revele os limites retangulares. */ - const out = document.createElement('canvas'); - out.width = constellation.art.size[0]; - out.height = constellation.art.size[1]; - const oc = out.getContext('2d', { willReadFrequently: true }); - oc.drawImage(img, 0, 0, out.width, out.height); - const pixels = oc.getImageData(0, 0, out.width, out.height); - for (let i = 0; i < pixels.data.length; i += 4) { - const r = pixels.data[i], g = pixels.data[i + 1], b = pixels.data[i + 2]; - const light = Math.max(r, g, b); - const mask = Math.max(0, Math.min(1, (light - 9) / 118)); - pixels.data[i] = 105 + light * 0.42; - pixels.data[i + 1] = 175 + light * 0.27; - pixels.data[i + 2] = 235 + light * 0.08; - pixels.data[i + 3] = pixels.data[i + 3] * mask; - } - oc.clearRect(0, 0, out.width, out.height); - oc.putImageData(pixels, 0, 0); - entry.render = out; - projectSky(); - }; - img.onerror = () => console.error('[skeledance] falha na arte de ' + constellation.name); - img.src = constellation.art.file; - constellationArtImages.set(constellation.id, entry); - } -} const CAMERA_HOME_AZ = 90; // posição inicial: leste const CAMERA_TURN_MS = 5 * 60 * 1000; let viewAz = CAMERA_HOME_AZ; @@ -1546,105 +1512,6 @@ function renderMilkyWay(lstDeg, glareOn) { return true; } -/* Ajuste de similaridade: aproxima as três âncoras Hipparcos usando apenas - translação, rotação e escala uniforme. Diferente de uma transformação - afim completa, nunca achata nem alonga a anatomia das ilustrações. */ -function constellationArtTransform(source, target) { - const pc = source.reduce((p, v) => [p[0] + v[0], p[1] + v[1]], [0, 0]) - .map(v => v / source.length); - const qc = target.reduce((p, v) => [p[0] + v.x, p[1] + v.y], [0, 0]) - .map(v => v / target.length); - let dot = 0, cross = 0, mirrorA = 0, mirrorB = 0, energy = 0; - for (let i = 0; i < source.length; i++) { - const px = source[i][0] - pc[0], py = source[i][1] - pc[1]; - const qx = target[i].x - qc[0], qy = target[i].y - qc[1]; - dot += px * qx + py * qy; - cross += px * qy - py * qx; - mirrorA += px * qx - py * qy; - mirrorB += py * qx + px * qy; - energy += px * px + py * py; - } - if (energy < 1e-6) return null; - const candidate = (a, b, c, d) => { - const e = qc[0] - a * pc[0] - c * pc[1]; - const f = qc[1] - b * pc[0] - d * pc[1]; - const matrix = [a, b, c, d, e, f]; - const error = source.reduce((sum, p, i) => { - const dx = a * p[0] + c * p[1] + e - target[i].x; - const dy = b * p[0] + d * p[1] + f - target[i].y; - return sum + dx * dx + dy * dy; - }, 0); - return { matrix, error }; - }; - const rotate = candidate(dot / energy, cross / energy, - -cross / energy, dot / energy); - /* Ao observar a esfera por dentro, várias cartas precisam inverter a - orientação leste/oeste. Esta alternativa inclui a reflexão sem shear. */ - const reflect = candidate(mirrorA / energy, mirrorB / energy, - mirrorB / energy, -mirrorA / energy); - return (reflect.error < rotate.error ? reflect : rotate).matrix; -} - -function drawConstellationArt(c, constellation, lst, W, horizonPx, previewProjector) { - const art = constellation.art; - const imageEntry = constellationArtImages.get(constellation.id); - if (!art || !imageEntry || !imageEntry.render) return; - - const target = art.anchors.map(anchor => { - if (previewProjector) { - const sc = previewProjector(anchor.sky); - return { x: sc.x, y: sc.y, alt: ALT_TOP / 2 }; - } - const aa = altAz(anchor.sky[0], anchor.sky[1], lst); - const daz = ((aa.az - viewAz) % 360 + 540) % 360 - 180; - return { - x: (0.5 + daz / FOV_AZ) * W, - y: horizonPx * (1 - aa.alt / ALT_TOP), - alt: aa.alt, - }; - }); - if (target.every(p => p.alt < -8) || target.every(p => p.alt > ALT_TOP + 8)) return; - if (!target.some(p => p.alt >= -8 && p.alt <= ALT_TOP + 8 && - p.x >= -W * 0.15 && p.x <= W * 1.15)) return; - const targetXs = target.map(p => p.x); - if (Math.max(...targetXs) - Math.min(...targetXs) > W * 0.62) return; - - const matrix = constellationArtTransform( - art.anchors.map(anchor => anchor.pos), target - ); - if (!matrix || matrix.some(v => !Number.isFinite(v))) return; - - /* Mesmo com escala uniforme, uma âncora próxima da descontinuidade do - azimute pode sugerir uma figura gigantesca. Limite visual conservador. */ - const scale = Math.hypot(matrix[0], matrix[1]); - const maxScale = Math.min( - W * 0.44 / art.size[0], horizonPx * 0.82 / art.size[1] - ); - if (scale > maxScale) { - const sourceCenter = [art.size[0] / 2, art.size[1] / 2]; - const screenCenter = [ - matrix[0] * sourceCenter[0] + matrix[2] * sourceCenter[1] + matrix[4], - matrix[1] * sourceCenter[0] + matrix[3] * sourceCenter[1] + matrix[5], - ]; - const shrink = maxScale / scale; - for (let i = 0; i < 4; i++) matrix[i] *= shrink; - matrix[4] = screenCenter[0] - matrix[0] * sourceCenter[0] - - matrix[2] * sourceCenter[1]; - matrix[5] = screenCenter[1] - matrix[1] * sourceCenter[0] - - matrix[3] * sourceCenter[1]; - } - - c.save(); - c.beginPath(); - c.rect(0, 0, W, horizonPx); - c.clip(); - c.globalCompositeOperation = 'screen'; - c.globalAlpha = 0.24; - c.setTransform(...matrix); - c.drawImage(imageEntry.render, 0, 0, art.size[0], art.size[1]); - c.restore(); -} - function makeConstellationPreviewProjector(constellation, W, horizonPx) { const centerRa = constellation.label ? constellation.label[0] : 0; const centerDec = constellation.label ? constellation.label[1] : 0; @@ -1669,8 +1536,7 @@ function makeConstellationPreviewProjector(constellation, W, horizonPx) { }; } -/* Figuras convencionais dos 12 signos zodiacais, ancoradas em RA/Dec J2000. - Arte, linhas e estrelas reais ficam sobrepostas nesta ordem. */ +/* Traçados convencionais dos 12 signos zodiacais, ancorados em RA/Dec J2000. */ function drawConstellations(c, lst, W, H, horizonPx) { if (!showConstellations || typeof CONSTELLATIONS === 'undefined') return; const rankAlpha = [0, 0.52, 0.38, 0.25]; @@ -1693,9 +1559,6 @@ function drawConstellations(c, lst, W, H, horizonPx) { c.lineJoin = 'round'; c.shadowColor = 'rgba(60,185,255,0.65)'; c.shadowBlur = 7; - for (const constellation of visible) { - drawConstellationArt(c, constellation, lst, W, horizonPx, previewProjector); - } for (const constellation of visible) { const rank = Math.max(1, Math.min(3, constellation.rank || 3)); c.strokeStyle = `rgba(105,205,255,${preview ? 0.82 : rankAlpha[rank]})`; diff --git a/tools/build_constellations.py b/tools/build_constellations.py index f36f9d9..91627a2 100644 --- a/tools/build_constellations.py +++ b/tools/build_constellations.py @@ -93,27 +93,12 @@ def main() -> None: if missing: raise RuntimeError(f"{ident}: HIP ausente no catálogo: {missing}") lines.append([stars[hip] for hip in hip_line]) - image = constellation.get("image") - art = None - if image: - anchors = [] - for anchor in image["anchors"]: - hip = int(anchor["hip"]) - if hip not in stars: - raise RuntimeError(f"{ident}: âncora HIP ausente: {hip}") - anchors.append({"pos": anchor["pos"], "sky": stars[hip]}) - art = { - "file": "constellation-art/" + Path(image["file"]).name, - "size": image["size"], - "anchors": anchors, - } merged[ident] = { "id": ident, "name": ZODIAC[ident], "rank": 1 if ident in {"Ari", "Tau", "Gem", "Leo", "Vir", "Sco", "Sgr"} else 2, "label": metadata.get(ident, {}).get("label"), "lines": lines, - "art": art, } payload = json.dumps(