diff options
| author | victor | 2026-10-24 15:57:01 +0200 |
|---|---|---|
| committer | victor | 2026-10-24 15:57:01 +0200 |
| commit | 4533910bce394e7a0ee6debfc05ca1221ee51899 (patch) | |
| tree | 73aaa5b2c7a48dbf226e6b81d499ba1a8ecc33a1 /docs | |
| parent | Tilføj dansk (diff) | |
| download | 3D-Electrophysics-4533910bce394e7a0ee6debfc05ca1221ee51899.tar.gz 3D-Electrophysics-4533910bce394e7a0ee6debfc05ca1221ee51899.zip | |
Astra!ny-start
Diffstat (limited to '')
| -rw-r--r-- | docs/superpowers/plans/2026-10-24-electric-flux.md | 40 | ||||
| -rw-r--r-- | docs/superpowers/plans/2026-10-24-test4.md | 59 | ||||
| -rw-r--r-- | docs/theory/1Introduction to electrophysics.pdf (renamed from theory/1Introduction to electrophysics.pdf) | bin | 1373195 -> 1373195 bytes | |||
| -rw-r--r-- | docs/theory/2Electric charge, force and field.pdf (renamed from theory/2Electric charge, force and field.pdf) | bin | 1307864 -> 1307864 bytes | |||
| -rw-r--r-- | docs/theory/3Electric flux and charge.pdf (renamed from theory/3Electric flux and charge.pdf) | bin | 2051370 -> 2051370 bytes | |||
| -rw-r--r-- | docs/theory/4Electric potential energy.pdf (renamed from theory/4Electric potential energy.pdf) | bin | 1922512 -> 1922512 bytes | |||
| -rw-r--r-- | docs/theory/5Electric potential and gradient.pdf (renamed from theory/5Electric potential and gradient.pdf) | bin | 3009513 -> 3009513 bytes | |||
| -rw-r--r-- | docs/theory/6capacitance.pdf (renamed from theory/6capacitance.pdf) | bin | 1315542 -> 1315542 bytes | |||
| -rw-r--r-- | docs/theory/7dielectricmaterials.pdf (renamed from theory/7dielectricmaterials.pdf) | bin | 1657183 -> 1657183 bytes | |||
| -rw-r--r-- | docs/theory/8current.pdf (renamed from theory/8current.pdf) | bin | 2134217 -> 2134217 bytes | |||
| -rw-r--r-- | docs/theory/9semiconductingmaterials.pdf (renamed from theory/9semiconductingmaterials.pdf) | bin | 3016847 -> 3016847 bytes |
11 files changed, 40 insertions, 59 deletions
diff --git a/docs/superpowers/plans/2026-10-24-electric-flux.md b/docs/superpowers/plans/2026-10-24-electric-flux.md new file mode 100644 index 0000000..c7c7a2e --- /dev/null +++ b/docs/superpowers/plans/2026-10-24-electric-flux.md @@ -0,0 +1,40 @@ +# Electric Flux and Charge Implementation Plan + +**Goal:** Build an interactive 3D lesson for the only enabled subject in `PLAN.md`, with an extensible model interface. + +**Architecture:** A TypeScript application shell loads models from a registry. Each model owns its controls, lesson, state, and disposable Three.js scene. Pure SI-unit physics is independent of rendering and localization. One English catalog supplies all interface text. + +**Tech stack:** Existing Vite, TypeScript, Three.js, and KaTeX dependencies; Node >=22.12.0. + +**References:** `PLAN.md`, `AGENTS.md`, and `docs/theory/3Electric flux and charge.pdf`, especially sections 3.2–3.4. + +## Constraints and decisions + +- Implement only electric flux and charge. Keep excluded subjects and deleted tests absent. +- Work in the supplied checkout, preserving existing edits and unrelated deletions. +- Do not create test scripts, per the user's explicit request. Use type checking, a production build, and direct runtime inspection. +- Use English as default and fallback, with typed message keys, parameterized messages, and locale-aware numbers. No language selector. +- Use a point charge in vacuum and a closed sphere or cube centered at the origin. Let charge position vary along x; explain the finite visual charge marker and qualitative arrows. +- Compute total flux analytically using Gauss's law. A nonzero charge exactly on the boundary gives an undefined result, not a misleading finite value. +- Native sliders, buttons, checkboxes, camera keyboard shortcuts, and a text summary make the experiment operable without a mouse. + +## Tasks + +- [x] Create build configuration, app shell, typed model lifecycle and registry, and English localization. +- [x] Implement pure point-charge field, surface membership, and enclosed-charge/flux calculations. +- [x] Implement the 3D surface, signed field arrows, movable charge, orbit camera, toggles, and presets; add live measurements and explanations. +- [x] Add responsive styling, keyboard operation, WebGL fallback, and developer documentation for adding models/locales. +- [x] Run type checking and production build; inspect browser behavior and fix observed issues without adding test scripts. + +## Review focus + +Zero/negative charge, boundary singularity, moving outside a surface, switching surface shape, resetting all controls, keyboard input, narrow screens, rendering unavailable, and scene disposal. + +## Verification record + +- `npm run build`: TypeScript and Vite production build passed. Vite reports a size warning for the Three.js vendor chunk (about 562 kB minified, 139 kB gzip); the model is loaded lazily. +- Direct Chromium inspection (no test files created): +2 nC gives +225.9 N·m²/C; −2 nC gives −225.9; an external charge gives zero. Changing sphere radius from 1.8 m to 3 m and switching to a cube preserves total flux. A nonzero charge exactly on the boundary is undefined; zero charge on that boundary gives zero. +- Reset restores the initial values and layers. Native slider keyboard input and camera arrow keys work. Desktop and 768, 390, and 320 px layouts have no horizontal page overflow. No browser page errors observed. +- Forced WebGL unavailability shows a useful message and preserves working numerical controls. +- A separate read-only code review found secondary text contrast issues. These were fixed, with the affected text now measuring 4.73:1–5.26:1. No other important findings. +- Unrelated deletions, staged user changes, `PLAN.md`, and `package.json` were preserved. Fresh application entry points were created as required by the task. No tests, test configuration, or lockfile were restored. diff --git a/docs/superpowers/plans/2026-10-24-test4.md b/docs/superpowers/plans/2026-10-24-test4.md deleted file mode 100644 index 278ab0b..0000000 --- a/docs/superpowers/plans/2026-10-24-test4.md +++ /dev/null @@ -1,59 +0,0 @@ -# Test 4 in 3D Implementation Plan - -> **For agentic workers:** Use superpowers:executing-plans to implement this plan task by task. - -**Goal:** Represent every question and answer in `docs/Test_4.md` and `docs/Test_Answers.md` through an educational, interactive 3D lesson. - -**Architecture:** Extend the existing TypeScript/Three.js lab with a separate Test 4 collection. Share the renderer and parameter UI; keep test physics, lesson content, and scene construction in focused modules. Native execution in the current checkout; the user delegated design and implementation choices. - -**Tech Stack:** Existing Three.js, TypeScript, Vite, Vitest, Playwright; no new dependencies. - -**Spec:** The two source documents above and the design below. - -## Design and constraints - -- Six lessons, with exact question scope, all subparts and original marks: 4A = 100 points, 4B = 100 points. -- Guided lessons were selected as the implementation default after the user said “Choose the details and build it.” An exam-only view hides useful explanation; a disconnected presentation would duplicate the existing renderer. -- Test 4 is the default entry. Existing experiment hash links and all eight experiments remain available through a collection switch. -- Q1: uniform-field straight/curved paths with the same endpoints and work; Q2: repelling charge, energy bars and conserved K + U; Q3: radial motion, inverse-radius energy, reference at infinity; Q4: assemble three charges and add a fourth, showing pair energies once; Q5: angled displacement in a uniform field; Q6: dipole forces, torque, rotation work and energy versus angle. -- Use adjustable progress for inspectable motion; decorative animation respects pause and reduced motion. Explicit physical units and visual scale explanations. Equations and derivations remain usable without WebGL. -- Original questions, step-by-step answers, live numerical examples and a prediction/reveal check in each lesson. Source Markdown is linked from the built app. -- Preserve existing unrelated work and source documents. No publication or repository integration requested. - -## Review focus - -Signed charges and work; arbitrary energy zeros; infinity represented analytically rather than as a finite point; each charge pair counted once; dipole torque sign versus magnitude and unstable equilibrium; mobile overflow; WebGL fallback; collection/history state. - -## Task 1: Physics models - -Files: `src/physics/test4.ts`, `src/physics/test4.test.ts`. - -- [x] Write independent numerical tests for uniform and central work, conservation, pair assembly, dipole torque/work and infinity. -- [x] Run the tests and observe missing model failure. -- [x] Implement SI functions with explicit energy references and domain validation. -- [x] Run physics tests and confirm passing. - -## Task 2: Guided lesson content and scenes - -Files: `src/test4.ts`, `src/scene/test4.ts`, `src/experiments.ts`, `src/scene/experiments.ts`. - -- [x] Add browser checks for lesson selection, parameter changes, answers, graphics and fallback. Initial browser execution required enabling the local server and downloading Chromium into `/tmp`. -- [x] Implement all six lesson definitions with original questions, subparts and derivations. -- [x] Build parameter-linked 3D diagrams with endpoint labels, force/field arrows and energy plots or bars. - -## Task 3: Navigation, learning UI and verification - -Files: `src/main.ts`, `src/style.css`, `tests/test4.spec.ts`, `tests/lab.spec.ts`, `README.md`. - -- [x] Add Test 4/experiment collection navigation, question and solution panels, observation prompts, prediction reveal, previous/next links and retained parameter state. -- [x] Verify direct links, collection/history navigation, mobile overflow, all scenes, resets and WebGL fallback. -- [x] Run `npm test`, `npm run build`, `npm run test:e2e`; inspect desktop and mobile screenshots. -- [x] Obtain an independent code review and address significant findings; document final outcome. - -## Execution record - -Baseline: 20 unit tests passed; production build passed (existing Three.js bundle-size advisory). - -Completed: all six questions and subparts are covered. Independent review confirmed physical and content consistency and found a mobile pagination issue. A new browser regression reproduced the issue, then passed after explicit pagination began focusing and scrolling the new heading. Review polish items were addressed with valid `aria-current="page"`, responsive framing and less crowded mobile labels. Both original Markdown links returned HTTP 200 with their original content from the production preview; assets are emitted as files rather than inlined data URLs. - -Final verification: 25 unit tests passed, 17 browser tests passed, strict TypeScript and production build passed, and `git diff --check` passed. No new dependencies. The existing Three.js bundle-size advisory remains. Work is left in the user's checkout without a commit or publication. diff --git a/theory/1Introduction to electrophysics.pdf b/docs/theory/1Introduction to electrophysics.pdf Binary files differindex 526298a..526298a 100644 --- a/theory/1Introduction to electrophysics.pdf +++ b/docs/theory/1Introduction to electrophysics.pdf diff --git a/theory/2Electric charge, force and field.pdf b/docs/theory/2Electric charge, force and field.pdf Binary files differindex 31ad03f..31ad03f 100644 --- a/theory/2Electric charge, force and field.pdf +++ b/docs/theory/2Electric charge, force and field.pdf diff --git a/theory/3Electric flux and charge.pdf b/docs/theory/3Electric flux and charge.pdf Binary files differindex 39a10ec..39a10ec 100644 --- a/theory/3Electric flux and charge.pdf +++ b/docs/theory/3Electric flux and charge.pdf diff --git a/theory/4Electric potential energy.pdf b/docs/theory/4Electric potential energy.pdf Binary files differindex fd62020..fd62020 100644 --- a/theory/4Electric potential energy.pdf +++ b/docs/theory/4Electric potential energy.pdf diff --git a/theory/5Electric potential and gradient.pdf b/docs/theory/5Electric potential and gradient.pdf Binary files differindex 87eee7f..87eee7f 100644 --- a/theory/5Electric potential and gradient.pdf +++ b/docs/theory/5Electric potential and gradient.pdf diff --git a/theory/6capacitance.pdf b/docs/theory/6capacitance.pdf Binary files differindex 67e697e..67e697e 100644 --- a/theory/6capacitance.pdf +++ b/docs/theory/6capacitance.pdf diff --git a/theory/7dielectricmaterials.pdf b/docs/theory/7dielectricmaterials.pdf Binary files differindex f67dd91..f67dd91 100644 --- a/theory/7dielectricmaterials.pdf +++ b/docs/theory/7dielectricmaterials.pdf diff --git a/theory/8current.pdf b/docs/theory/8current.pdf Binary files differindex a09d270..a09d270 100644 --- a/theory/8current.pdf +++ b/docs/theory/8current.pdf diff --git a/theory/9semiconductingmaterials.pdf b/docs/theory/9semiconductingmaterials.pdf Binary files differindex 14c5cae..14c5cae 100644 --- a/theory/9semiconductingmaterials.pdf +++ b/docs/theory/9semiconductingmaterials.pdf |