Worked example
DXF to GDSII, step by step
A small synthetic DXF converted to GDSII with LinkCAD 11.1.8, Windows. Every number on this page was measured from the output file.
Download the files
- Sample DXF: dxf-to-gdsii-sample.dxf
- Command file: dxf-to-gdsii.lsn
- Output GDSII: dxf-to-gdsii-sample.gds
The sample DXF is synthetic: it was written for this example by a script and contains no customer data. Its coordinates are millimetres, but the file declares no unit.
Options you need
- LinkCAD Basic — For the conversion: DXF import, GDSII export and the Repair Open Polylines step of the conversion wizard.
- View — To inspect the result in the viewer
- Tools — To merge the overlapping rectangles with Merge Overlapping Polygons
What the sample contains
| DXF layer | Content |
|---|---|
| METAL1 | Two closed 2 × 1 mm rectangles that overlap by 0.5 mm |
| METAL2 | A closed 2.5 × 0.5 mm slot with one rounded end (a polyline arc segment) |
| VIA | A circle, radius 0.25 mm |
| OUTLINE | A 6 × 5 mm frame drawn as two open polylines whose ends meet |
Convert it from the command line
The command file sets the formats and the DXF unit (4 = millimetre):
[LinkCAD] LcImportFormat=DXF LcExportFormat=GDSII DxfInUnitsUnit=4 DxfInUnitsValue=1Then run:
linkcad.exe --config dxf-to-gdsii.lsn -i dxf-to-gdsii-sample.dxf -o dxf-to-gdsii-sample.gds --quit --no-save-settingsWhat LinkCAD wrote
GDSII database unit 1 nm, one cell named dxf-to-gdsii-sample. Extents in µm.
| GDSII layer | DXF layer | Elements | Vertices | X (µm) | Y (µm) |
|---|---|---|---|---|---|
| 0/0 | OUTLINE | 2 open paths | 6 | -1,000 … 5,000 | -1,000 … 4,000 |
| 1/0 | METAL1 | 2 boundaries | 8 | 0 … 3,500 | 0 … 1,000 |
| 2/0 | METAL2 | 1 boundary | 20 | 0 … 2,748.796 | 2,000 … 2,500 |
| 3/0 | VIA | 1 boundary | 32 | 3,750 … 4,250 | 2,000 … 2,500 |
What the numbers show
- Units: with the default DXF unit (1 DXF unit = 1 µm), the same frame came out at 6 × 5 µm instead of 6000 × 5000 µm, 1000 times too small. Set the DXF unit before you convert a file that does not declare one.
- Open outline: an unattended run skips the repair step, so the frame was written as two open zero-width paths. In the conversion wizard, the Repair Open Polylines page appears for drawings like this one; the repaired result was not measured here.
- Overlaps: the two METAL1 rectangles stay two boundaries. Merging them is Merge Overlapping Polygons in the Tools menu, which needs the Tools option.
- Curves: the rounded end became part of a 20-vertex boundary whose right edge is at 2,748.796 µm instead of 2,750 µm, 1.204 µm inside the true arc; the circle became a 32-vertex boundary.
The same conversion in the wizard
- Choose the formats: DXF as input, GDSII as output.
- Import options: under Units & Scaling, set 1 DXF unit = Millimeter.
- Export options: keep the GDSII defaults.
- Select dxf-to-gdsii-sample.dxf.
- Repair Open Polylines: this page appears because the frame is open. Select Combine close polylines and splines into polygons, then Execute Repair.
- File structure, and Layers in the viewer if you have the View option.
- Conversion complete: read the summary.
What to check before you send the GDSII
- Extents: compare a known dimension with the GDSII. Here the frame must be 6000 × 5000 µm.
- Layers: every DXF layer you need has a GDSII layer number, and nothing else does.
- Open paths: zero-width paths are usually outlines that were never closed.
- Overlaps: decide whether your mask writer needs overlapping polygons merged.
- Curves: arcs and circles become polygons; check the vertex count and the deviation against your tolerance.
- Cell name: the top cell is named after the input file.
Measured with LinkCAD 11.1.8, Windows.
Try it with your own file
The trial converts DXF to GDSII with every option for 5 days.