Speed up rasterization ~40x and large solves ~2x
- Hybrid rasterizer: PIL scanline fill for the bulk, with cells in a ~2 px band around each ring edge re-tested exactly against the polygon - cell-for-cell identical to the old center-in-polygon pass (equivalence test added) but O(vertices + cells) instead of O(vertices x cells). Measured 4.5 s -> 0.11 s at 1.45M cells with 8.8k polygon vertices. - AMG-preconditioned CG (pyamg, new requirement) above 500k unknowns: measured 7.0 s vs 15.3 s spsolve at 1.4M unknowns at a fraction of the memory, R identical to 1e-6; the old Jacobi-CG (kept as fallback when pyamg is missing) needed tens of minutes there. spsolve stays the default below 500k where it is exact and fastest. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -114,9 +114,10 @@ SWIG API. Requires KiCad **10.0.1+**.
|
||||
Rule of thumb for 70 µm foil: skin is negligible below ~300 kHz
|
||||
(δ = 173 µm at 142 kHz), ~+11 % at 1 MHz.
|
||||
- 5-point FDM per layer on an auto-sized shared grid (~2 M cells total
|
||||
across layers by default). Direct sparse solve up to 2.5 M unknowns,
|
||||
Jacobi-CG above. Discretization error typically ≲ 2 % at defaults —
|
||||
halve the cell size and compare to judge convergence.
|
||||
across layers by default). Direct sparse solve up to 500 k unknowns,
|
||||
AMG-preconditioned CG (pyamg) above — Jacobi-CG if pyamg is missing.
|
||||
Discretization error typically ≲ 2 % at defaults — halve the cell size
|
||||
and compare to judge convergence.
|
||||
|
||||
## Offline / development
|
||||
|
||||
@@ -133,7 +134,7 @@ Linux/macOS use `.venv/bin/python`):
|
||||
|
||||
```powershell
|
||||
uv venv --python 3.11 .venv
|
||||
uv pip install --python .venv\Scripts\python.exe kicad-python numpy scipy matplotlib pytest
|
||||
uv pip install --python .venv\Scripts\python.exe kicad-python numpy scipy pyamg matplotlib pytest
|
||||
.venv\Scripts\python.exe -m pytest tests -q # incl. exact analytic cases
|
||||
.venv\Scripts\python.exe tools\api_probe.py # IPC API probe vs live KiCad
|
||||
.venv\Scripts\python.exe -m fill_resistance.board_io dump.json [NET] # extract only
|
||||
|
||||
Reference in New Issue
Block a user