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.
The YAML configuration file has a simple structure with a list of layer definitions:
layer_number
in the format "layer/datatype" (e.g., "1/0")operation
property specifies what type of 3D operation to performlayers:
- 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
The converter supports different layer types, each representing a different 3D operation:
The substrate is the base material upon which all other layers are built. It's defined as a layer with operation "substrate".
- 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 micronsOptional properties:
name
: A descriptive name for the layerz
: The starting Z position (usually 0.0 for substrate)color
: Color name or in hexadecimal format (#RRGGBB)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.
- 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 micronsOptional properties:
name
: A descriptive name for the layerz
: Starting Z position in microns (default: 0)color
: Color nameThe "stack" operation is similar to "add", but it automatically positions the layer on top of a specified target layer.
- 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 micronstarget_layer
: layer/datatype of the target layer to stack onOptional properties:
color
: Color name.The "subtract" operation removes material by cutting down from the top surface. It's used to create holes, channels, or cavities.
- 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 negativeOptional properties:
color
: Color nameThe "subtract-up" operation cuts from a specific Z-position upward. This is useful for creating features that start at internal layers.
- 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 positiveOptional properties:
color
: Color nameThe "deposit" operation adds a conformal layer on top of the existing geometry. This models processes like chemical vapor deposition.
- 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 micronsOptional properties:
color
: Color nameThe "etch" operation is similar to "deposit" but removes material conformally. It models processes like chemical etching.
- 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 nameThe "throw" operation creates a symmetrical solid by revolving a 2D shape around an axis. This is useful for creating cylindrical features.
- 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 toz_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 nameHere'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 |
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
YAML is sensitive to indentation and formatting. Common issues include:
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.