Skip to content

Geometry and Materials

Geometry should stay explicit in public examples. The documented API includes the shapes and named materials below. An available constructor alone does not establish RF accuracy; pair it with a configuration listed in Recommended Configuration and Support Boundaries.

ShapeSignatureTypical use
BoxBox(corner_lo, corner_hi)substrates, ground planes, patch metal, dielectric blocks
SphereSphere(center, radius)resonators, scatterers, simple inclusions
CylinderCylinder(center, radius, height, axis="z")vias, posts, cylindrical inclusions
PolylineWirepolyline-defined wire geometrywire-like studies and routed conductors
ViaVia(center=..., drill_radius=..., pad_radius=..., layers=..., material="pec")PCB-style interconnects
CurvedPatchCurvedPatch(center=..., length=..., width=..., radius=..., axis="x")curved-conductor studies; constructor arguments are keyword-only
MeshShapeMeshShape.from_file(path, scale=..., translate=(0,0,0))CAD import — STL/OBJ/PLY, plus STEP/STP via the cad extra. Rasterizes host-side (trimesh containment): NOT differentiable — a traced coordinate raises, so CAD geometry cannot carry gradients
from rfx import DebyePole, LorentzPole
sim.add_material("fr4", eps_r=4.3, sigma=0.02)
sim.add_material("resistive_medium", sigma=5.0e5)
sim.add_material(
"custom_dielectric",
eps_r=6.0,
debye_poles=[DebyePole(delta_eps=12.0, tau=9.4e-12)],
)
ArgumentMeaningNotes
eps_rrelative permittivitydefault is 1.0
sigmaconductivitylossy dielectrics and below-threshold conductors; sigma >= 1e6 S/m is represented by the PEC mask
mu_rrelative permeabilitydefault is 1.0
debye_polesdispersive Debye termsDebyePole(delta_eps, tau)
lorentz_polesdispersive Lorentz termsLorentzPole(omega_0, delta, kappa)
chi3third-order nonlinearityspecialized nonlinear-material workflows

Materials such as the built-in "copper" and "aluminum" have conductivity above the 1e6 S/m threshold and therefore behave as PEC in the compiled grid; their bulk skin depth and ohmic loss are not resolved. Use add_thin_conductor(...) when a subcell sheet model is appropriate. That helper also maps sigma_bulk >= 1e6 S/m (including its default copper value) to PEC; a finite sheet resistance requires an explicitly justified sigma_bulk < 1e6 S/m. Use a below-threshold volumetric conductivity only when its cells and loss model match the intended physical approximation.

Geometry and materials are covered only when paired with a documented boundary, source or port, mesh, and observable combination. Check Support Boundaries before reporting RF accuracy for a structure that uses a limited configuration.