Load any 3-D shape: a lattice unit cell from nTop, a complete sample, a CAD part (STL, OBJ, PLY, OFF, 3MF, GLB, STEP, IGES), a built-in TPMS cell or a primitive. Set the material and waveguide, press Run, and get:
- Waveguide S-parameters: S11, S21, S12, S22 (magnitude and phase) from a full-wave 3-D FEM
- Reflectance, transmittance, absorbance (linear) and shielding effectiveness
- Effective permittivity of the sample (Nicolson–Ross–Weir), checked against Hashin–Shtrikman bounds
- Radar cross section of a metal plate coated with the sample vs the bare plate: vs frequency, vs angle, TE and TM, with a full-wave check of the metal-backed reflection (ε_eff and RCS need a sample that spans the guide opening; see Any shape below)
- Excel workbook, figures and a Touchstone
.s2pfor every run - Solver health checks, shielding effectiveness and an RL thickness × frequency map for every run
Windows 10/11 installer: ShapeSpro-Setup-1.19.0.exe (256 MB) · Manual: ShapeSpro-1.19.0-Manual.pdf (14 MB) · all releases
Please cite the archived software: H. Sharma, ShapeSpro: Lattice EM Simulation Studio, Zenodo,
doi:10.5281/zenodo.24726703 (all versions; version 1.19.0 is
doi:10.5281/zenodo.24726704). CITATION.cff has the same entry, and GitHub's
Cite this repository button formats it as APA or BibTeX.
Download ShapeSpro-Setup-1.19.0.exe (or a newer
version from the Releases page) and run it. No Python is needed. It adds a Start-menu
entry; your runs are saved in Documents\ShapeSpro. Windows may show a "protected your PC" notice for the unsigned
installer (More info → Run anyway). Recommended: 16 GB RAM (large lattices need 3 to 5 GB free per run).
Double-click ShapeSpro.lnk or ShapeSpro.bat. ShapeSpro opens in its own
window; closing the window stops it. From a terminal:
python ShapeSpro.py # app window
python ShapeSpro.py --server # server only; open the printed address in any browserRequirements: Python 3.10+ and pip install -r requirements.txt (numpy, scipy, gmsh, pypardiso, trimesh,
vtk and others). The window is a native pywebview window, or Microsoft Edge in app mode if pywebview is absent.
Fonts, charts and the 3D viewer library are bundled, so ShapeSpro works offline.
New here? In step 1 press Load example project. It loads the bundled nTop
gyroid cell (examples/) and opens the saved runs in Results.
The interface follows the Claude Design prototype in
design/prototype_white.html (white theme): the same layout, components, colours
and states, wired to the real solver.
| Step | What you set |
|---|---|
| 1 Geometry | Parts, stacked from port 1 to port 2. Load each one from a 3D file, a path on disk, a TPMS cell (gyroid, Schwarz P, Schwarz D, Fischer–Koch S, Lidinoid, Schoen F-RD; sheet or solid) or a primitive (block, cylinder, sphere, cone, pyramid, wedge), as a new part or replacing the selected one. Per part: Periodic unit cell or Whole object, rotate 90° about X / Y / Z, Split into bodies, name, air spacer before it. Reorder with ↑ ↓. |
| 2 Material | Materials library (complex ε = ε′ − jε″ and μ = μ′ − jμ″, presets or measured values), and the material of every body of every part, plus what fills each part's empty space (air by default) |
| 3 Waveguide & band | WR-137 / WR-90 / WR-62 / WR-42 or custom; frequency points; air gaps; thickness in unit cells (periodic), or placement Centred, real size / Stretch to fill opening (whole object) |
| 4 Mesh & solver | Element order (1–3), Coarse / Medium / Fine (4 / 6 / 8 elements per cell, or 20 / 30 / 40 per wavelength in the solid for a whole object), Fit to this PC, port modes, CPU cores (1–8), material model, curved elements on object surfaces, fast sweep / field maps / convergence study / adaptive refinement / compute device (CPU or GPU), plus a live estimate of problem size, run time and memory |
| 5 RCS setup | Plate size, angle range, full-wave metal-backed check on/off, and its number of check frequencies (default 8) |
| 6 Solve | Run name, settings summary (click a value to edit that step), Run / Stop, live stage list; levelled messages (INFO / OK / WARN / ERR) in the console |
| 7 Results | Saved runs: open, open folder, delete |
CPU cores. Step 4 sets how many cores a run may use, 1 to 8 (default 8). One limit covers the MKL PARDISO factorizations and the NumPy/SciPy BLAS pools; the run log states it. Results do not depend on it (identical S-parameters at 1, 3 and 6 cores; 8 was added later and changes only the speed). nTop gyroid, 3 frequencies: order 1 72 s / 61 s / 49 s at 1 / 3 / 6 cores (measured before the limit became 8). Fewer cores keep the PC responsive during a long run.
Fit to this PC (step 4, on by default). The chosen density (Coarse / Medium / Fine) is the finest mesh
a run uses. If its estimated memory is above the budget (75 % of this PC's RAM, or 90 % of the memory free
at that moment if that is less; it is checked again when the run starts), the mesh is made coarser in 3 %
steps (sample and air elements together, air at most 1.5× coarser) until the run fits. It never goes below
3 elements per cell, or below the density where the expected discretization error reaches about 2 %. The
estimate assumes about 0.2 % at Medium, scaling as h^(2p) for element order p and as h² for sub-cell-averaged
lattices. Step 4 shows what the chosen density would need, the density used, its memory and the expected
error. When even the coarsest accurate mesh does not fit, it lists other changes that would fit (the sub-cell
averaging material model, one cell thick, a lower element order). A run is still refused above 2× the RAM.
The run log, meta.json (mesh_note, fractional elements_per_cell) and the report record the mesh
actually used, so a coarsened result is never mistaken for one at the chosen density. A mesh convergence
study keeps its Coarse / Medium / Fine levels. Example on a 15.6 GB PC: a Fine gyroid stack needing ≈ 243 GB
runs at 3.6 elements per cell in ≈ 10.5 GB (expected error ≈ 0.5 %).
Stop simulation. While a run is going, a red Stop simulation button sits in the header on every step (and Stop in step 6). After you confirm, the run ends at once, even in the middle of a matrix factorization: each study runs in its own process, which is terminated, so its memory is freed. Nothing from a stopped run is saved (results are written under a temporary folder name and only appear when complete), and your settings are unchanged. A run started in another ShapeSpro window shows up, with its Stop button, within about 10 s.
Steps 2–6 unlock once a shape is loaded and has passed the geometry check (next section). Back / Next walk through the steps.
One run can hold any number of materials:
- Stacked parts: for example a PLA gyroid, a 0.5 mm air gap, a carbon-PLA gyroid and a ferrite sheet, for graded and multilayer absorbers. Each part has its own placement and its own element size.
- Bodies inside a part: Split into bodies separates the disconnected pieces of a multi-body file (core and skin, two interpenetrating networks, an insert), and each body gets a material.
- Filled voids: a part's Empty space can be a material instead of air, for example a resin-infilled lattice.
- Magnetic materials (μ ≠ 1): ferrite or carbonyl-iron composites. NRW then extracts μ_eff as well as ε_eff.
How the results work:
- One part: NRW gives ε_eff (and μ_eff when the part is magnetic) of the whole sample, as before.
- A stack: a single ε_eff of an asymmetric stack would be meaningless. Instead each layer is simulated alone in the guide and homogenized by NRW. The RCS then uses the layers as a stack (a transmission-line model, TE and TM), and the full-wave metal-backed check compares that layer model with the real stack.
- Element size: each part is meshed at its own size. A dense material (|n| = √|εμ| large) needs small elements: at Medium, λ/30 inside it. Coarse (λ/20) is about 0.5% in ε for such layers; the Mesh step shows which part sets the size.
In step 3 (waveguide excitation), Ports chooses the setup:
- Two-port · transmission (default): port 1 and port 2 on either side of the sample. This gives S₁₁, S₂₁, S₁₂, S₂₂, R/T/A, εeff and μeff by NRW, the coated-plate RCS, and the optional full-wave metal-backed check.
- One-port · metal-backed: port 1 faces the material, and a metal short closes the guide
right behind it. This is the short-circuited line measurement of a metal-backed absorber.
The 3-D view draws the metal plate in place of port 2.
- Results: S₁₁ (magnitude and phase), return loss, R and A = 1 − R (nothing is
transmitted), and a Touchstone
.s1p. - εeff from S₁₁ (short-circuited line method, μ = 1): solved frequency by frequency from the exact shorted-layer TE₁₀ reflection. It needs one full-width, non-magnetic layer, and a single port cannot separate ε and μ. The coated-plate RCS then uses it.
- No separate full-wave check: the one-port run already is the sample on metal.
- The mesh ends at the sample, so a run has fewer unknowns than the two-port version.
- Results: S₁₁ (magnitude and phase), return loss, R and A = 1 − R (nothing is
transmitted), and a Touchstone
Validation (fem_em_solver/tests/test_oneport.py): a 3 mm solid block, ε = 4 − 0.4j,
order 2, gives |S₁₁ − exact| ≤ 0.0009 and εeff = 3.999 − 0.400j. For the nTop gyroid
in carbon PLA (2 cells), εeff from the one-port run is 2.548 − 0.808j. The exact-wall
cell homogenization of the same gyroid gives 2.538 − 0.819j.
Dispersive materials (step 2, Edit material → Frequency dependence):
- Fitting: switch a material to Dispersive model and fit a causal model to one of three sources: the preset's measured curve (MSU data, your imported tables), a finished run's εeff, or data you paste (GHz, ε′, ε″ per line).
- Models: Best causal model (auto), Debye with 1 or 2 poles, Cole–Cole, Lorentz, Drude, with or without a conductivity term σ, or the measured table itself.
- Kramers–Kronig: the fit comes with a Kramers–Kronig check.
- In the run: ε at the band centre is shown and used for mesh sizing; the solver uses the model at every frequency (built-in solver). Save to my library keeps the model.
Design-law error bars and refinement (step 2, design-law card):
- Error bars: every εeff has a ±1σ error bar. It comes from the law's training errors near this cell and grows outside the fitted ranges.
- Solve this cell: runs the exact conforming cell homogenization (15–60 s). The result corrects the law near this cell and shrinks the error bar. Example: the carbon gyroid went from ±3.5 % to ±1.0 %.
- Where is the law least certain? lists the library cells to solve next.
- Clear my solves removes your corrections.
Refit the design law with PySR (step 2, design-law card → Refit the law):
- What it does: PySR searches for a new equation on the 567 dataset rows plus your Solve this cell results. Your results are weighted 5× by default, which you can change.
- Where it runs: in a separate background process, so ShapeSpro stays usable.
- How long: Family-out validation refits the law six times, each without one TPMS family, then fits the final law (about 8 min). Quick fits the final law only (about 1 min). Julia's first start-up takes about 30 s.
- The result: the new equation is shown next to the current one, with its fit error and unseen-family error. Use the new law switches to it; Discard drops it. A result left waiting is kept across restarts.
- Going back: every replaced law is listed under Earlier laws with a Restore button.
- Needs: PySR and Julia on that PC (
pip install pysr). Without them the saved law still works and the panel says so.
Accuracy and speed (step 4, waveguide runs):
- Fast frequency sweep: about 10–15 FEM solves for any number of points (up to 401), by adaptive rational (AAA) interpolation.
- Field and absorbed-power maps: on by default; they cost at most one extra solve.
- Mesh convergence study: Coarse + Medium + Fine (about 5× the Medium time), with an extrapolated result and error bands.
- Adaptive mesh refinement: solve, find where the field error is largest, refine there, repeat until the S-parameters stop changing between passes (the HFSS ΔS procedure; see Adaptive mesh refinement). Also available for plane-wave runs.
Results of a waveguide run add these sections below the S-parameters:
| Section | What it shows |
|---|---|
| Accuracy and validity | Effective medium: valid / caution / not valid, from the phase per cell k·p, the apparent μ of a non-magnetic sample and the port-1/port-2 asymmetry. Kramers–Kronig: ε′ predicted from ε″ against the extracted ε′. Mesh convergence: observed order, error band per quantity, the three meshes with the extrapolated curve. |
| Adaptive mesh refinement | When the run used it: Converged / Not converged, why it stopped, and a table of every pass (elements, ΔS, error indicator) with a chart of ΔS against its target and of the element count |
| Impedance | Smith chart of S₁₁ (and S₂₂) with hover read-out of Γ and Z/Z₀, and Zin/Z₀ against frequency (matched at 1 + j0) |
| Fields and absorbed power | Absorbed power by part and by material at the band edges, centre and peak absorption, next to 1 − |S₁₁|² − |S₂₁|²; heat maps of |E| or loss density on the E-plane, H-plane or mid-sample cross-section, with the sample faces marked |
| 3-D absorption and power flow | The sample in 3-D, coloured by where it absorbs; power-flow arrows and flow lines; the electric field animated through one period; absorbed power against depth (below) |
3-D absorption and power flow. The views use the same frequencies as the field maps (band edges, centre and peak absorption ★). Drag to orbit, scroll to zoom, and use Snapshot to save a PNG.
- Absorption on the shape: the sample's own surface, placed as the solver placed it (periodic
cells tiled over the opening). Each triangle is coloured by the absorbed power density just inside
the material: % of the incident power per mm³, log or linear scale.
- Show where X % of the power is absorbed keeps colour only on the hottest regions that together absorb X %, and greys out the rest.
- Cut along x, y or z removes the part in front of the cut. The cut face shows the density inside the walls, from a grid of about 250,000 points.
- Power-flow arrows: the time-average Poynting vector S = ½ Re(E × H*), in the E-plane, the H-plane or the whole volume. Arrow length goes as √|S|, relative to the mean incident power density.
- Flow lines: S followed from 36 seeds in front of the sample. A line turns from red to grey as its power falls, so lines that fade inside the material show where the power is absorbed.
- Wave animation: E(t) = Re(E e^{jωt}) through one period, as arrows.
- Charts:
- Absorbed power per mm of depth, with the running total and the share of each unit-cell layer.
- Absorbed power against the distance below the nearest material surface (element centres).
Checks: across the air in front of the sample, the net power flow equals 1 − |S₁₁|², and behind it
|S₂₁|², both within 0.5 %. The depth profile adds up to the absorptance, on lattice, sphere and two-part
stack runs. Resolution: walls show only where the mesh resolves them, as with an object on the
conforming mesh. A lattice with sub-cell averaging shows the element average near each wall. A lattice
homogenized by the conforming model is a uniform slab to the solver, so its colours show only how
absorption falls with depth. The panel says which case applies, and the distance chart is greyed out
when most of the absorption is in elements that mix material and air. The views add a few seconds to a
run (7 s for a 50k-unknown lattice) and a fields3d.bin of about 1–10 MB.
They are made with the field maps (built-in solver; runs saved before this version do not have them). Above 300,000
surface triangles, cells are drawn simplified. With very many cells, only the quarter x < a/2, y < b/2 is drawn.
Free-standing plane-wave runs at 0° also report the free-space εeff (NRW with no cutoff), as a lens-horn measurement would.
Files: the run folder also gets smith.png, fields.json and, for the 3-D views, fields3d.json
with fields3d.bin. The workbook adds Zin,
the validity indicators, the Kramers–Kronig prediction, convergence bands and the absorbed power
by part.
A fixed mesh gives a result with no statement of its accuracy. With Adaptive mesh refinement on (step 4, Accuracy and speed; waveguide and plane-wave runs), ShapeSpro follows the procedure of HFSS's adaptive solution:
- Mesh coarsely (2× coarser than the chosen density) and solve at the solution frequencies (default: band start, centre and end).
- Estimate the error of the field in every tetrahedron, and refine the 30 % with the largest error (Refined per pass).
- Mesh again and solve. ΔS = max |S(pass N) − S(pass N−1)| over the solution frequencies and all S-parameters (for plane waves: over the angles, both polarizations, and the specular reflection and transmission coefficients).
- Stop when ΔS is below the target (default 0.01; HFSS suggests 0.005 to 0.01), when Max passes (default 8) is reached, when the mesh cannot get finer (minimum element size is 1/16 of the requested size), or when the next mesh would not fit the memory budget (75 % of the PC's RAM). The frequency sweep, the fields, the NRW extraction and the RCS then run on the last mesh.
Error indicator. A residual estimator for the vector wave equation (the standard one for edge elements: Beck, Hiptmair, Hoppe and Wohlmuth 1999; Monk 2003). For each element it adds the squared residual of the wave equation inside, and the squared jumps across its faces of the tangential H and the normal D, which should be continuous. Terms are weighted by the element and face size so that all have the units of the field energy, and the sum is shown relative to the energy of the solution. It needs no extra solve; for orders 2 and 3 it includes the curl of ν curl E from the vertex values. Elements on PEC walls and ports carry no jump term.
Waveguide runs: local refinement. The marked elements become a size field for gmsh (every node of a marked element asks for 0.7 of its current edge length), and the guide is meshed again. Isolated single requests are not followed by the mesher, so whole neighbourhoods are refined. With the conforming material model the refinement composes with the finer elements along object surfaces.
Plane-wave runs: grid refinement. The unit cell must stay exactly periodic, so refinement bisects the grid intervals along x, y and z (15 % per axis) that hold the largest error; material interfaces stay on grid planes.
Reading the result. The results page shows the passes. ΔS is a change between meshes, not the error itself: if ΔS falls by a factor r per pass, about ΔS·r/(1 − r) is still to come, and the page shows this rough estimate when r < 0.85. Remeshing adds noise of a few 10⁻³ to ΔS (measured on a 4 mm slab at 50,000 to 120,000 elements), so a target below that is not meaningful with local refinement. A run that stops without converging says why, and its result is on the last mesh.
Checks (fem_em_solver/tests/test_adaptive.py):
- The indicator falls as the mesh is refined (relative indicator 2.6 → 1.5 → 1.0 at A/6, A/10, A/16 for a dielectric slab in WR-90, as the true error does: 0.20 → 0.067 → 0.023), and 100 % of the largest indicators lie in the slab.
- A dielectric rod across WR-90 (ε 12 − 0.6j), error against a mesh of 89,000 unknowns: at 5,300 unknowns adaptive refinement has error 0.126 against 0.461 for a uniform mesh of 4,300; at 15,000 it has 0.044 against 0.074 for a uniform mesh of 20,000. ΔS falls with the error (0.77, 0.35, 0.084).
- A full study of a homogeneous slab converges in 2 passes (ΔS 0.005) with |ΔS| 0.0075 from the exact layered solution. A metal-backed slab under a plane wave (TE and TM, 0° and 45°) converges in 2 passes with |ΔR| 0.0022 from the exact oblique-incidence solution.
Limits.
- It is no faster than a fine uniform mesh when the error is mostly wave phase error along a long smooth air line (a plain slab in a long guide): the estimator then marks the whole line, as it should. Its advantage is on samples with local detail (rods, posts, objects, lattice cells), and it gives a ΔS check that a fixed mesh does not.
- The mesh convergence study turns it off: that study runs three fixed meshes.
- The per-layer runs of a multi-part stack and the full-wave metal-backed check use ordinary meshes.
- The starting mesh is coarser than the resolution rules of the Mesh resolution card; the card then reports the final mesh, and parts of it (air far from the sample) may stay under the rule when the error there is small. ΔS, not the card, decides convergence.
- The estimate in step 4 assumes 5 passes ending near the chosen density; the loop usually stops earlier.
ShapeSpro runs on any PC. Without an NVIDIA GPU, or without the GPU libraries, every study uses the CPU exactly as before, and nothing in the installer depends on CUDA. With a GPU, the sparse direct solve (the factorization that took 36 % of a 144,000-unknown waveguide run and 62 % of a plane-wave one, and more on larger problems) can run on it, through NVIDIA's cuDSS library.
Compute device (step 4, Accuracy and speed; also compute in the settings):
| Choice | What it does |
|---|---|
| Auto (default) | CPU, unless a GPU is present, its library is installed, and the first factorization of each size is timed on both: the GPU is kept only if its answer has the same accuracy (residual) and it is at least 1.25× faster. Systems below 40,000 unknowns always use the CPU (transfers cost more than the solve). |
| CPU | Never uses the GPU. |
| GPU | Uses the GPU for systems of 2,000 unknowns or more; the residual of its first answer is checked. It can be slower than the CPU: use the test. |
In every mode a GPU failure (no memory, driver error, wrong answer) moves the factorization to the CPU for the rest of the run, with a warning in the log; the study completes. The results page says which hardware solved it, and the spreadsheet has a sparse solver hardware row.
Does a GPU help? Only some. The solve is double-precision complex arithmetic, and a card's double-precision rate decides. Data-centre cards (A100, H100, V100) run it at half the single-precision rate and are fast. Workstation and gaming cards (Quadro P1000, GeForce, RTX) run it at 1/32 to 1/64, about 45 to 60 GFLOPS for a Quadro P1000 against typically several times that for a multi-core CPU (not measured on your PC), so they are usually not faster, and 4 GB of memory also limits the size (cuDSS can stream factors from host memory, which is slower). That is why Auto measures instead of assuming. The parts of a run that are not the solve (meshing, assembly, the Kramers-Kronig fit, fields) stay on the CPU, so even a fast GPU gives less than the solve's share of the run (37 % at 144,000 unknowns, 62 % for a plane-wave cell).
Setting it up (an NVIDIA driver R528 or newer first; nvidia-smi must work; no CUDA toolkit and no Python needed):
- Installed app, from the app: step 4 → Compute device → Install GPU support. The app downloads the 18
packages that
pip install "nvmath-python[cu12]"would install for Windows x64 / Python 3.14 (2.1 GB: cuDSS, cuBLAS, cuSPARSE and the other CUDA 12 libraries, nvmath-python, cuda-bindings), checks each against the SHA-256 listed inshapespro/gpu_manifest.py, unpacks them into%LOCALAPPDATA%\ShapeSpro\gpuand runs the GPU test. About 6.6 GB of disk is needed while installing; the downloads are kept until it finishes, so an interrupted install resumes. - GPU PC without internet: on any PC with internet run
ShapeSpro.exe --gpu-pack D:\gpu(orpython ShapeSpro.py --gpu-pack D:\gpu), copy the folder over, then Install from a folder in the same place, orShapeSpro.exe --gpu-install --from D:\gpu. The files are checked against the same SHA-256 list. - From a terminal:
ShapeSpro.exe --gpu-installdoes the same as the button. - From source:
pip install "nvmath-python[cu12]"into the Python that runs ShapeSpro (the app's installer is for Python 3.14, the installed app's version; a folder it made is used by that Python version only). - Before:
pip install --target "%LOCALAPPDATA%\ShapeSpro\gpu" "nvmath-python[cu12]"with a Python 3.14 still works (or setSHAPESPRO_GPU_LIBSto another folder). - Use the
cu12libraries for a Pascal card such as the Quadro P1000: as far as I know CUDA 13 no longer supports Pascal.
Checking it on your PC. In step 4, Check again looks for the GPU, and Test GPU speed (when a GPU and the
library are found) runs the test below in a separate process, so a driver crash cannot close the app. The same from a terminal, which
also works for the installed app (ShapeSpro.exe --gpu-test --out result.json):
python ShapeSpro.py --gpu-info # the GPU, its memory, compute capability, driver, FP64 class
python ShapeSpro.py --gpu-test # solve real waveguide matrices of 3 sizes on CPU and GPU: time and accuracy
What is verified and what is not. The choice between CPU and GPU, the accuracy check, the fall-backs
(creation failure, failure in the middle of a sweep, an inaccurate answer, a slower GPU), the handling of symmetric
(upper triangle) and unsymmetric matrices, the detection of a Quadro P1000, and a complete plane-wave study through the GPU path are tested with a stand-in
engine (fem_em_solver/tests/test_gpu.py; the stand-in matches the CPU to 1e-13). The app's installer was run end to
end with two of the real packages (download, SHA-256 check, unpacking, pywin32's start-up file, loading by the solver, the
offline folder, a tampered file refused). cuDSS itself has not been run: the PC this was developed on has no NVIDIA
GPU. nvmath-python 1.0 does publish Windows wheels for Python 3.14. Not confirmed: which of the cuDSS release notes'
minimum-architecture statements applies to Pascal (the current documentation says Pascal and newer; the oldest release
notes say SM 7.0). --gpu-test answers that on your machine.
Step 3 has an Excitation choice:
- Waveguide · TE₁₀ (default). The sample in a rectangular guide gives S-parameters, εeff by NRW, and the coated-plate RCS. This is what a waveguide VNA measures.
- Plane wave · infinite array. One unit cell is repeated infinitely in x and y, with
Bloch-periodic walls and Floquet ports, and is solved full-wave for each incidence angle, in
TE and TM. This is what a free-space or NRL-arch measurement of an absorber measures.
- Set the angles θ (for example
0, 30, 45, 60), the azimuth φ, and what is behind the array: a metal plate (absorber) or free space. - The 3-D view shows a 3 × 3 patch of the array, the plate, and one arrow per angle.
- A warning appears when the period allows grating lobes in the band.
- Steps 4 and 6 show the problem size, time and memory, and Stop works as usual. RCS setup (step 5) is not used.
- Adaptive mesh refinement (step 4) refines the periodic grid until ΔS of the specular reflection coefficients is below the target; see Adaptive mesh refinement.
- Set the angles θ (for example
Plane-wave results show:
- reflectance (dB) and absorption against frequency for every angle, as TE, TM or both;
- reflectance against angle at a chosen frequency (slider);
- the reflection phase (metal-backed) or the transmittance (free-standing);
- a table per angle;
- downloads: CSV and figure.
In step 3, Waveguide · TE₁₀ → Sample model → Infinite array · one unit cell gives the waveguide result of the whole sample from one unit cell, as HFSS does with a unit cell and Floquet ports. The TE₁₀ mode of a guide of width a is two plane waves at ±θ with sin θ = c / (2 a f): 53° to 32° across WR-90. The metal walls mirror the sample. So, at each frequency, the cell is solved at that angle in TE (E along y), and its TE(0,0) reflection and transmission are the guide's S₁₁ and S₂₁ at the sample faces. With Two-port, port 2 is a Floquet port behind the sample and εeff follows by NRW with the guide's cutoff, as in a waveguide run. With One-port, a metal short sits right behind the sample and you get S₁₁ only.
-
The sample is taken to fill the whole opening and to continue beyond the walls (they mirror it). Choosing the model sets the shape's placement to Periodic unit cell (thickness in cells); switching back restores a whole-object placement. Air gaps, side gaps and the coated-plate RCS do not apply.
-
Fit to guide: As is keeps the real cell size (an infinitely wide array of your geometry). Whole cells scales the cell in x and y to a / n × b / m, so that whole cells fill the guide (Schwarz P 5.5 × 5 mm → 5.715 × 5.08 mm, +3.9 % / +1.6 %). The result then equals the whole sample in the guide, for the scaled geometry; the run notes say so.
-
The 3-D view (Infinite array in waveguide) fills the opening with cells, outlines the solved cell, shows the array continuing beyond the walls, and draws TE₁₀ as its two plane waves at ±θ.
-
Exact when the cell is mirror-symmetric (TPMS such as Schwarz P are) and the guide holds a whole number of half cells: a = n·dx/2 and b = m·dy/2, so that the walls fall on mirror planes. In WR-90 a 5.715 × 5.08 mm cell tiles it 4 × 2. Test: a lossy box inclusion in that cell matches the full guide to |ΔS| = 3.7×10⁻⁴ (order 2), with 26k instead of 176k unknowns and 10 s instead of 50 s.
-
Not exact when the cell does not tile the guide: a 5.5 × 5 mm cell fills WR-90 4.16 × 2.03 times. The result is then that of an infinitely wide array; the cut cells at the walls of a real sample are not modelled. Step 3 says which case applies and gives the cell size that would tile the guide.
-
Results: S₁₁ and S₂₁ in dB and phase, NRW εeff, the TE₁₀ angle θ(f), the loss, Cole–Cole, RL and Smith sections from that εeff, and
floquet_waveguide_equivalent.csv. -
Half cell (Auto · if mirror-symmetric, the default; or Off). When the run starts, the cell's voxel grid is compared with its mirror image in y. If it is symmetric (within 2 % of its solid voxels, and centred), only the half y = 0 … dy/2 is meshed. It is solved twice on the same half mesh, one after the other: TE with PEC (metal) walls on the two mirror planes, and TM with PMC walls (no constraint). The x faces stay Floquet-periodic, so the oblique TE₁₀ angle is kept. This is the HFSS symmetry-boundary trick, and it is exact.
- A box inclusion at 30–55° matches the whole cell to |ΔS| ≤ 6×10⁻⁵ with 46 % (TE) / 54 % (TM) of the unknowns.
- A conforming sphere lattice matches to 3×10⁻⁴ with 25k instead of 47k unknowns.
- Only one half-size factorization is in memory at a time: a third to half of the memory, at about 0.7× the time.
- An asymmetric cell (a gyroid, an off-centre object) is solved whole, and the log says why.
-
3-D absorption view of the infinite-array waveguide model.
- The solved cell is repeated across the guide opening at the TE₁₀ angle of each frequency.
- It is shown at the frequency of highest absorption and at the band centre, TE and TM. The view shows where the shape absorbs, plus |E|, |H| and the loss density (W/m³), with cut planes and depth profiles.
- A half cell is shown whole through its mirror image.
- Check against the whole cell: the absorbed power and band-mean loss, |E| and |H| agree within 1 %. Point by point (order 2, conforming) the median difference is below 1 %.
-
Z_in plane, publication quality. Every iso-RL curve is an exact circle, so the chart is vector.
- The chart shows:
- filled RL bands at −10 to −40 dB, with a colour bar;
- labelled −10 / −20 / −30 dB circles and the matched point Z_in = Z₀;
- Z_in(f) per polarization, with round-GHz ticks, start ○ and end ■ markers, a direction arrow and the best RL ★;
- real axes with ticks.
- It saves as PNG, SVG or CSV.
- Journal figure draws the same plot with matplotlib at a journal column size (IEEE, Elsevier, Nature, ACS, thesis), with fonts embedded. Formats: PDF, SVG, EPS, or TIFF / PNG at 300–1200 dpi. Colours: Blues, Viridis or greyscale. An optional panel label such as “(g)”.
- The chart shows:
-
Out-of-core (step 4, Out-of-core (factors on disk)). MKL PARDISO keeps the matrix factors in files on disk and only part of them in memory. This applies to every study.
- Auto (default) uses the disk only for a factorization that would not fit the free memory, so the run goes on more slowly instead of stopping.
- On always uses it. With Fit to this PC the mesh may then be 3× larger than in memory.
- Off never does.
- Example, 125k complex unknowns: 1.5 GB in memory, against 1.1 GB at 4× the time or 0.25 GB at 10×. The files go to a private temporary folder, which is removed after the run. A run that used it says so in its notes.
The unit cell is solved with anisotropic sub-cell averaging on a periodic mesh with 6 / 8 / 12 elements across the cell (Coarse / Medium / Fine) and the built-in elements of order 1–3. Use Fine for final numbers. Accuracy and validation are described in the solver README ("Floquet ports").
Step 1 has a Shape analysis box under the loaded shape with four tabs. Overview, Pores and
Tortuosity are measured on the voxelized solid the simulation sees (shapespro/shapeanalysis.py,
about 10 s); Mesh is the mesh quality report below. Both run automatically after a load for
meshes up to 2 M triangles; otherwise use Measure shape and Analyse mesh.
A periodic unit cell is measured with its faces wrapped (pores and walls continue into the next cell); a whole object sits in open air. The result is kept for each use, so switching the part between Periodic unit cell and Whole object offers Measure shape again.
| Tab | Values |
|---|---|
| Overview | size, solid and box volume, porosity, surface area (cut faces of a cell left out), specific surface Sv and SvL, mean wall and pore size, tortuosity along E, pieces and genus, thinnest walls against the element size |
| Pores | wall thickness and pore size (mean ± sd, thinnest 5 %, largest), hydraulic pore diameter 4φ/Sv, open and closed porosity, closed pores, solid pieces, Euler number, surfaces and genus, surface orientation ⟨n²⟩ and anisotropy |
| Tortuosity | per axis, for the air and the solid: geometric τgeo and diffusive τdiff, plus the relative conductance σeff/σ0 |
| Mesh | the mesh quality report and repair (next section) |
How the values are measured:
- Wall thickness and pore size are local thickness: at each point, the diameter of the largest sphere that fits in the solid (or the air) and covers it, averaged over the volume.
- τgeo is the mean shortest path through the phase from one face to the opposite one (26-neighbour voxel graph) over the straight distance; 1 means straight channels.
- τdiff = φ / (σeff/σ0) comes from a conduction solve in the phase. For the solid along E (y), σeff/σ0 is the share of a conductive filament's conductivity that the lattice keeps.
- Genus is the total genus of the solid–air surfaces (surfaces − Euler number). A sheet TPMS cell has two surfaces; the sheet gyroid has genus 5 each per cubic cell.
Checks (tests/test_shapeanalysis.py):
- a 2 mm plate measures 1.92 mm thick, and a 4 mm sphere measures 3.93 mm;
- straight channels give τ = 1.000, and 45° channels give τdiff = 2.005 (exact: 2);
- the gyroid sheet at 30 % solid has a 0.465 mm wall in a 5 mm cell, 2 surfaces and genus 10, and τdiff of 1.67 (solid) and 1.98 (air), the same on all three axes.
Every shape is screened before the study steps open: an uploaded file, a path on disk, a library TPMS
cell, a primitive, the example, a repaired or rotated copy. The checks are those of the TPMS Geometry
Lab (E:\chatgpt\tpms-geometry-lab), ported to Python in shapespro/precheck.py. They are
diagnostic: nothing in the mesh is changed.
| Check | Meaning |
|---|---|
| Facets | non-finite coordinates (also those the file reader dropped), zero-area / collapsed, exact and weld-induced duplicates |
| Edges | open boundary edges (one facet), non-manifold edges (more than two), winding conflicts (two facets traverse an edge the same way) |
| Vertices | non-manifold vertices: the facets around a vertex are not one fan (bow-ties, point contacts) |
| Shells | edge-connected pieces: closed or open, winding, area, signed volume |
| Quality | slivers (q = 4√3·A / Σedge² below 0.05), edges shorter than 0.01 mm |
| Intersections | triangle pairs that cross or touch (bounded screen: 15 s, 1.5 M candidates, run by itself up to 250 000 facets; Partial is never a pass) |
Gate. The result is Passed (the study steps open by themselves), Needs review (steps 2–7 stay locked
until you choose Repair mesh, which re-checks the repaired copy, or Continue anyway, recorded as
Accepted with findings) or Blocked (fewer than four usable facets: it cannot be accepted). The server
enforces it: /api/run refuses a shape whose gate is closed.
What holds the gate is what matters to the voxelizing solver: holes, flipped or branching facets, point contacts and crossing triangles. Zero-area or repeated facets, slivers and short edges are listed as warnings and do not hold it (marching-cubes meshes are full of them and the voxelizer ignores them). Open edges and point contacts that all lie on the faces of the bounding box are expected on a periodic cell cut by its box and do not hold it either.
Coordinates are compared at float32 precision (what an STL stores) and vertices closer than the weld tolerance are one vertex (default: a millionth of the shape's size; 0 is exact matching; set it in the panel under Thresholds and press Check again). A seam that closes with a few micrometres was a rounding gap; a real gap does not. Report and JSON download the full result with 1-based facet ids and the coordinates of problem edges.
Validated on the Lab's synthetic gyroid: 17,568 facets, 9,260 vertices, 26,880 edges, 1,056 open edges
(cut faces), 2 shells, 240 slivers and 17,760 screened candidates, all as the Lab reports; defect cases
(holes, flipped facets, branching edges, bow-ties, duplicates, seams, crossing and coplanar triangles) are in
tests/test_precheck.py. Like the Lab, it does not certify CAD validity, wall thickness, near gaps or shell
nesting, and a clean result is not a proof of a valid solid.
Simplify shape (in the check panel, for meshes of 20,000 triangles or more) keeps ½, ¼ or 1⁄10 of the
triangles. It welds the vertices as the check does, then runs volume-preserving quadric edge collapse (VTK),
and puts vertices back inside and onto the faces of the bounding box so the unit cell stays exactly the same
size. The copy is saved as uploads/<name>_simplified.stl, checked again, and Undo simplify goes back.
This speeds up loading, the check, the shape analysis and the 3-D view; it does not make the simulation much
cheaper, because the solver builds its own mesh (use Fit to this PC in step 4 for that). On a periodic cell
the cut profiles on opposite faces are simplified separately, so they match only to within the simplification
error. Measured at ¼ (result → geometry check):
| File | Triangles | Time | Volume | Check |
|---|---|---|---|---|
| Fischer–Koch S cell | 670,356 → 167,588 | 6 s | −0.014 % | pass → pass |
| Diamond 3×3×2 | 1,467,320 → 366,828 | 14 s | −0.008 % | pass → pass |
| Schwarz P 4×4×4 (190 MB) | 3,907,168 → 976,790 | 41 s | −0.030 % | too large to check → pass |
The Mesh tab of Shape analysis is the mesh quality report. The report lists:
- open edges (holes) and non-manifold edges (shared by 3 or more triangles);
- zero-area and duplicate triangles;
- orientation (flipped or inside-out triangles), and the number of separate bodies;
- edge lengths, and sliver triangles (angle below 5°);
- the solid fraction from the triangles compared with what the simulation's voxelizer reads (3-axis vote). This last one shows whether the defects change the simulated sample.
The verdict is Good, Minor issues (cosmetic, or defects too small to change the solid by 0.5 %), or Needs repair.
Repair mesh makes a watertight copy in two stages:
- Clean-up, which keeps every good triangle: merge duplicate vertices, remove zero-area and duplicate triangles, and make the orientation consistent and outward.
- Rebuild, only if the surface is still open: re-mesh the solid from a voxel model at about the mesh's own edge length. The model is lightly smoothed, and cut faces on the box stay flat.
The result replaces the shape in its part. It is saved as uploads/<name>_repaired.stl, and the
panel shows before → after (solid fraction, triangle count). Undo repair restores the original,
and Download STL saves the current mesh.
Example: SchwarzP_cell11x5x5_rep2x2x1_off1_res80.stl (147 open edges, mostly on the cut faces)
was rebuilt watertight. Its solid fraction went from 28.58 % to 28.56 %.
The preset menus in step 2 are grouped:
- Built-in (typical): PLA, PETG, ABS, carbon-loaded PLA, epoxy, alumina, ferrite and carbonyl iron. These are rough values; replace them with your NRW measurements.
- MSU TeSLa · THz measured: 18 materials measured by terahertz time-domain spectroscopy
at Michigan State University. The set is Rogers RO3003, RO3006 and RO3010, HDPE, LCP, PC,
PEEK, PET, PETG, polyimide, Zeonor, PP, PTFE, alumina, InP, Pyrex, quartz and silicon.
The original spreadsheets are in
data/msu_thz/. - My materials: your own, stored in
data/materials/user_materials.json. They are kept for every project.
Add a new material with the Material library box in step 2. There are three ways:
- Type in ε′ and either ε″ or tan δ, plus μ′ and μ″ and a source note.
- Press Save to my library on any material you have edited.
- Use Import data file… with a measured table in CSV, TXT, DAT or XLSX:
- Columns: frequency, ε′, and tan δ or ε″, optionally μ′ and μ″.
- Recognised headers include Frequency, Dielectric Constant / eps' / Dk, Loss Tangent / tan d / Df, eps'', mu' and mu''. Without a header the columns are taken as f, ε′, tan δ.
- Units come from the header (Hz, MHz, GHz or THz) or from the size of the numbers.
Saved materials appear in the menus under My materials. Use adds one to the project, and × removes it from the library; projects keep their own copy.
From a measured curve to one value. The solver uses one complex ε and μ per material:
- Data covers the run's band: the median over the band, for example your NRW over 8.2–12.4 GHz.
- Data does not cover it: the median of the five lowest-frequency points.
The editor shows which rule was used, the measured curve, and the source.
About the MSU values at X band. They were measured at 0.2–1.7 THz, so ShapeSpro uses their lowest-frequency points (about 0.2–0.26 THz).
- ε′ of these low-loss dielectrics changes little down to GHz.
- tan δ at THz is usually higher than at X band, so ε″ is an upper estimate.
- Silicon: losses at GHz depend on its doping.
- LCP: the source spreadsheet holds exactly the same numbers as RO3003, in every archived version since 2017. It is marked UNVERIFIED.
If you use the MSU data, cite: J. A. Hejase, P. R. Paladhi, P. Chahal, "Terahertz characterization of dielectric substrates for component design and nondestructive evaluation of packages," IEEE Trans. Compon. Packag. Manuf. Technol. 1(11), 1685–1694 (2011).
| You have | Use it as | You get |
|---|---|---|
| One lattice / metamaterial unit cell | Periodic unit cell: tiled across the opening, n cells thick | everything (S, R/T/A, ε_eff, RCS) |
| A complete sample machined or printed to the guide size | Whole object, Centred, real size (real gaps at the walls are kept) | everything, with a note when it covers less than 99.9% |
| A sample at another size (e.g. a 10 × 10 mm coupon) | Whole object, Stretch to fill opening | everything, for a sample of that design filling the guide |
| A post, iris, sphere, part, … | Whole object, centred | S-parameters, R/T/A and shielding effectiveness. ε_eff and RCS do not apply, because it is not a slab |
-
The wave travels along z with E along y (TE10). Use the rotate buttons to orient the shape (for example, a cylinder along y is the classic inductive post).
-
Open meshes (not watertight) are accepted. They are voxelized with rays along x, y and z and a majority vote, which closes holes and cracks that only one ray direction sees. The Results page flags such runs; check the solid fraction.
-
3MF and STEP/IGES files carry their own unit. STEP/IGES surfaces are triangulated by gmsh (OpenCASCADE).
-
An object wider than the opening is refused, with a hint to rotate it, stretch it or pick a bigger waveguide.
-
3D Model shows the unit cell (orbit, wireframe, snapshot), or the section view of the tiled sample inside the waveguide with ports, incident wave and dimensions. Step 3 opens the section view and step 4 the wireframe.
-
Results shows key-number cards and eight chart cards: S-parameter magnitude (dB / linear), phase, power balance, ε_eff with the Hashin–Shtrikman band, and four RCS charts. Hover shows values, chips switch views, and ⤓ saves a chart as PNG.
Every run is saved in projects/<date-time>_<name>/:
results.xlsx (sheets summary / per_frequency / RCS_vs_angle / full_wave_check), results.png,
RCS.png, <name>.s2p (reference planes on the sample faces) and results.json.
Step 4 chooses the element order of the built-in FEM solver: 1, 2 or 3. Order 3 (cubic) is ~100× more accurate than order 2 on a dense slab at the same number of unknowns. Higher orders need far fewer elements per wavelength: a 1.5 mm ferrite sheet (|n| = 4.7) needs 241k unknowns at order 1 for 0.5 % in ε, but 72k at order 3 for 0.02 %; a 5 mm slab needs 154k (order 1) or 20k (order 3). Lattice parts still need small elements to resolve their walls, so there order 2 costs about 4–5× more per element and gains accuracy.
Curved elements. With the conforming material model, objects are cut out of the mesh along their surface. At order 2 or 3, the cut surface is then lifted onto the object's own triangles: second-order (10-node) elements whose edges bend with the surface (Curved elements on object surfaces in step 4, on by default). Straight elements leave a faceting error that a higher order cannot remove:
- dielectric rod in a cavity: 7.3e-3 → 1.2e-3 in frequency;
- dielectric sphere in WR-90 at Coarse: |ΔS| 2.7e-2 → 5.0e-3 against a Medium reference.
The run log reports how many edges were curved.
Material model Conforming mesh (StudySettings(averaging="conforming")) removes the
sub-cell averaging error. The meshes come from level-set cutting (femsolver/conform.py):
a signed distance of each body is computed from its voxels, and every element the
surface passes through is split along it, so element faces follow the walls (exactly
conforming, no hanging faces). This works for any imported shape: STL, OBJ, 3MF or STEP,
open meshes, tiled or clipped.
- Lattices (periodic parts): conforming unit-cell homogenization (
femsolver/cellhom.py). One unit cell is meshed conformingly (elements ~1/5 of the wall thickness) and the periodic quasi-static cell problem gives the exact effective ε and μ tensors of the real geometry. The part is then a homogeneous anisotropic slab in the waveguide, meshed by the wavelength. This is fast (the cell solve takes ~10–30 s) and valid while the cell is well below the wavelength. - Whole objects: the waveguide mesh is cut along the object's surface, with elements refined near it, and solved full-wave. Use element order 2: larger high-order elements represent a curved surface too coarsely.
Why not mesh the whole tiled lattice? The nTop gyroid's walls are 0.256 mm thick and need ~0.12 mm elements; one cell is ~96k elements, but the WR-90 sample (~76 cells) would be ~7 million, beyond 16 GB of RAM. The unit cell holds all the information.
| Check | Result |
|---|---|
| Laminate (layers thinner than anything), cell homogenization | arithmetic and harmonic means exact (1e-9) |
| Sphere lattice ε 8−4j: cell homogenization vs full-wave conforming curved reference | 1.748−0.135j vs 1.752−0.143j (0.2 % in ε′); voxel order 1 Medium: 1.893−0.250j |
| Periodic part in a study: NRW of the full-wave run vs the cell tensor | equal to 0.1 %, metal-backed check |ΔΓ| 0.0000 |
| Cut mesh of a sphere | conforming (no hanging faces), volume conserved to 1e-16 |
| Centred block / sphere objects, ε 8−4j (order 2) | |ΔS| 0.0022 / 0.0037 vs references (averaging order 2: 0.0092 / 0.0050), at 4–12× the unknowns |
nTop gyroid (29.9 % solid), conforming unit cell, compared with the averaging path:
| Conforming cell (reference) | Averaging, order 1 Medium | Averaging, order 2 Medium | |
|---|---|---|---|
| PLA (2.7 − 0.03j) | 1.419 − 0.0067j | 1.427 − 0.0084j | 1.415 − 0.0066j |
| Carbon PLA (8 − 4j) | 2.538 − 0.819j | 2.548 − 0.807j | 2.482 − 0.756j |
The averaging path is within about ±2–3 % but in a geometry- and material-dependent direction. For lattices, use the conforming model with order 2 or 3. (Order 1 adds its own loss artefact even on a homogeneous slab: PLA ε″ 0.0082 instead of 0.0067.)
Step 2 (Material) has a Design law panel for a periodic lattice part with one solid body in air. It gives εxx, εyy (along E) and εzz in under a second, before any FEM run, and also μeff for a magnetic solid. It works for:
- library cells, whose descriptors come from the analytic surface;
- imported cells, whose descriptors are measured on the mesh: porosity, interface area, genus, and wall orientation.
For a library cell you can type a target ε′ along E. The law returns the solid fraction that gives it, and Generate this cell rebuilds the cell at that fraction.
The law is ζ = √(fabE − 0.261·porosity). It was learned with PySR from 567 conforming cell homogenizations of six TPMS families (see the solver README, "Design laws").
- Unseen families: 0.7 % mean error in ε′, against 3.4 % for Hashin–Shtrikman.
- nTop gyroid example: 1.423 vs 1.419 (PLA) and 2.561 vs 2.538 (carbon), compared with the conforming FEM.
The panel lists a warning when an input is outside the fitted data. It also warns when the cell is not a sheet TPMS, or not small compared with the wavelength in the solid. The law is static (quasi-static homogenization); a full-wave run adds the frequency dependence.
Every waveguide run with an εeff has an Angle × frequency section: the run's εeff (and μeff) as a homogeneous layer, metal-backed or free-standing. It shows TE/TM reflection or absorptance maps from 0 to 80° and the −10 dB bandwidth vs angle. Plane-wave runs show the full-wave reflection map at their angles and, for a free-standing array, the homogenized map from its free-space εeff.
ShapeSpro is a front end to the femsolver package in ../fem_em_solver, the
same validated code used from the command line:
- The shape is voxelized (ray parity; 3-axis vote for open meshes). A unit cell is tiled periodically across the guide cross-section and through the sample thickness; a whole object is placed once.
- gmsh meshes the waveguide section: fine inside the sample, coarse in the air. Each element gets an anisotropic effective-permittivity tensor (arithmetic mean along walls, harmonic mean across), so walls thinner than the elements are handled correctly.
- A full-wave 3-D FEM (Nédélec edge elements, multi-mode TE/TM wave ports, Intel MKL PARDISO) excites both ports.
- NRW gives ε_eff. Physical optics gives the RCS of the coated plate, and the metal-backed reflection behind it is re-checked with a second full-wave run.
Checks on the nTop sheet gyroid (2.465 mm cell, 29.8% solid):
| Check | Result |
|---|---|
| 100%-solid cell (exact answer: homogeneous slab) | ε within 0.19%, |ΔS| 0.0016, RCS within 0.03 dB |
| ε_eff vs mesh (Coarse / Medium / Fine), PLA, order 1 | 1.421 / 1.427 / 1.431 |
| ε_eff with order 2, 4 / 6 per cell, PLA | 1.413 / 1.415 (order 1 runs ~0.8 % high) |
| Same for carbon-loaded PLA (8−4j): order 1 Medium vs order 2 Medium | 2.548−0.807j vs 2.482−0.756j |
| ε_eff vs thickness (1 / 2 / 4 cells) | 1.426 / 1.427 / 1.428, at the HS upper bound of 1.426 |
| Air gap 5 → 8 mm; 6 → 12 port modes | ε_eff changes 0.1%; < 1e-4 |
| Re-meshing the same sample | |ΔS| ≈ 3e-3 (the noise floor) |
| 30k / 60k / 1.26M-triangle STL | identical within the noise floor |
| Metal-backed full-wave check (lattice vs homogeneous ε_eff) | |ΔΓ| ≤ 0.003 (PLA and carbon-loaded) |
| App vs command line | identical results |
Checks of several materials (tests/test_multimaterial.py; each case has an exact layered answer):
| Check | Result |
|---|---|
| Magnetic slab (ε = 2.5 − 0.2j, μ = 1.8 − 0.6j) | |ΔS| 0.0016; NRW gives ε within 0.16%, μ within 0.32% |
| Stack: lossy layer + 1 mm air + magnetic layer | |ΔS| 0.0012; per-layer ε within 0.26%, μ within 0.38%; RCS within 0.03 dB; check |ΔΓ| 0.003 |
| Touching layers with very different element sizes (0.62 / 0.26 mm) | |ΔS| 0.0045; check |ΔΓ| 0.003 |
| Two bodies in one part, interface off the mesh faces | |ΔS| 0.012 / 0.007 / 0.005 at Coarse / Medium / Fine |
| Body plus a fill material in its empty space | |ΔS| 0.007 |
| Single-material runs | identical to before (same mesh, ε_eff to 15 digits) |
Checks of the whole-object mode (ε = 4 − 1j, WR-90, tests/test_shapes.py):
| Check | Result |
|---|---|
| 10 × 10 × 5 mm block stretched to fill, and a 22.86 × 10.16 × 5 mm block as is (= 5 mm slab) | |ΔS| 0.0016, ε within 0.17% |
| Centred 8 × 10.16 × 5 mm block vs an independent face-conforming 2nd-order mesh | |ΔS| 0.0015 |
| Sphere with holes at both poles (open mesh) | 3-axis vote within 0.1% of the closed sphere; z-rays alone lose 3.8% |
| STEP plate with a hole, triangulated | volume within 0.03% |
How accurate is the lattice averaging? Walls thinner than the elements are homogenized per element (sub-cell averaging). This was compared with an exact reference: a lattice of lossy spheres (ε 8 − 4j, 26 % fill), meshed conformingly with curved elements.
| Voxel path (ShapeSpro) | ε_eff | vs reference |
|---|---|---|
| Order 1, 4 / 6 / 8 elements per cell | 1.986−0.334j / 1.893−0.250j / 1.852−0.217j | ε′ +13 / +8 / +6 % |
| Order 2, 4 / 6 elements per cell | 1.853−0.226j / 1.800−0.180j | ε′ +6 / +3 % |
| Reference: exact spheres, conforming curved mesh | 1.752−0.143j | (h 0.5 → 0.35 mm: −0.6 %) |
The averaging converges to the reference from above: lossy, high-contrast inclusions come out too dielectric and, above all, too lossy on coarse meshes. Order 2 roughly halves the error at the same mesh. Sheet TPMS walls are nearly flat inside an element, where the anisotropic tensor is exact, so they suffer less (PLA gyroid: order 1 and order 2 differ by ~0.8 %; carbon gyroid by ~2.6 % in ε′). For final lattice numbers use the conforming material model (see above) with order 2 or 3.
The solver was audited against a TPMS waveguide verification specification (port, mesh, material and
benchmark rules; audit/verification_2026-10-27.json). What changed as a result:
- Air line to the ports (A4): Auto (step 3, default) makes each air line long enough for the slowest evanescent mode to decay 40 dB at f_max: ln(100)/α of the first mode above cutoff (51.5 mm for WR-90 at 12.4 GHz, instead of the old fixed 5 mm). Measured effect of the old gap was ≤ 0.009 in |S|. Set lets you choose a gap; below half the required length step 3 shows an error line.
- Power conservation (D2): S-parameters are extracted with the modes' norms on the port mesh (PᵀB⁻¹P) instead of the analytic a·b/2. The empty guide now gives |S11|² + |S21|² = 1 within 2×10⁻⁴ (was 0.9985). With Floquet ports, a lossless slab at 45° absorbs < 10⁻⁶ (was 1.2×10⁻³).
- Floquet ports (A7.4): at least λ₀,max/4 (9.1 mm in X band) from the structure.
- Passive materials (B2.4): a material with ε″ < 0 or μ″ < 0 (it would generate power) is refused before the run starts, from the interface and the API.
- File units (A1.1): when a mesh file's unit is inferred from its size (e.g. an STL written in metres), the geometry check holds the shape until you confirm the size (Confirm size).
- Mesh resolution (B3.1, B3.2):
- At Medium, every region meets the longest-edge rule of its element order: λ/10 (order 1) and λ/5 (order 2) from the specification, extended to λ/3.5 (order 3) and λ/3 (order 4). This covers sub-cell lattices, which now also resolve the wavelength in their densest material, as well as objects, homogenized slabs and air.
- Order-2 runs therefore use about 3–4× more elements in dense regions than before. Coarse is a draft density and is reported as under-resolved.
- Air elements follow λ₀(f_max)/24, so they are no longer a fixed 1 mm.
- The conforming unit cell keeps at least 3 elements across the thinnest wall even when memory is short.
- Every run reports a Mesh resolution table (Results › Accuracy and validity): the longest edge against its limit, and the elements across walls, per part and for the air.
- Sub-cell averaging never meshes thin walls, and the table says so. Whether that matters depends on the shape. On the audited carbon-PLA gyroid (sheet walls, ε 8 − 4j) the conforming unit cell gave ε_eff 2.294 − j0.696 and sub-cell averaging 2.295 − j0.683, which agree within 0.3 %. On the lossy sphere benchmark (compact inclusions, see below) sub-cell averaging is up to 13 % high. The conforming model is the reference.
- Higher-order modes (A3.3): the amplitudes of the six port modes at the port planes are reported (Results › Higher-order modes at the ports). Each mode also gets its projection floor, the level its value reads from TE₁₀ leakage alone because the modes are not exactly orthogonal on the port mesh. A value near the floor is numerical; one well above it is near field reaching the port.
- Metal-backed check (B4.1): solved adaptively (about 15 FEM solves) and evaluated at 101 points by default, so its absorption peak is resolved.
- Touchstone (A1.4): the .s2p/.s1p files say that the data are TE₁₀-modal, not renormalised to 50 Ω.
- Coatings (B2.6, C6/C7): a material can carry a surface coating R_s (Ω/□, step 2), e.g. a
MWCNT dip coat with R_s = 1/(σt). It is an impedance sheet on the real surface:
- Unit cell (conforming model): a tangential surface conductance in the cell solve. The cell's ε_eff then depends on frequency (ε″ ∝ 1/f) and passes the Kramers–Kronig check.
- Objects: the sheet sits on the cut surface of the conforming mesh.
- Not available: sub-cell averaging and plane-wave runs refuse coatings.
- Checks:
- a coated laminate cell is exact;
- a 2 mm slab coated on both faces matches the transfer-matrix result within |ΔS| 0.008;
- an ideal sheet across the guide (C6) is within 0.003;
- a Salisbury screen's null (C7) falls at f₀ with −67 dB depth.
- Permittivity defined by (step 2), as in HFSS: choose one of three ways and enter only what it needs: Complex ε (ε′, ε″), Loss tangent (ε′, tan δ; ε″ = ε′ tan δ) or Conductivity (ε′, σ). With conductivity there is no ε″ to enter: ShapeSpro computes ε″(f) = σ/(ωε₀) at every frequency.
- Conductivity, as in HFSS: a material can have a bulk conductivity σ (S/m, step 2). Its loss then
depends on frequency, as HFSS defines it: ε(f) = ε′ − j(ε′ tan δ + σ/(ωε₀)). The constant ε″ you enter is the
dielectric (loss-tangent) part, and σ adds the conduction part, which falls as 1/f. Each frequency is solved
with its own ε, and the mesh is sized with the loss at f_max.
- Check: a 5 mm slab (ε′ 4, tan δ 0.05, σ 1.5 S/m) matches the analytic result within |ΔS| 0.0032, and NRW recovers ε″(f), 3.49 → 2.37 across X band, within 0.31 %.
- Coatings like an HFSS layered impedance: the surface coating is either a frequency-independent sheet
resistance R_s (Ω/□), or a film conductivity σ and thickness t. The film's sheet impedance is
Z_s = γ / (2σ tanh(γt/2)), with γ = √(jωμ₀(σ + jωε₀)).
- Thin film (much thinner than its skin depth): Z_s is 1/(σt).
- Thick film (past its skin depth): Z_s is the conductor surface impedance (1+j)/(2σδ), which includes the skin effect.
- Check: a 2×10⁴ S/m, 30 µm film across the guide matches the analytic sheet within 0.004.
- Side gaps (B1.2): step 3 takes the clearance between a periodic sample and the x and y walls. The sample is then narrower than the guide, with air at the walls, as a printed sample is. A gap at the y walls is in series with E: 0.1 / 0.3 mm per side lowered the apparent ε of a 2.7 slab by 3 / 8 %. ε_eff is still extracted as a measurement would.
- Faster object meshes: the near-surface refinement of conforming objects no longer leaks into the air lines. A centred 8 × 5 × 3 mm block went from 298 k to 62 k elements, and a full-width slab that took more than 10 minutes to mesh now takes 9 s.
Benchmarks with the run's own settings (empty guide, short, offset short, slab two-port and metal-backed,
NRW round-trip, resistive sheet, Salisbury screen, Floquet slab) all pass with |ΔS| ≤ 0.003 (see the audit
report). tests/test_verification_fixes.py keeps these fixes in place.
Limits:
- Physical-optics RCS is reliable near normal incidence and to about ±40°.
- The lattice cell must be much smaller than the wavelength for the RCS step.
- Features of a whole object smaller than an element are homogenized (sub-cell averaging): fine for sub-wavelength detail, but use Fine for resonant parts.
- Parts are stacked along the wave direction; bodies within a part share its frame (place side-by-side features as bodies of one part).
- The ports must be in air-filled guide.
- Above roughly 300k unknowns (Fine mesh, thick samples) you need more free RAM; the Mesh step warns you.
ShapeSpro/
ShapeSpro.lnk / ShapeSpro.bat / ShapeSpro.py launchers
shapespro/ server.py (local API), jobs.py (runs), shapes.py (files, TPMS cells, primitives, rotation),
precheck.py (geometry check: the gate in front of the study), meshcheck.py (mesh quality, repair), shapeanalysis.py (porosity, sizes, tortuosity),
physics.py (dispersion fits, angle maps), designlaw.py (law, error bars,
cell solves, PySR refit)
web/ index.html, app.js (workflow), analysis.js (results checks and tools),
charts.js (SVG chart cards, Smith chart, heat maps), viewer.js (three.js),
style.css, fonts/ (Inter, JetBrains Mono), assets/ (logo, small logo, wordmark, .ico)
examples/ n top gyroid_30k.stl (example project)
design/ prototype_white.html: the Claude Design reference
projects/ saved runs
tests/ test_app.py API smoke test; test_precheck.py, test_gate.py (geometry check and gate); test_shapeanalysis.py, test_materials.py, test_shape_loading.py
logs/server.log messages when started without a console
ShapeSpro is free software under the GNU GPL v3 or later (LICENSE); bundled third-party components are listed in
THIRD_PARTY_LICENSES.md. To cite it, use CITATION.cff (GitHub's "Cite this repository"). See CONTRIBUTING.md to help.
