kicad2ems.emsdev.numerics.cdtmesh

cdtmesh - the points of geo.mesh_polygons' triangulation: mesh2d (a compiled
core's cdt_triangulate, mom25d's or pcbqs's: emsdev/native/cdt_mesh.hpp and
mesh2d.hpp) triangulates; the points inside the copper are placed here.

    T = mesh(V, segs, limit, inside, core, frozen=None, sizes=(1.0,),
             min_angle=0, max_steiner=0)

V (n, 2), segs (m, 2): geo's vertices and constraint segments, in its units (the
layer's dmax). limit(C): the largest area of a triangle whose centroid is at C
(<= 0: no limit). inside(P): whether P is in the copper. core: a compiled core
with cdt_triangulate. frozen(P): where no point is to be placed (the structured
runs' cells; None: nowhere).

  seed    a hexagonal lattice at the local cell size (equilateral cells just
          under the limit): each region's own lattice where the cell size is
          that region's (sizes), and where it is graded (coarsening) the finest
          lattice thinned to the local size
  rounds  what the seed left over its limit: each round, the circumcentre of
          every such triangle (its centroid where the circumcentre falls outside
          the copper or near a segment), kept apart from each other and from the
          vertices (where neither has room: the triangle's longest edge split at
          its middle, a segment's halves segments), then the whole triangulated
          again (MAX_ROUNDS)
  smooth  ODT passes over the placed points (each to the area-weighted mean of
          its triangles' circumcentres; the outlines' points stay), then the
          limits again, to POST_TOL
  min_angle
          (degrees) at the end, no triangle with a smaller angle (mesh2d's
          Ruppert refinement with off-centres, segments split where
          encroached, at most max_steiner points; pcbqs's DC and thermal
          meshes: 25)

Against Triangle, which this replaced (2026-11-15): on mom25d's Solver Matrix
boards the same S within 0.005 on all but a few, with 2-10 % fewer unknowns.
mesh2d replaced CDT (2026-11-17): the same meshes but for the diagonals of
cocircular cells, either Delaunay (S as close to openEMS's).
Returns dict(vertices, triangles, info): V first, in its order (the triangles
outside the outline left out; geo also drops those in its holes), info
dict(rounds, added, seed, over, steiner).
kicad2ems.emsdev.numerics.cdtmesh.triangulate(core, V, segs, min_angle=0.0, max_steiner=0)[source]
(vertices, triangles) of the constrained Delaunay triangulation of V with
the segments segs, inside the outline (with min_angle refined to it).