fieldline.

All projects

Public repository

Fields around high-voltage lines

Real-time 3D visualization of the electric and magnetic fields around overhead high-voltage lines, computed on the GPU with WebGPU. It includes exposure contours, lateral profiles and a phase-arrangement optimizer.

Field lines over one 50 Hz cycle, the ground field with exposure contours, a phasing change and the lateral profile.

The 3D views need WebGPU, and without it a CPU path with a coarser grid takes over. The demo interface is in English. Recording from the repository, no sound.

Why I built it.

I work on software for high-voltage substations. A recurring question is how strong the field under a line is when it passes near homes. I wanted to calculate it properly, see the 3D shape of the field and check the numbers against analytic solutions instead of trusting a picture.

This is also a serious WebGPU compute project. Field evaluation, marching cubes and the field line tracer are compute passes, and a float64 TypeScript implementation of the same math is the reference they are tested against.

Try it in the demo.

The demo has six views in tabs and a panel with the line parameters.

The field at ground level
The Ground tab displays the E or B field at a height of 1 or 1.8 m above ground, with exposure contours. The E and B keys toggle between the fields, and Space animates the cycle.
A lateral profile
The Profile tab shows the lateral profile with a data table and a CSV download.
Phase arrangement
The Phasing tab compares the 36 phase arrangements of a double circuit in six symmetry classes and shows why one of them wins, based on the dipole moments that cancel.
The 3D views
The tabs Volume, Isosurfaces and Field lines show the field in space: a volume slice, surfaces of constant value and animated field lines.
Changing the geometry
In the panel change Tower type, Number of spans, the sag, the voltages and the phasing.
Exposure levels
The Emphasised standard list switches the contours between ICNIRP 2010, ICNIRP 1998 and the Polish limits, and the address holds the whole state of the view.

fieldline.adrianturbinski.pl

Three hard parts.

Each decision has its ADR in the repository, with the alternatives that lost.

  • A 3D field from a hanging conductor.

    Conductors are modeled as catenaries, not infinite parallel wires. Each conductor is segmented into straight pieces with uniform charge, and the charges come from matching the potential at one collocation point per segment. The field is computed from closed-form expressions. The matrix depends on geometry only, so it is factored once with a real LU decomposition, and every voltage or phasing change reuses the factors.

    The cost: the potential residual on the conductor surface is 0.27 to 0.42 percent within the spans and up to 1.8 percent where the conductor kinks at a tower.

    What lost: a complex LU (twice the memory), Cholesky (the 3D collocation matrix is not exactly symmetric), an iterative GMRES and a Galerkin formulation.

    ADR 0002 on GitHub
  • Float32 on the GPU.

    A coordinate 450 m away from the origin has a float32 spacing of 3e-5 m, which is 0.02 percent of the clamp radius. So segment ends and evaluation points get subtracted from the centre of the region in float64 on the CPU, and only the differences are passed to the shaders.

    The cost: the error in the clamp zone is 6.5e-4 against a target of 1e-3, a factor of 1.5. Away from the clamp zone, the error is below 1.2e-4.

    Lost: GPU-side evaluation in world coordinates (the error would appear next to a conductor) and float32 emulation on the CPU (it would not account for driver differences).

    ADR 0022 on GitHub
  • Knowing the numbers are right.

    Every layer is validated against something external to itself: an analytic solution, the 2D model that the 3D result must approach, a published paper on limit heights and the float64 code the GPU is compared with. The paper is Bendík, Cenký and Eleschová, Electricity 2026, 7(2), 39 (CC BY 4.0), and the 2D model reproduces 13 of its 14 cases. The fourteenth, the Portal tower, is fitted and labeled.

    The limitation: the study is only in 2D, so the 3D model has no published reference, and I validate it through its convergence to 2D. My limit heights are 0.014 to 0.028 m lower than the published ones, and I have not isolated why.

    What lost: an invented reference profile and a comparison with a commercial tool.

    ADR 0017 on GitHub

Numbers.

Only what the scripts in the repository measured.

6.5e-4
Largest relative error of E from the float32 shaders against the float64 code, in the clamp zone. The same on the RTX 3070 Ti Laptop, the Iris Xe and SwiftShader, and 1.5e-4 to 1.6e-4 for B. Target: 1e-3.
50 ms
Median from a geometry change on the horizontal tower to the frame shown, on an RTX 3070 Ti Laptop. The worst case was the double circuit at 124 ms. The goal is a median under 200 ms.
0.999999
Ratio of the peak E at mid-span in the 3D model to the 2D model, for a straight line with an 800 m span. Across the three towers, it ranges from 0.9936 to 0.9972 with the default spans.
13 of 14
Cases from a published 420 kV study reproduced by the 2D model (26 out of 28 limit heights), 0.014 to 0.028 m below what the paper reports. One case is fitted and marked.
8 ms
Median frame interval in nearly every view on both real GPUs at 1920 by 1080. Since it is the frame clock of the headless browser, it only shows that the views fit inside it. The exception is the E field lines view on the Iris Xe, at 15.6 ms.
902
Unit tests, plus 90 script tests and 108 end-to-end tests, with line coverage of 99.3% for the core and 82.2% for the app. Lighthouse accessibility, best practices and SEO are all 100. Performance is 76 to 89 on the software adapter and 93 to 100 on the CPU path.

Measured on one laptop, an Intel Core i7-12700H running WSL2, on 2026-10-11. The software numbers (SwiftShader, the CPU backend) come from Chromium 156, and the GPU numbers from headless Chrome 154 on Windows: an NVIDIA GeForce RTX 3070 Ti Laptop and an Intel Iris Xe. I did not measure a mid-range desktop GPU.

The result files in bench/results

What is not built.

From the stretch list I built none of the three: Deri’s complex image for earth return, sloped terrain and two parallel lines in a corridor.

Earth return and shield wires
Earth return and shield wire currents are neglected. The estimate for an unbalanced remainder of a full 1000 A gives 0.2 µT at the ground, and neglecting the shield wires overestimates B.
One line, flat ground
Two parallel lines would need new timings, and sloped terrain breaks the image method.
The CPU path
A full quality update on the CPU backend takes 241 to 429 ms at the median. The draft quality drag is the only one below 200 ms.
One laptop
Two real GPUs on one machine and one browser engine, Chromium. Firefox and Safari were not tested.
Dashed contours on the GPU
On the GPU the contour dashes follow the dominant axis of the gradient, so on very steep contours their length is not exactly constant.

What comes next.

Three things: Deri’s complex image for earth return, shorter segments next to the towers and measurements on a mid-range discrete GPU.

ADR 0025: the extras left out

Tech

  • Angular
  • TypeScript
  • WebGPU
  • WGSL
  • NgRx
  • SignalStore
  • Signals
  • Web Workers
  • Playwright
  • GitHub Actions
  • WCAG 2.1
  • Keyboard support

Let's talk about the role.

contact@adrianturbinski.pl

Tell me about the team, the product and the stack.

Got a project to build? There's a client edition too.