YAML Configuration Guide

Introduction

The YAML configuration file is essential for the GDS to STEP conversion process. It tells the converter how to interpret each layer in your GDS file and how to build the 3D model from these layers.

Each GDS file contains multiple layers, identified by a unique (layer, datatype) pair. The YAML file maps these layer identifiers to specific 3D operations and properties.

Note: YAML is a case-sensitive, indentation-based format. Be careful with spacing and make sure to maintain consistent indentation.

Basic Structure

The YAML configuration file has a simple structure with a list of layer definitions:

  • layers: A list of layer objects, each defining properties for a specific GDS layer
  • Each layer is identified by a layer_number in the format "layer/datatype" (e.g., "1/0")
  • The operation property specifies what type of 3D operation to perform
layers:
  - layer_number: 1/0  # layer 1, datatype 0
    name: base_layer
    thickness: 5.0
    z: 0.0
    operation: substrate
    color: gray
    
  - layer_number: 2/0
    name: middle_layer
    thickness: 5.0
    z: 5.0
    operation: add
    color: gold

Layer Types

The converter supports different layer types, each representing a different 3D operation:

substrate add stack subtract subtract-up deposit etch throw
Substrate

The substrate is the base material upon which all other layers are built. It's defined as a layer with operation "substrate".

Example
- layer_number: 1/0
  name: base_substrate
  thickness: 500  # in microns
  z: 0.0
  operation: substrate
  color: red

Required properties:

  • layer_number: The layer and datatype identification in format "layer/datatype"
  • operation: Must be "substrate"
  • thickness: The thickness of the substrate in microns

Optional properties:

  • name: A descriptive name for the layer
  • z: The starting Z position (usually 0.0 for substrate)
  • color: Color name or in hexadecimal format (#RRGGBB)
Add

The "add" operation extrudes the layer shape upward from a specific Z-position. This is used to add material on top of the substrate or other layers.

Example
- layer_number: 2/0
  name: metal_layer
  thickness: 5.0
  z: 5.0  # starts 5 microns above the bottom
  operation: add
  color: green

Required properties:

  • layer_number: The layer and datatype identification in format "layer/datatype"
  • operation: Must be "add"
  • thickness: The height of the extrusion in microns

Optional properties:

  • name: A descriptive name for the layer
  • z: Starting Z position in microns (default: 0)
  • color: Color name
Stack

The "stack" operation is similar to "add", but it automatically positions the layer on top of a specified target layer.

Example
- layer_number: 3/0
  name: top_stack
  operation: stack
  thickness: 5.0
  target_layer: 1/0  # stack on layer 1, datatype 0
  color: blue

Required properties:

  • layer_number: The layer and datatype identification in format "layer/datatype"
  • operation: Must be "stack"
  • thickness: The height of the extrusion in microns
  • target_layer: layer/datatype of the target layer to stack on

Optional properties:

  • color: Color name.
Subtract

The "subtract" operation removes material by cutting down from the top surface. It's used to create holes, channels, or cavities.

Example
- layer_number: 4/0
  name: cut_layer
  operation: subtract
  thickness: -5.0
  target_layer: 3/0
  color: red

Required properties:

  • layer_number: The layer and datatype identification in format "layer/datatype"
  • operation: Must be "subtract"
  • thickness: The depth of the cut in microns. Must be negative

Optional properties:

  • color: Color name
Subtract Up

The "subtract-up" operation cuts from a specific Z-position upward. This is useful for creating features that start at internal layers.

Example
- layer_number: 4/0
  name: cut_layer
  operation: subtract_up
  thickness: 5.0
  target_layer: 3/0
  color: red

Required properties:

  • layer_number: The layer and datatype identification in format "layer/datatype"
  • operation: Must be "subtract_up"
  • thickness: The upward depth of the cut in microns. Must be positive

Optional properties:

  • color: Color name
Deposit

The "deposit" operation adds a conformal layer on top of the existing geometry. This models processes like chemical vapor deposition.

Example
- layer_number: 5/0
  name: conformal_layer
  operation: deposit
  thickness: 2.0
  target_layer: 3/0
  color: yellow

Required properties:

  • layer_number: The layer and datatype identification in format "layer/datatype"
  • operation: Must be "deposit"
  • thickness: The thickness of the deposited layer in microns

Optional properties:

  • color: Color name
Etch

The "etch" operation is similar to "deposit" but removes material conformally. It models processes like chemical etching.

Example
- layer_number: 6/0
  name: etch_layer
  thickness: -2.0
  operation: etch
  target_layer: 5/0
  color: orange

Required properties:

  • layer_number: The layer and datatype identification in format "layer/datatype"
  • operation: Must be "etch"
  • thickness: The depth of the etch in microns. Must be negative.

Optional properties:

  • color: Color name
Throw

The "throw" operation creates a symmetrical solid by revolving a 2D shape around an axis. This is useful for creating cylindrical features.

Example
- layer_number: 7/0
  operation: throw
  target_layer: 6/0
  z_offset: -5.0
  color: purple

Required properties:

  • layer_number: The layer and datatype identification in format "layer/datatype"
  • operation: Must be "throw"
  • target_layer: layer/datatype of the target layer to attach the "cylindrical" object to
  • z_offset: Height displacement of the center of revolution from the z-height of the target layer (typically defined as the highest point of that layer)

Optional properties:

  • color: Color name

Common Properties

Here's a reference table of common properties used across different layer types:

Property Description Units Example
layer_number GDS layer number layer/datatype 1/0
name Name of layer String name: substrate
operation Operation type String type: add
thickness Height of extrusion Microns thickness: 5
z_position Starting Z position Microns z_position: 2.5
color Layer color String or hexadecimal color: blue
target_layer Target layer to stack on, subtract, etch, deposit, or throw layer/datatype target_layer: 2/0

Complete Example

Here's a complete example of a YAML configuration file for a simple example:

# Layer settings for GDS to STEP conversion
layers:
  - layer_number: 1/0  # layer 1, datatype 0
    name: base_layer
    thickness: 5.0
    z: 0.0
    operation: substrate
    color: gray
    
  - layer_number: 2/0
    name: middle_layer
    thickness: 5.0
    z: 5.0
    operation: add
    color: gold

  - layer_number: 3/0
    name: top_stack
    thickness: 5.0
    operation: stack
    target_layer: 1/0
    color: blue

  - layer_number: 4/0
    name: cut_layer
    thickness: -5.0
    operation: subtract
    target_layer: 3/0
    color: red

  - layer_number: 5/0
    name: deposit_layer
    thickness: 2.0
    operation: deposit
    target_layer: 3/0
    color: green
    type: polygon

  - layer_number: 6/0
    name: etch_layer
    thickness: -2.0
    operation: etch
    target_layer: 5/0
    color: blue

defaults:
  thickness: 0.0
  z: 0.0
  operation: add
  color: silver
  alpha: 1.0

Troubleshooting

Common Issues

YAML is sensitive to indentation and formatting. Common issues include:

  • Inconsistent indentation (must use spaces, not tabs)
  • Missing colons after property names
  • Improper list formatting (each list item needs a leading dash)

Solution: Use a YAML validator to check your file before uploading.

Each layer type requires specific properties. If these are missing, the conversion will fail.

Solution: Double-check that each layer definition includes all required properties for its type.

If your YAML file references a (layer, datatype) pair that doesn't exist in your GDS file, that operation will be skipped.

Solution: Verify the layer and datatype numbers in your GDS file using a GDS viewer, and update your YAML file accordingly.

Colors must be specified by a string, with certain values, or by a hexadecimal, with format "#RRGGBB"

Solution: Check color names.

When using the "stack" type, the target layer specified in target_layer must exist and be processed before the stacking layer.

Solution: Make sure the target layer is defined earlier in the YAML file, and that it exists in the GDS file.