@johnmorrisdotca/chikyu-earth 0.60.0 → 0.60.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.60.2 - 2026-11-17
6
+
7
+ - **The realistic look's clouds no longer stand up from the Earth's edge** (MODULES-1498). Its clouds sat on the 38 km shell (radius 1.006) that made lumps on the outline in the space view: 0.006 of the globe's radius in pixels, 12 pixels on a 4096 pixel canvas. They now use the space view's near shell (1.0016, about 10 km up, `CLOUD_SHELL_NEAR`), which stays above the finer map tiles' shells (1.0008) by more than a face of the sphere dips. The realistic picture is orthographic, so there is no distance to switch by and no far shell is needed: its depth is linear and the low shell does not fight the ground. A test holds the radius, the clearance and the size of the lump.
8
+
9
+ ## 0.60.1 - 2026-11-17
10
+
11
+ - **The Earth's edge is round from a low orbit** (MODULES-1498). In the space view the clouds were drawn on a shell 38 km above the ground, so wherever there was cloud at the Earth's edge the outline stood up from it: from 640 km a lump more than half a degree tall, several pixels in a ride. The shell is now about 10 km up while the camera is within 60 Earth radii (`cloudShell`, `src/space/cloud-shell.ts`), still above the finer map tiles, and the old height only from further away, where the difference is under half a pixel.
12
+
3
13
  ## 0.60.0 - 2026-11-17
4
14
 
5
15
  - **`classOfElements` and `orbitClass` follow the Space Program X site's orbit levels** (MODULES-1403; breaking for code that reads the class names). The class is now decided by the rule the site's `levelOf` uses, so a page that shows both says one thing: low is a highest point under 2,000 km; geostationary is both points within 2,500 km (was 1,500) of 35,786 km; the outer edge of low orbit (`outer`, new) is a lowest point of 2,000 km or more and a highest under 8,000 km; medium is the rest of those to 32,000 km (was 34,286); `far` is every orbit left. There is no rule on the eccentricity any more (`heo` is gone: an oval low orbit is low, and the stretched ones that swing far out are `far`), and `other` is gone (`far` takes what was left). `OrbitClass` is `"leo" | "outer" | "meo" | "geo" | "far"`, `ORBIT_CLASSES`, `CLASS_LABELS` (English and Japanese, the site's words) and `CLASS_COLOURS` follow, and `CLASS_LIMITS` is `{ leoApogeeKm, outerApogeeKm, meoApogeeKm, geoBandKm }`. Heights stay above the mean Earth radius (6,371 km), 7 km under the site's equatorial radius, so a set within 7 km of a limit can differ. On the site's own 16,903 element sets 53 had a different class under the old rule. The satellites' class colours on the Earth follow.
package/README.md CHANGED
@@ -615,7 +615,7 @@ console.log(countryList().filter((country) => country.alpha2 === null).map((coun
615
615
 
616
616
  ## How to cite
617
617
 
618
- > Morris, J. (2026). *Chikyu Earth* (version 0.60.0) [Computer software]. https://github.com/johnmorrisdotca/chikyu-earth
618
+ > Morris, J. (2026). *Chikyu Earth* (version 0.60.2) [Computer software]. https://github.com/johnmorrisdotca/chikyu-earth
619
619
 
620
620
  GitHub's "Cite this repository" button reads [CITATION.cff](CITATION.cff) and gives BibTeX and APA. Cite the version you used (`npm ls @johnmorrisdotca/chikyu-earth`), and credit the sources behind the numbers and pictures: [NOTICE.md](NOTICE.md) says who made each one and under what terms.
621
621
 
@@ -29,6 +29,14 @@ type Three = ThreeParts;
29
29
  * ```
30
30
  */
31
31
  export declare const ATMOSPHERE_OUTER = 1.08;
32
+ /**
33
+ * The radius of the clouds' shell in the realistic look (the Earth's radius is 1): the space view's near shell, about 10 km up. A shell 38 km up (1.006) stood above the ground at the Earth's edge wherever there
34
+ * was cloud, a lump of 0.006 of the globe's radius in pixels (12 pixels on a 4096 pixel canvas). The picture is orthographic, so there is no distance to switch by, and the depth is linear (1 to 120 over 24 bits),
35
+ * so the low shell never fights the ground; it stays above the finer map tiles' own shells (1.0008 at most) by more than a face of the sphere dips (`GRID_COLUMNS`).
36
+ */
37
+ export declare const CLOUD_RADIUS = 1.0016;
38
+ /** The columns of the sphere the Earth, its clouds and its air are drawn on. */
39
+ export declare const GRID_COLUMNS = 128;
32
40
  /** What the scene reads at each draw; the element changes it and asks for a draw. */
33
41
  /**
34
42
  * How the Earth is lit: `sun` (the true light, with the night side dark and the city lights on it), `lit` (always lit, as if by daylight from the camera's side, the day picture and no city lights: the night side is never a black frame)
@@ -11,6 +11,7 @@ import { createBodyLabelLayer, newBodyLabelState } from "./body-label.js";
11
11
  import { beginPlaceSprites, createPlaceSprites } from "../markers/place-sprites.js";
12
12
  import { createMeteorLayer, newMeteorState } from "../meteors/layer.js";
13
13
  import { createBorderLayer, newBorderState } from "../borders/layer.js";
14
+ import { CLOUD_SHELL_NEAR } from "../space/cloud-shell.js";
14
15
  import { createGridLayer, newGridState } from "../grid/layer.js";
15
16
  import { createRouteLayer, newRouteState } from "../route/layer.js";
16
17
  import { pointOnEarth } from "./tiles.js";
@@ -28,7 +29,14 @@ const RAD = Math.PI / 180;
28
29
  * ```
29
30
  */
30
31
  export const ATMOSPHERE_OUTER = 1.08;
31
- const CLOUD_RADIUS = 1.006;
32
+ /**
33
+ * The radius of the clouds' shell in the realistic look (the Earth's radius is 1): the space view's near shell, about 10 km up. A shell 38 km up (1.006) stood above the ground at the Earth's edge wherever there
34
+ * was cloud, a lump of 0.006 of the globe's radius in pixels (12 pixels on a 4096 pixel canvas). The picture is orthographic, so there is no distance to switch by, and the depth is linear (1 to 120 over 24 bits),
35
+ * so the low shell never fights the ground; it stays above the finer map tiles' own shells (1.0008 at most) by more than a face of the sphere dips (`GRID_COLUMNS`).
36
+ */
37
+ export const CLOUD_RADIUS = CLOUD_SHELL_NEAR;
38
+ /** The columns of the sphere the Earth, its clouds and its air are drawn on. */
39
+ export const GRID_COLUMNS = 128;
32
40
  const LAYERS = ["day", "night", "clouds", "water"];
33
41
  export const newModel = () => ({
34
42
  centre: { lon: 0, lat: 0 },
@@ -152,7 +160,7 @@ export function createEarthItem(model, deps) {
152
160
  /** The Sun in the Earth's own axes (before the view turns it), which the surface needs to find where a cloud's shadow falls. */
153
161
  const sunLocal = { value: new three.Vector3(1, 0, 0) };
154
162
  const cloudShift = { value: 0 };
155
- const grid = sphere(three, 128, 64);
163
+ const grid = sphere(three, GRID_COLUMNS, 64);
156
164
  const surface = new three.ShaderMaterial({
157
165
  vertexShader: SURFACE_VERT,
158
166
  fragmentShader: SURFACE_FRAG,
@@ -0,0 +1,13 @@
1
+ /** The shell's radius while the camera is near (the Earth's radius is 1): about 10 km up, above the finer map tiles' own shells (1.0008 at most) by more than the shell's flat faces dip. */
2
+ export declare const CLOUD_SHELL_NEAR = 1.0016;
3
+ /** The shell's radius from far away, where a low shell could fight the ground for the same depth and the change is under half a pixel. */
4
+ export declare const CLOUD_SHELL_FAR = 1.006;
5
+ /** The camera's distance from the Earth's middle, in Earth radii, past which the far shell is used. */
6
+ export declare const CLOUD_SHELL_REACH = 60;
7
+ /**
8
+ * The radius of the clouds' shell for a camera this far from the Earth's middle. A shell 38 km up (the far one) stands above the ground at the Earth's edge wherever there is cloud, so from a
9
+ * low orbit the outline had lumps several pixels tall; near the Earth the shell is as low as the map tiles under it allow.
10
+ * @param distance - The camera's distance from the Earth's middle, in Earth radii.
11
+ * @returns The shell's radius, in Earth radii.
12
+ */
13
+ export declare function cloudShell(distance: number): number;
@@ -0,0 +1,16 @@
1
+ // How high the clouds' shell sits above the ground in the space view.
2
+ /** The shell's radius while the camera is near (the Earth's radius is 1): about 10 km up, above the finer map tiles' own shells (1.0008 at most) by more than the shell's flat faces dip. */
3
+ export const CLOUD_SHELL_NEAR = 1.0016;
4
+ /** The shell's radius from far away, where a low shell could fight the ground for the same depth and the change is under half a pixel. */
5
+ export const CLOUD_SHELL_FAR = 1.006;
6
+ /** The camera's distance from the Earth's middle, in Earth radii, past which the far shell is used. */
7
+ export const CLOUD_SHELL_REACH = 60;
8
+ /**
9
+ * The radius of the clouds' shell for a camera this far from the Earth's middle. A shell 38 km up (the far one) stands above the ground at the Earth's edge wherever there is cloud, so from a
10
+ * low orbit the outline had lumps several pixels tall; near the Earth the shell is as low as the map tiles under it allow.
11
+ * @param distance - The camera's distance from the Earth's middle, in Earth radii.
12
+ * @returns The shell's radius, in Earth radii.
13
+ */
14
+ export function cloudShell(distance) {
15
+ return distance < CLOUD_SHELL_REACH ? CLOUD_SHELL_NEAR : CLOUD_SHELL_FAR;
16
+ }
@@ -1,4 +1,5 @@
1
1
  import { AIR_QUALITY, AIR_THICKNESS_DEFAULT, AIR_VERT, airFrag, airTop } from "../realistic/air.js";
2
+ import { CLOUD_SHELL_NEAR, cloudShell } from "./cloud-shell.js";
2
3
  import { sphere } from "../realistic/earth.js";
3
4
  import { BODY_FRAG, CLOUD_FRAG, GLOW_FRAG, GLOW_VERT, SURFACE_FRAG, SURFACE_VERT } from "../realistic/shaders.js";
4
5
  import { createTextureSet } from "../realistic/textures.js";
@@ -292,7 +293,7 @@ export function createSpaceItem(model, deps) {
292
293
  const tiles = createTileSet(three, earth, { sunDir: sunEarth, lights: earthMaterial.uniforms["lights"], boost: earthMaterial.uniforms["boost"], ortho: earthMaterial.uniforms["ortho"], water: uniform.water, night: uniform.night, extra: { cloudMap: uniform.clouds, sunLocal, cloudShift } }, { assets: deps.assets, sources: () => deps.sources?.() ?? {}, cap: deps.cap, invalidate: arrivalDraw, ...(deps.onTiles ? { onManifest: deps.onTiles } : {}) });
293
294
  model.tiles = tiles;
294
295
  const clouds = new three.Mesh(grid, cloudMaterial);
295
- clouds.scale.setScalar(1.006);
296
+ clouds.scale.setScalar(CLOUD_SHELL_NEAR);
296
297
  clouds.renderOrder = 3;
297
298
  const glow = new three.Mesh(grid, atmosphereMaterial);
298
299
  glow.scale.setScalar(airTop(model.airThickness));
@@ -479,6 +480,7 @@ export function createSpaceItem(model, deps) {
479
480
  cloudShift.value = -(((model.time / 3_600_000) * model.cloudDrift) % 360) / 360;
480
481
  atmosphereMaterial.uniforms["thick"].value = model.airThickness;
481
482
  glow.scale.setScalar(airTop(model.airThickness));
483
+ clouds.scale.setScalar(cloudShell(camera.position.length())); // where the camera was at the last draw: the two shells differ by under a pixel where they change
482
484
  const fade = stepLightFade(model.lightFade, model.light === "lit", performance.now(), prefersLessMotion());
483
485
  // one more frame while it moves, and none once it has arrived
484
486
  if (fade.fading)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/chikyu-earth",
3
- "version": "0.60.0",
3
+ "version": "0.60.2",
4
4
  "description": "Chikyu Earth 地球 — A line-drawn globe for the web: country outlines that turn at the Earth's own rate, centred on the place you give it, with an optional realistic Earth from space (three.js), the Sun, Moon and planets, satellites on their orbits, and markers for any place. A web component and an SVG string.",
5
5
  "keywords": [
6
6
  "earth",