Exemplo n.º 1
0
    def render_devel_view(self, output_filename=None,
                          quick=False, nox=False):
        output_filename = '{0}.devel.png'.format(output_filename)
        ctx = GerberCairoContext()

        ctx.color = theme.COLORS['fr-4']
        ctx.alpha = 1.0
        outline = read(self.layers.outline)
        outline.render(ctx)

        ctx.color = self.copper_color
        bottompaste = read(self.layers.bottompaste)
        bottompaste.render(ctx)

        ctx.alpha = 0.9
        ctx.color = self.silk_color
        bottomsilk = read(self.layers.bottomsilk)
        bottomsilk.render(ctx)

        num_copper_layers = len(self.layers.internal)
        if self.layers.top is not None:
            num_copper_layers += 1
        if self.layers.bottom is not None:
            num_copper_layers += 1

        ctx.color = self.layer_colors[num_copper_layers - 1]
        bottom = read(self.layers.bottom)
        bottom.render(ctx)

        ctx.alpha = 0.5
        for idx, l in enumerate(self.layers.internal):
            layer = read(l)
            ctx.color = self.layer_colors[num_copper_layers - 2 - idx]
            layer.render(ctx)

        ctx.alpha = 0.9
        ctx.color = self.layer_colors[0]
        top = read(self.layers.top)
        top.render(ctx)

        ctx.color = self.silk_color
        topsilk = read(self.layers.topsilk)
        topsilk.render(ctx)

        ctx.color = self.copper_color
        toppaste = read(self.layers.toppaste)
        toppaste.render(ctx)

        ctx.color = theme.COLORS['black']
        ctx.alpha = 1.0
        drill = read(self.layers.drill)
        drill.render(ctx)

        ctx.dump(output_filename)
Exemplo n.º 2
0
    def render_devel_view(self, output_filename=None, quick=False, nox=False):
        output_filename = '{0}.devel.png'.format(output_filename)
        ctx = GerberCairoContext()

        ctx.color = theme.COLORS['fr-4']
        ctx.alpha = 1.0
        outline = read(self.layers.outline)
        outline.render(ctx)

        ctx.color = self.copper_color
        bottompaste = read(self.layers.bottompaste)
        bottompaste.render(ctx)

        ctx.alpha = 0.9
        ctx.color = self.silk_color
        bottomsilk = read(self.layers.bottomsilk)
        bottomsilk.render(ctx)

        num_copper_layers = len(self.layers.internal)
        if self.layers.top is not None:
            num_copper_layers += 1
        if self.layers.bottom is not None:
            num_copper_layers += 1

        ctx.color = self.layer_colors[num_copper_layers - 1]
        bottom = read(self.layers.bottom)
        bottom.render(ctx)

        ctx.alpha = 0.5
        for idx, l in enumerate(self.layers.internal):
            layer = read(l)
            ctx.color = self.layer_colors[num_copper_layers - 2 - idx]
            layer.render(ctx)

        ctx.alpha = 0.9
        ctx.color = self.layer_colors[0]
        top = read(self.layers.top)
        top.render(ctx)

        ctx.color = self.silk_color
        topsilk = read(self.layers.topsilk)
        topsilk.render(ctx)

        ctx.color = self.copper_color
        toppaste = read(self.layers.toppaste)
        toppaste.render(ctx)

        ctx.color = theme.COLORS['black']
        ctx.alpha = 1.0
        drill = read(self.layers.drill)
        drill.render(ctx)

        ctx.dump(output_filename)
Exemplo n.º 3
0
    def render_top_view(self, output_filename=None,
                        quick=False, nox=False):
        output_filename = '{0}.top.png'.format(output_filename)
        ctx = GerberCairoContext()

        if self.outline_color is not None:
            ctx.color = self.outline_color
        if self.outline_alpha is not None:
            ctx.alpha = self.outline_alpha
        outline = read(self.layers.outline)
        outline.render(ctx)

        if self.copper_color is not None:
            ctx.color = self.copper_color
        if self.copper_alpha is not None:
            ctx.alpha = self.copper_alpha
        copper = read(self.layers.top)
        copper.render(ctx)

        if self.mask_color is not None:
            ctx.color = self.mask_color
        if self.mask_alpha is not None:
            ctx.alpha = self.mask_alpha
        mask = read(self.layers.topmask)
        mask.render(ctx, invert=True)

        if self.silk_color is not None:
            ctx.color = self.silk_color
        if self.silk_alpha is not None:
            ctx.alpha = self.silk_alpha
        silk = read(self.layers.topsilk)
        silk.render(ctx)

        if self.drill_color is not None:
            ctx.color = self.drill_color
        if self.drill_alpha is not None:
            ctx.alpha = self.drill_alpha
        drill = read(self.layers.drill)
        drill.render(ctx)

        ctx.dump(output_filename)
Exemplo n.º 4
0
    def render_top_view(self, output_filename=None, quick=False, nox=False):
        output_filename = '{0}.top.png'.format(output_filename)
        ctx = GerberCairoContext()

        if self.outline_color is not None:
            ctx.color = self.outline_color
        if self.outline_alpha is not None:
            ctx.alpha = self.outline_alpha
        outline = read(self.layers.outline)
        outline.render(ctx)

        if self.copper_color is not None:
            ctx.color = self.copper_color
        if self.copper_alpha is not None:
            ctx.alpha = self.copper_alpha
        copper = read(self.layers.top)
        copper.render(ctx)

        if self.mask_color is not None:
            ctx.color = self.mask_color
        if self.mask_alpha is not None:
            ctx.alpha = self.mask_alpha
        mask = read(self.layers.topmask)
        mask.render(ctx, invert=True)

        if self.silk_color is not None:
            ctx.color = self.silk_color
        if self.silk_alpha is not None:
            ctx.alpha = self.silk_alpha
        silk = read(self.layers.topsilk)
        silk.render(ctx)

        if self.drill_color is not None:
            ctx.color = self.drill_color
        if self.drill_alpha is not None:
            ctx.alpha = self.drill_alpha
        drill = read(self.layers.drill)
        drill.render(ctx)

        ctx.dump(output_filename)