masque/masque/__init__.py

97 lines
2.9 KiB
Python
Raw Normal View History

2016-03-15 19:12:39 -07:00
"""
masque 2D CAD library
2023-10-15 18:31:58 -07:00
masque is an attempt to make a relatively compact library for designing lithography
2020-11-01 19:45:57 -08:00
masks. The general idea is to implement something resembling the GDSII and OASIS file-formats,
but with some additional vectorized element types (eg. ellipses, not just polygons), and the
ability to interface with multiple file formats.
2016-03-15 19:12:39 -07:00
`Pattern` is a basic object containing a 2D lithography mask, composed of a list of `Shape`
objects, a list of `Label` objects, and a list of references to other `Patterns` (using
2023-01-21 21:22:11 -08:00
`Ref`).
2016-03-15 19:12:39 -07:00
2023-01-21 21:22:11 -08:00
`Ref` provides basic support for nesting `Pattern` objects within each other, by adding
offset, rotation, scaling, repetition, and other such properties to a Pattern reference.
2016-03-15 19:12:39 -07:00
Note that the methods for these classes try to avoid copying wherever possible, so unless
otherwise noted, assume that arguments are stored by-reference.
2020-11-09 21:55:46 -08:00
NOTES ON INTERNALS
==========================
- Many of `masque`'s classes make use of `__slots__` to make them faster / smaller.
2023-10-15 18:31:58 -07:00
Since `__slots__` doesn't play well with multiple inheritance, often they are left
empty for superclasses and it is the subclass's responsibility to set them correctly.
- File I/O submodules are not imported by `masque.file` to avoid creating hard dependencies
on external file-format reader/writers
2023-10-15 23:07:28 -07:00
- Try to accept the broadest-possible inputs: e.g., don't demand an `ILibraryView` if you
can accept a `Mapping[str, Pattern]` and wrap it in a `LibraryView` internally.
2016-03-15 19:12:39 -07:00
"""
2024-07-28 19:34:17 -07:00
from .utils import (
layer_t as layer_t,
annotations_t as annotations_t,
SupportsBool as SupportsBool,
)
from .error import (
MasqueError as MasqueError,
PatternError as PatternError,
LibraryError as LibraryError,
BuildError as BuildError,
)
from .shapes import (
Shape as Shape,
Polygon as Polygon,
Path as Path,
Circle as Circle,
Arc as Arc,
Ellipse as Ellipse,
)
from .label import Label as Label
from .ref import Ref as Ref
from .pattern import (
Pattern as Pattern,
map_layers as map_layers,
map_targets as map_targets,
chain_elements as chain_elements,
)
2023-01-31 12:05:44 -08:00
from .library import (
2024-07-28 19:34:17 -07:00
ILibraryView as ILibraryView,
ILibrary as ILibrary,
LibraryView as LibraryView,
Library as Library,
LazyLibrary as LazyLibrary,
AbstractView as AbstractView,
TreeView as TreeView,
Tree as Tree,
)
from .ports import (
Port as Port,
PortList as PortList,
)
from .abstract import Abstract as Abstract
from .builder import (
Builder as Builder,
Tool as Tool,
Pather as Pather,
RenderPather as RenderPather,
RenderStep as RenderStep,
SimpleTool as SimpleTool,
AutoTool as AutoTool,
2024-07-28 19:34:17 -07:00
PathTool as PathTool,
2025-11-19 00:16:34 -08:00
PortPather as PortPather,
2024-07-28 19:34:17 -07:00
)
from .utils import (
ports2data as ports2data,
oneshot as oneshot,
R90 as R90,
R180 as R180,
2024-07-28 19:34:17 -07:00
)
2023-01-24 12:45:44 -08:00
2016-03-15 19:12:39 -07:00
__author__ = 'Jan Petykiewicz'
2018-08-30 23:12:01 -07:00
2025-08-17 21:05:15 +02:00
__version__ = '3.4'
version = __version__ # legacy