Beispiel #1
0
 def _convert_pin_to_outline(self, pin):
     pcbshape = specctraobj.Path()
     pcbshape.layer_id = 'Front'
     pcbshape.aperture_width = self._from_pixels(1)
     pcbshape.vertex.append(self._from_pixels((pin.p1.x, pin.p1.y)))
     pcbshape.vertex.append(self._from_pixels((pin.p2.x, pin.p2.y)))
     outline = specctraobj.Outline()
     outline.shape = pcbshape
     return outline
Beispiel #2
0
    def _convert_component(self, library_id, cpt):
        for idx, symbol in enumerate(cpt.symbols):
            image = specctraobj.Image()
            image.image_id = library_id + '-' + str(idx)
            self.pcb.library.image.append(image)

            for body in symbol.bodies:
                for shape in body.shapes:
                    for pcbshape in self._convert_shape(shape):
                        outline = specctraobj.Outline()
                        outline.shape = pcbshape
                        image.outline.append(outline)

                for pin in body.pins:
                    image.pin.append(self._convert_pin(pin))
                    image.outline.append(self._convert_pin_to_outline(pin))