Skip to content

Repository files navigation

Field Boundary

Interactive Maxwell planar interface boundary conditions for (\vec{E}/\vec{D}) and (\vec{H}/\vec{B}). Drag the incident field, change (\varepsilon_r) or (\mu_r), and watch which components stay continuous — not Snell’s-law ray optics (see OpticsLab).

Features

  • Electric screen: dielectric interface with (\vec{E}) and (\vec{D}), (\varepsilon_r) presets/sliders, adjustable free surface charge (\sigma_f), optional bound charge (\sigma_b) with polarization (\vec{P}) arrows, component overlay, field lines, protractor, and angle readouts
  • Magnetic screen: same interaction grammar for (\vec{H}) and (\vec{B}) with (\mu_r) and free surface current (K_f)
  • Equation strip highlighting continuous BC terms ((E_t), (D_n) or (H_t), (B_n)), switching to jump conditions when (\sigma_f) or (K_f) is nonzero
  • Interface glyphs for free surface charge ((+)/(-)), bound charge (hollow (+)/(-)), and surface current (⊙/⊗)
  • English, Spanish, and French localization via StringManager
  • Default and projector color profiles
  • Progressive Web App (installable, offline-capable)
  • Shared GitHub Actions CI via OpenPhysics/Baton

Quick Start

npm install
npm run icons    # generate PNG icons from public/icons/icon.svg
npm start        # dev server → http://localhost:5173

Scripts

Command Description
npm start / npm run dev Start Vite dev server
npm run build Type-check + production build → dist/
npm run preview Preview the production build locally
npm test Run Vitest unit tests (includes memory-leak suite)
npm run test:fuzz Optional Playwright fuzz smoke (?fuzz, default 15s)
npm run test:fuzz:quick Shorter fuzz smoke (10s)
npm run check TypeScript type check
npm run lint Biome lint check
npm run format Auto-format all files
npm run fix Lint + auto-fix
npm run icons Regenerate PNG icons from public/icons/icon.svg
npm run rename Sim-level fork/rename (--id, --name)
npm run scaffold-screens Emit N fleet-named screen packages from intro/ (--shared-model optional)
npm run clean Remove dist/

New sims start at version: "0.0.0" in package.json. Bump only when cutting a release (for example npm version patch and a matching git tag). Keep name in kebab-case; it is separate from the SceneryStack sim identifier in src/init.ts.

Tech Stack

Tool Version Purpose
SceneryStack ^3.0.0 Simulation framework
Vite ^8 Build tool + dev server
TypeScript ^7 Type-safe JavaScript
Biome ^2.5 Linting + formatting
vite-plugin-pwa ^1 PWA + service worker

License

GNU Affero General Public License v3.0 — see OpenPhysics org license.

Contributing

See OpenPhysics contributing guidelines. Report bugs via GitHub Issues; use org issue templates.

About

Explore Maxwell boundary conditions for E/D and B/H at a planar interface between two media.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages