LayerSpec

class photonforge.LayerSpec(layer, description, color, pattern)

Layer specification.

This class is mainly used to create layers for a Technology.

Parameters:
  • layer – Sequence of 2 integers describing layer and datatype (or texttype) numbers.

  • description – Layer description.

  • color – Layer display color. It can be a string of hexadecimal values in the formats ‘RGBA’ or ‘RRGGBBAA’ (with an optional ‘#’ prefix), or a tuple with 3 or 4 non-negative integers for each component.

  • pattern – Hatch pattern used to display the layer. One of 'solid', 'hollow', '\', '\\', '/', '//', '|', '||', '-', '=', 'x', 'xx', '+', '++', '.', or ':'.

Example

>>> layer_spec = LayerSpec((1, 0), "Silicon layer", "#d2132e18", "//")

See also

Layers guide

Methods

copy([deep])

Create a copy of this layer specification.

from_json(json_str)

Create a layer specification object from a json string.

Attributes

color

Layer display color.

description

LayerSpec description.

json

Json representation of this layer specification.

layer

Layer and datatype tuple.

pattern

Layer display pattern.

color

Layer display color.

copy(deep=False)

Create a copy of this layer specification.

Returns:

New copy.

description

LayerSpec description.

static from_json(json_str)

Create a layer specification object from a json string.

Parameters:

json_str – Strig containing the json data.

Returns:

LayerSpec instance.

json

Json representation of this layer specification.

layer

Layer and datatype tuple.

pattern

Layer display pattern.