# Import GDSII Conductors for PEEC (`field.peecImportGds`)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/commands/field-peecImportGds/)

**Menu:** none (Quick Open, the CLI, Python and MCP) · **Runs as:** at once

> Preview: turn on Preview features in Edit › Preferences › Simulation, or run `preview.set {"enabled":true}`. Its replies carry `preview: true` and a note.

## What it does

Preview. Reads a GDSII layout, flattens the picked structure (SREF and AREF with reflection, magnification and rotation) and places each stackup row at its elevation and thickness, as a Q3D-class extractor imports layout with a layer map: each rectangular BOUNDARY, BOX or NODE becomes one rectangular field.peec segment along its longer side, each straight PATH leg one segment of the path's width from vertex to vertex (path types 0, 2 and 4; the first and last legs run on by the extensions), every other BOUNDARY, BOX or NODE becomes one field.peec plane (a pour of any outline: a uniform plane over its bounding box with nodes at the centres of planeCells equal cells and an outline hole taking out every node whose centre is outside the polygon, so it carries exactly the cells inside, at most 16 planes in the model), ends on one row within the join tolerance are one node, an end inside a pour on its row is shorted to the pour's nearest kept node (joined), a leg or rectangle wholly on one pour is left out, each polygon on a vias layer is one via (a field.peec segment at right angles to the board from the lower row's copper mid-plane to the upper row's; a rectangle keeps its section, any other polygon is a round section of its own area at its centroid; each end lands on a track end inside the via, else splits the track under its centre there, else is shorted to the pour under it, else lands on nothing, and a via node off its landing point is joined to it by a short), rows are joined only by vias, and everything else (overlapping vias, paths on a via layer, overlapping pours, pours holding fewer than two cell centres, round-ended paths, layers the stackup leaves out, overlapping rectangles, TEXT) is listed in skipped with its reason. Adds to the model given, never replaces it; a non-ASCII structure name fails the import. Changes nothing.

## Parameters

- `path`: str (a GDSII stream file, .gds/.gdsii, through the host's file service)
- `structure`: str? (the structure to import; default the file's one top structure, and a file with several asks for one)
- `nodes`: "boundaries|ignore"="boundaries" (NODE records become boundaries, or are left out)
- `toleranceM`: m? (ends nearer than this are joined; default half a database unit)
- `stackup`: \[{"layer":int (0 to 32767, a GDSII layer number),"datatype":int? (0 to 32767; default every data type of the layer),"elevationM":m (the bottom of its copper),"thicknessM":m (above 0),"resistivity":Ω·m?,"temperatureC":°C? (copied to each segment, as field.peec takes them; default annealed copper at 20 °C)}\] (1 to 64 rows, no two matching one element; the layer map)
- `vias`: \[{"layer":int (0 to 32767, a GDSII layer holding via cuts, not a stackup row),"datatype":int? (default every data type),"from":int,"to":int (the layer numbers of the two stackup rows it joins, each layer with one row, at different heights),"resistivity":Ω·m?,"temperatureC":°C? (as a stackup row; default annealed copper at 20 °C)}\]? (at most 64 rows; segments named \<prefix\>.via1, …)
- `model`: object? (field.peec params to add to; their nodes and segments are kept and the import's appended, everything else is left as given)
- `prefix`: str="gds"
- `planeCells`: int=16 (2 to 64; cells along the longer side of each pour's bounding box) (ASCII; segments are named \<prefix\>1, \<prefix\>2, … and nodes \<prefix\>.n1, …, numbered past the names the model already has)

## Reply

- model (the field.peec params with the import added; give it ports and frequencies and run field.peec)
- imported:\[{segment,atM:\[x,y\],layer,datatype,structure,element,from,to,lengthM,widthM,thicknessM} | {via,atM,layer,datatype,structure,element,from,to,rows:\[lower,upper\] (stackup layer numbers),lengthM,section:"round|rect",radiusM,widthM,heightM,areaM2,lands:\[lower,upper\] ("trackEnd|track|plane|nothing")} | {plane,atM,layer,datatype,structure,element,points,areaM2,cells:\[nx,ny\],cellM:\[hx,hy\],nodesKept,thicknessM}\]
- skipped:\[{atM:\[x,y\]|null,layer|null,datatype|null,structure,element,reason}\]
- joined:\[{node,plane,planeNode,offsetM}\] (segment ends shorted to a pour)
- structure
- structures (the file's top structures)
- metresPerUnit
- toleranceM
- notes
