Classes to define simple shapes.
Note
Copyright 2009-2012 Lucas Heitzmann Gabrielli
Copyright 2013 Andrew G. Mark
gdsCAD (based on gdspy) is released under the terms of the GNU GPL
digraph inheritance3acbfad5e1 { rankdir=LR; size="8.0, 12.0"; "core.Boundary" [style="setlinewidth(0.5)",URL="core_api.html#gdsCAD.core.Boundary",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A filled, closed polygonal geometric object.",height=0.25,shape=box,fontsize=10]; "core.ElementBase" -> "core.Boundary" [arrowsize=0.5,style="setlinewidth(0.5)"]; "core.ElementBase" [style="setlinewidth(0.5)",URL="core_api.html#gdsCAD.core.ElementBase",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Base class for geometric elements. Other drawing elements derive from this.",height=0.25,shape=box,fontsize=10]; "core.Elements" [style="setlinewidth(0.5)",URL="core_api.html#gdsCAD.core.Elements",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A list-like collection of Boundary and/or Path objects.",height=0.25,shape=box,fontsize=10]; "core.Path" [style="setlinewidth(0.5)",URL="core_api.html#gdsCAD.core.Path",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="An unfilled, unclosed polygonal line of fixed width.",height=0.25,shape=box,fontsize=10]; "core.ElementBase" -> "core.Path" [arrowsize=0.5,style="setlinewidth(0.5)"]; "shapes.Box" [style="setlinewidth(0.5)",URL="#gdsCAD.shapes.Box",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Unfilled rectangular geometric object.",height=0.25,shape=box,fontsize=10]; "core.Path" -> "shapes.Box" [arrowsize=0.5,style="setlinewidth(0.5)"]; "shapes.Circle" [style="setlinewidth(0.5)",URL="#gdsCAD.shapes.Circle",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="An unfilled circular path or section or arc.",height=0.25,shape=box,fontsize=10]; "core.Path" -> "shapes.Circle" [arrowsize=0.5,style="setlinewidth(0.5)"]; "shapes.Disk" [style="setlinewidth(0.5)",URL="#gdsCAD.shapes.Disk",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A filled circle, or section of a circle",height=0.25,shape=box,fontsize=10]; "core.Boundary" -> "shapes.Disk" [arrowsize=0.5,style="setlinewidth(0.5)"]; "shapes.Ellipse" [style="setlinewidth(0.5)",URL="#gdsCAD.shapes.Ellipse",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A filled ellipse, or section of an ellipse",height=0.25,shape=box,fontsize=10]; "core.Boundary" -> "shapes.Ellipse" [arrowsize=0.5,style="setlinewidth(0.5)"]; "shapes.Label" [style="setlinewidth(0.5)",URL="#gdsCAD.shapes.Label",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Printing text string object.",height=0.25,shape=box,fontsize=10]; "core.Elements" -> "shapes.Label" [arrowsize=0.5,style="setlinewidth(0.5)"]; "shapes.LineLabel" [style="setlinewidth(0.5)",URL="#gdsCAD.shapes.LineLabel",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Printing text string object as Line font.",height=0.25,shape=box,fontsize=10]; "core.Elements" -> "shapes.LineLabel" [arrowsize=0.5,style="setlinewidth(0.5)"]; "shapes.Rectangle" [style="setlinewidth(0.5)",URL="#gdsCAD.shapes.Rectangle",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Filled rectangular geometric object.",height=0.25,shape=box,fontsize=10]; "core.Boundary" -> "shapes.Rectangle" [arrowsize=0.5,style="setlinewidth(0.5)"]; "shapes.RegPolygon" [style="setlinewidth(0.5)",URL="#gdsCAD.shapes.RegPolygon",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="An unfilled regular polgyon.",height=0.25,shape=box,fontsize=10]; "core.Boundary" -> "shapes.RegPolygon" [arrowsize=0.5,style="setlinewidth(0.5)"]; "shapes.RegPolyline" [style="setlinewidth(0.5)",URL="#gdsCAD.shapes.RegPolyline",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="An unfilled regular polgyon.",height=0.25,shape=box,fontsize=10]; "core.Path" -> "shapes.RegPolyline" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
Box(point1, point2, width[, layer, datatype]) | Unfilled rectangular geometric object. |
Rectangle(point1, point2[, layer, datatype]) | Filled rectangular geometric object. |
Disk(center, radius[, inner_radius, ...]) | A filled circle, or section of a circle |
Circle(center, radius, width[, ...]) | An unfilled circular path or section or arc. |
RegPolygon(center, length, N[, layer, datatype]) | An unfilled regular polgyon. |
RegPolyline(center, length, N, width[, ...]) | An unfilled regular polgyon. |
Label(text, size[, position, horizontal, ...]) | Printing text string object. |
Classes to define simple shapes.
Note
Copyright 2009-2012 Lucas Heitzmann Gabrielli
Copyright 2013 Andrew G. Mark
gdsCAD (based on gdspy) is released under the terms of the GNU GPL
Bases: gdsCAD.core.Path
Unfilled rectangular geometric object.
Parameters: |
|
---|
Examples:
box = shapes.Box((0, 0), (10, 20), 0.5)
myCell.add(box)
Bases: gdsCAD.core.Path
An unfilled circular path or section or arc.
Parameters: |
|
---|
Example:
circ=shapes.Circle((10,10), 10, 0.5)
circ.show()
Bases: gdsCAD.core.Boundary
A filled circle, or section of a circle
Parameters: |
|
---|
Example:
disk=shapes.Disk((-5,-5), 5)
disk.show()
Bases: gdsCAD.core.Boundary
A filled ellipse, or section of an ellipse
Parameters: |
|
---|
Example:
ellipse=shapes.Ellipse((-5,-5), 2, 4)
ellipse.show()
Bases: gdsCAD.core.Elements
Printing text string object.
Each letter is formed by a series of polygons collected together as an Elements list.
Parameters: |
|
---|
Examples:
text = shapes.Label('Sample text', 20, (-10, -100))
text.show()
myCell.add(text)
Bases: gdsCAD.core.Elements
Printing text string object as Line font.
Each letter is formed by a series of lines collected together as an Elements list. The lines are Hershey vector fonts. The font is basically a collection of symbols, containing all kinds of font styles and symbols.
The font itself is not a monotype and no guarantee is given on the height of the characters. But for normal characters, the height should always be within the specified size.
Since the Hershey nearly as old as ASCII, it is unfortunately not ordered in these codes. The font itself also contains many styles, ranging from Cyrillic over Greek to Roman letters.
For convenience, lookup tables from ASCII to symbol number are provided for several font styles. But note, that only a fraction of all available symbols are mapped to ASCII characters in these tables. You can always add a specific symbol by yourself, once you know its Hershey code.
Table name | Description |
---|---|
gothgbt | Gothic English Triplex |
gothgrt | Gothic German Triplex |
gothitt | Gothic Italian Triplex |
greekc | Greek Complex |
greekcs | Greek Complex Small |
greekp | Greek Plain |
greeks | Greek Simplex |
cyrilc | Cyrillic complex |
italicc | Italic Complex |
italiccs | Italic Complex Small |
italict | Italic Triplex |
scriptc | Script Complex |
scripts | Script Simplex |
romanc | Roman Complex |
romancs | Roman Complex Small |
romand | Roman Duplex |
romanp | Roman Plain |
romans | Roman Simplex |
romant | Roman Triplex |
Parameters: |
|
---|
Examples:
text = shapes.LineLabel(20, (-10, -100))
text.add_text('Sample text', 'romand')
text.show()
myCell.add(text)
Add one or more symbols to the label.
Parameters: | symbol – The integer symbol code as specified in the Hershey sign table. |
---|
Add text to the label.
The corresponding symbol codes are automatically looked in the specified lookup table.
Parameters: |
|
---|
Bases: gdsCAD.core.Boundary
Filled rectangular geometric object.
Parameters: |
|
---|
Examples:
rectangle = shapes.Rectangle((0, 0), (10, 20))
myCell.add(rectangle)
Bases: gdsCAD.core.Boundary
An unfilled regular polgyon.
Parameters: |
|
---|
Example:
pent = shapes.RegPolygon((10,10), 10, 5)
pent.show()
Bases: gdsCAD.core.Path
An unfilled regular polgyon.
Parameters: |
|
---|
Example:
hex=shapes.RegPolylone((10,10), 10, 6, 0.5)
hex.show()