Exemplo n.º 1
0
 def apply(self, item):
     """ Apply the transform directly on the
     object, without making a copy. """
     if isinstance(item, list):
         from spira.yevon.geometry.shapes import Shape
         return Shape(item).transform(self)
     else: 
         return item.transform(self)
Exemplo n.º 2
0
def load_aspect():
    """ Mix the aspects into their corresponding classes. """

    Cell.mixin(CellAspects)
    Cell.mixin(CellPortProperty)
    Cell.mixin(NetlistAspects)
    Cell.mixin(Transformable)
    Cell.mixin(Outputs)

    SRef.mixin(SRefPortProperty)
    SRef.mixin(NetlistAspects)
    Shape.mixin(ShapeClipperAspects)

    __Polygon__.mixin(PolygonAspects)
    __Polygon__.mixin(NetlistAspects)
    __Polygon__.mixin(PolygonPortProperty)
    __Polygon__.mixin(PolygonClipperAspects)
Exemplo n.º 3
0
 def reverse(self, item):
     if isinstance(item, list):
         from spira.yevon.geometry.shapes import Shape
         shape = Shape(item)
         for c in reversed(self.__subtransforms__):
             shape = c.reverse(shape)
         return shape
     else:
         for c in reversed(self.__subtransforms__):
             item = c.reverse(item)
Exemplo n.º 4
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)
Exemplo n.º 5
0
 def apply(self, item):
     """ Apply the transform to the transformable item. """
     if isinstance(item, list):
         from spira.yevon.geometry.shapes import Shape
         shape = Shape(item)
         for c in self.__subtransforms__:
             shape = c.apply(shape)
         return shape
     else:
         for c in self.__subtransforms__:
             item = c.apply(item)
Exemplo n.º 6
0
    def create_elements(self, elems):

        shape = self.shape.remove_straight_angles()
        shape = shape.reverse_points()

        for i, s in enumerate(shape.segments()):

            line_shape = Shape(points=s)

            L = RDD.GDSII.IMPORT_LAYER_MAP[self.layer]
            width = RDD[L.process.symbol].MIN_SIZE

            layer = PLayer(process=L.process,
                           purpose=RDD.PURPOSE.PORT.OUTSIDE_EDGE_DISABLED)

            elems += Edge(shape=[],
                          line_shape=line_shape,
                          layer=layer,
                          internal_pid=self.internal_pid,
                          width=width,
                          transformation=self.transformation)

        return elems
Exemplo n.º 7
0
 def reverse(self, item):
     if isinstance(item, list):
         from spira.yevon.geometry.shapes import Shape
         return Shape(item).reverse_transform(self)
     else:
         return item.reverse_transform(self)
Exemplo n.º 8
0
 def apply_to_copy(self, item):
     if isinstance(item, list):
         from spira.yevon.geometry.shapes import Shape
         return Shape(item).transform_copy(self)
     else:
         return item.transform_copy(self)