Exemplo n.º 1
0
    def _render_svg(self, origin):

        x, y = origin
        if self.orientation == 'horizontal':
            p2 = (x + self.length, y + self.width)
        else:
            p2 = (x + self.width, y + self.length)

        rect = geometry.AxisAligned2DRectangle(origin, p2)
        svg.store_attributes(rect, stroke_width=0, fill="black")
        
        return [rect]
Exemplo n.º 2
0
    def _render_svg(self, origin):
        renderables = []

        x, y = origin
        point = (x + self.length, y + self.height)
        rect = geometry.AxisAligned2DRectangle(origin, point)
        svg.store_attributes(rect, fill='#eeeeee')

        renderables.append(rect)

        for (rx, ry), r in self.roads:
            rorigin = (rx + x, ry + y)
            renderables.extend(r.render('svg', rorigin))

        for (sx, sy), sector in self.sectors:
            sorigin = (sx + x, sy + y)
            renderables.extend(sector.render('svg', sorigin))

        return renderables