procedural_city_generation.polygons package

Submodules

procedural_city_generation.polygons.Polygon2D module

class procedural_city_generation.polygons.Polygon2D.Edge(vertex1, vertex2, bordering_road=True)

Bases: object

selfplot(color='k', plt=None)
class procedural_city_generation.polygons.Polygon2D.Polygon2D(in_list, poly_type='vacant')

Bases: object

selfplot(plt=<module 'matplotlib.pyplot' from '/usr/lib/pymodules/python2.7/matplotlib/pyplot.pyc'>)
procedural_city_generation.polygons.Polygon2D.area(self)

Return area of polygon

procedural_city_generation.polygons.Polygon2D.is_convex(self)

procedural_city_generation.polygons.Vertex module

class procedural_city_generation.polygons.Vertex.Vertex(coords)

Bases: object

connection(other)

procedural_city_generation.polygons.Weg module

class procedural_city_generation.polygons.Weg.Weg(k1, k2, strassennetz=True)

Bases: object

delete()
selfplot()

procedural_city_generation.polygons.config module

class procedural_city_generation.polygons.config.Variables(tupel=None)

Singleton-Object

instance = None
procedural_city_generation.polygons.config.config()

Makes all necessary setups in order to run the polygon-generator

procedural_city_generation.polygons.construct_polygons module

class procedural_city_generation.polygons.construct_polygons.Wedge(a, b, c, alpha)

Bases: object

procedural_city_generation.polygons.construct_polygons.getPolygon2Ds(vertex_list)

Finds all closed Polygon2Ds. The algorithm starts with Wedge A-B-C and looks for Wedge B-C-X1, C-X1-X2... A polygon is found when Xn == A

procedural_city_generation.polygons.construct_polygons.getWedges(vertex_list)

Constructs all inner Angles as Wedges of the Vertices A-B-C so that there exists exactly one Wedge B-C-X1.

procedural_city_generation.polygons.construct_polygons.main(vertex_list=None)

Input: list of vertices representing the Roadmap Output: List of all Polygon2Ds representing Lots, List of all Polygon2Ds representing Blocks List of all Polygon2Ds which are too large to be Lots Polygon2D representing the road-network

procedural_city_generation.polygons.findsquaresinpoly module

from __future__ import division import numpy as np import math def findsquare(poly):

base= max([edge for edge in poly.edges if edge.bordering_road], key=lambda edge:edge.length) point1=base.vertex1 intersections=[], volume=0, n=2 while n=2:

point1+=base.normal/global.findsquareinpoly.aufloesung newintersections=[] for edge in [edge in poly.edges if edge is not base]:

try L=np.linalg.solve(np.array([base.dir_vector, -edge.dir_vector]).T, point1-edge.vertex1):
if 0<L[0]<1 and 0<L[1]<1 :
newintersections.append(base.dir_vector*L[0]+point1)

except: pass

n=len(newintersections) newvolume= abs(point1-base.vertex1)*abs(newintersections[1]-newintersections[0]) if newvolume>volume:

intersections=newintersections, volume=newvolume

return intersections

procedural_city_generation.polygons.getBlock module

procedural_city_generation.polygons.getBlock.getBlock(wedges, vertex_list)

Calculate block to be divided into lots, as well as street polygons

procedural_city_generation.polygons.getBlock.p_in_poly(poly, point)

procedural_city_generation.polygons.getLots module

procedural_city_generation.polygons.getLots.divide(poly)

Divide polygon as many smaller polygons as possible

procedural_city_generation.polygons.getLots.getLots(wedge_poly_list, vertex_list)

procedural_city_generation.polygons.main module

procedural_city_generation.polygons.main.main(vertex_list=None)

Input: list of vertices representing the Roadmap Output: List of all Polygon2Ds representing Lots, List of all Polygon2Ds representing Blocks List of all Polygon2Ds which are too large to be Lots Polygon2D representing the road-network

procedural_city_generation.polygons.parent_path module

procedural_city_generation.polygons.parent_path.parent_path(depth=1)

Return path to directory which is depth levels above

procedural_city_generation.polygons.plot_poly module

procedural_city_generation.polygons.plot_poly.plot_edge(edge, color='k')
procedural_city_generation.polygons.plot_poly.plot_self(self)

procedural_city_generation.polygons.polygons_params module

Module which contains all input parameters for this submodule, along with: - The default (recommmended) value from the developers - A short description of what the parameter changes - All values that the parameter accepts without causing this program to break.

This information can also be viewed when calling the GUI and clicking the “options” button for that specific module.

procedural_city_generation.polygons.split_poly module

procedural_city_generation.polygons.split_poly.split_poly(poly, eps=1e-05)

Split polygon into two parts

Module contents