1.. automodule:: gdsii.elements
2    :synopsis: module containing classes for GDSII elements.
3
4Possible instance attributes:
5
6    :attr:`elflags`
7        Element flags (:class:`int`, optional).
8        Bit 15 specifies template data.
9        Bit 14 specifies external data.
10    :attr:`plex`
11        Plex number (:class:`int`, optional).
12    :attr:`layer`
13        Element layer (:class:`int`)
14    :attr:`data_type`
15        Element data type (:class:`int`)
16    :attr:`path_type`
17        Type of path endpoints (:class:`int`, optional).
18        The values have the following meaning:
19
20        * 0 -- square ends, flush with endpoints
21        * 1 -- round ends, centered on endpoints
22        * 2 -- square ends, centered on endpoints
23        * 4 -- custom square ends
24    :attr:`width`
25        Width of the path (:class:`int`, optional). If the value is negative,
26        then the width is absolute and not affected by magnification factor.
27    :attr:`bgn_extn`, :attr:`end_extn`
28        Start end end extensions for :attr:`path_type` 4 (:class:`int`, optional).
29    :attr:`xy`
30        List of points (:class:`list` of tuples ``(x, y)``).
31    :attr:`struct_name`
32        Name of the referenced structure (:class:`bytes`).
33    :attr:`strans`
34        Transformation flags (:class:`int`, optional). Bits have the following meaning:
35
36        * 0 -- reclection about X axis
37        * 13 -- absolute magnification
38        * 14 -- absolute angle
39    :attr:`mag`
40        Magnification factor (:class:`float`, optional).
41    :attr:`angle`
42        Rotation factor in degrees (:class:`float`, optional). Rotation is counterclockwise.
43    :attr:`cols`
44        Number of columns (:class:`int`).
45    :attr:`rows`
46        Number of rows (:class:`int`).
47    :attr:`text_type`
48        Text type (:class:`int`).
49    :attr:`presentation`
50        Bit array that specifies how the text is presented (:class:`int`, optional).
51        Meaning of bits:
52
53        * Bits 10 and 11 specify font number (0-3).
54        * Bits 12 and 13 specify vertical justification (0 -- top, 1 -- middle, 2 -- bottom).
55        * Bits 14 and 15 specify horizontal justification (0 -- left, 1 -- center, 2 -- rigth).
56    :attr:`string`
57        String for :const:`TEXT` element (:class:`bytes`).
58    :attr:`node_type`
59        Node type (:class:`int`).
60    :attr:`box_type`
61        Box type (:class:`int`).
62    :attr:`properties`
63        Element properties, represented as a list of tupes (`propattr`, `propvalue`).
64        `propattr` is an :class:`int`, `propvalue` is :class:`bytes`.
65        This attribute is optional.
66
67.. autoclass:: ARef
68
69    Required attributes: :attr:`struct_name`, :attr:`cols`, :attr:`rows`, :attr:`xy`.
70
71    Optional attributes: :attr:`elflags`, :attr:`plex`, :attr:`strans`, :attr:`mag`,
72    :attr:`angle`, :attr:`properties`.
73
74.. autoclass:: Boundary
75
76    Required attributes: :attr:`layer`, :attr:`data_type`, :attr:`xy`.
77
78    Optional attributes: :attr:`elflags`, :attr:`plex`, :attr:`properties`.
79
80.. autoclass:: Box
81
82    Required attributes: :attr:`layer`, :attr:`box_type`, :attr:`xy`.
83
84    Optional attributes: :attr:`elflags`, :attr:`plex`, :attr:`properties`.
85
86.. autoclass:: Node
87
88    Required attributes: :attr:`layer`, :attr:`node_type`, :attr:`xy`
89
90    Optional attributes: :attr:`elflags`, :attr:`plex`, :attr:`properties`
91
92.. autoclass:: Path
93
94    Required attributes: :attr:`layer`, :attr:`data_type`, :attr:`xy`
95
96    Optional attributes: :attr:`elflags`, :attr:`plex`, :attr:`path_type`,
97    :attr:`width`, :attr:`bgn_extn`, :attr:`end_extn`, :attr:`properties`
98
99.. autoclass:: SRef
100
101    Required attributes: :attr:`struct_name`, :attr:`xy`
102
103    Optional attributes: :attr:`elflags`, :attr:`strans`, :attr:`mag`,
104    :attr:`angle`, :attr:`properties`
105
106.. autoclass:: Text
107
108    Required attributes: :attr:`layer`, :attr:`text_type`, :attr:`xy`, :attr:`string`
109
110    Optional attributes: :attr:`elflags`, :attr:`plex`, :attr:`presentation`,
111    :attr:`path_type`, :attr:`width`, :attr:`strans`, :attr:`mag`, :attr:`angle`, :attr:`properties`
112