Exemplo n.º 1
0
def generate_tiles(tile_settings):

    radius, angle, scale, separate, grid_list, sides = tile_settings
    vert_grid_list, edge_grid_list, poly_grid_list = [[], [], []]

    local_angle = 45 if sides == 4 else 30

    tile = circle(radius*scale, radians(local_angle - angle), sides, None, 'pydata')

    for grid in grid_list:
        vert_list, edge_list, poly_list = [[], [], []]

        if sides == 3:
            tiles_triangular(vert_list, edge_list, poly_list, tile, grid)
        else:
            tiles(vert_list, edge_list, poly_list, tile, grid)

        if not separate:
            vert_list, edge_list, poly_list = mesh_join(vert_list, edge_list, poly_list)
            if scale == 1.0:
                vert_list, edge_list, poly_list = remove_doubles(vert_list, [], poly_list, 0.001)

        vert_grid_list.append(vert_list)
        edge_grid_list.append(edge_list)
        poly_grid_list.append(poly_list)

    return vert_grid_list, edge_grid_list, poly_grid_list
Exemplo n.º 2
0
def generate_tiles(tile_settings):

    radius, angle, scale, separate, grid_list, sides = tile_settings
    vert_grid_list, edge_grid_list, poly_grid_list = [[], [], []]

    local_angle = 45 if sides == 4 else 30

    tile = circle(radius*scale, radians(local_angle - angle), sides, None, 'pydata')

    for grid in grid_list:
        vert_list, edge_list, poly_list = [[], [], []]

        if sides == 3:
            tiles_triangular(vert_list, edge_list, poly_list, tile, grid)
        else:
            tiles(vert_list, edge_list, poly_list, tile, grid)

        if not separate:
            vert_list, edge_list, poly_list = mesh_join(vert_list, edge_list, poly_list)
            if scale == 1.0:
                vert_list, edge_list, poly_list, _ = remove_doubles(vert_list, poly_list, 0.01, False)

        vert_grid_list.append(vert_list)
        edge_grid_list.append(edge_list)
        poly_grid_list.append(poly_list)

    return vert_grid_list, edge_grid_list, poly_grid_list
Exemplo n.º 3
0
def generate_tiles(radius, angle, separate, gridList):
    verts, edges, polys = circle(radius, radians(30 - angle), 6, None,
                                 'pydata')

    vertGridList, edgeGridList, polyGridList = [[], [], []]
    for grid in gridList:
        vertList, edgeList, polyList = [[], [], []]
        addVert, addEdge, addPoly = [
            vertList.append, edgeList.append, polyList.append
        ]
        for cx, cy, _ in grid:
            verts2 = [(x + cx, y + cy, 0.0) for x, y, _ in verts]
            addVert(verts2)
            addEdge(edges)
            addPoly(polys)

        if not separate:
            vertList, edgeList, polyList = mesh_join(vertList, edgeList,
                                                     polyList)

        vertGridList.append(vertList)
        edgeGridList.append(edgeList)
        polyGridList.append(polyList)

    return vertGridList, edgeGridList, polyGridList
Exemplo n.º 4
0
 def evaluate(self):
     #                           (radius=1.0, phase=0, nverts=20, matrix=None, mode='pydata')
     verts, edges, faces = circle(radius=self.radius,
                                  nverts=self.points,
                                  mode='np')
     self.outputs['verts'].data_set(verts)
     self.outputs['edges'].data_set(edges)
     self.outputs['faces'].data_set(faces)
Exemplo n.º 5
0
def generate_tiles(radius, angle, separate, gridList):
    verts, edges, polys = circle(radius, radians(30 - angle), 6, None, 'pydata')

    vertGridList, edgeGridList, polyGridList = [[], [], []]
    for grid in gridList:
        vertList, edgeList, polyList = [[], [], []]
        addVert, addEdge, addPoly = [vertList.append, edgeList.append, polyList.append]
        for cx, cy, _ in grid:
            verts2 = [(x + cx, y + cy, 0.0) for x, y, _ in verts]
            addVert(verts2)
            addEdge(edges)
            addPoly(polys)

        if not separate:
            vertList, edgeList, polyList = mesh_join(vertList, edgeList, polyList)

        vertGridList.append(vertList)
        edgeGridList.append(edgeList)
        polyGridList.append(polyList)

    return vertGridList, edgeGridList, polyGridList