Example #1
0
def load_aspect():
    """ Mix the aspects into their corresponding classes. """

    Shape.mixin(ShapeClipperAspects)

    Polygon.mixin(PolygonAspects)
    Polygon.mixin(NetlistAspects)
    Polygon.mixin(PolygonPortAspects)
    Polygon.mixin(PolygonClipperAspects)
    Polygon.mixin(OutputPlotlyNetlist)

    SRef.mixin(SRefPortAspects)
    SRef.mixin(NetlistAspects)

    Cell.mixin(CellAspects)
    Cell.mixin(CellPortAspects)
    Cell.mixin(NetlistAspects)
    Cell.mixin(Transformable)
    Cell.mixin(OutputGdsiiAspect)
    Cell.mixin(OutputPlotlyNetlist)
Example #2
0
def generate_edges(shape, layer, internal_pid, transformation):
    """ Method call for edge generator. """
    edge_gen = EdgeGenerator(shape=shape,
                             layer=layer,
                             internal_pid=internal_pid,
                             transformation=transformation)
    return edge_gen.elements


from spira.yevon.aspects.base import __Aspects__
from spira.core.parameters.descriptor import Parameter


class EdgeAspects(__Aspects__):

    edges = Parameter(fdef_name='create_edges')

    def create_edges(self):
        """ Generate default edges for this polygon.
        These edges can be transformed using adapters. """
        from spira.yevon.geometry.edges.edges import generate_edges
        return generate_edges(shape=self.shape,
                              layer=self.layer,
                              internal_pid=self.id_string(),
                              transformation=self.transformation)


from spira.yevon.gdsii.polygon import Polygon
Polygon.mixin(EdgeAspects)