Commit 4963c9a1 authored by Thomas Albrecht's avatar Thomas Albrecht

exactly 4 pos lights per building

gaussian distribution for skyscraper levels
parent f01a0e61
......@@ -41,6 +41,8 @@ class random_number(object):
self.callback = random.uniform
elif randtype == int:
self.callback = random.randint
elif randtype == 'gauss':
self.callback = random.gauss
else:
raise TypeError("randtype must be 'float' or 'int'")
def __call__(self):
......@@ -56,7 +58,8 @@ def random_LOD():
default_height=12.
random_level_height = random_number(float, 3.1, 3.6)
random_levels = random_number(int, 2, 5)
random_levels_skyscraper = random_number(int, 10, 60)
#random_levels_skyscraper = random_number(int, 10, 60)
random_levels_skyscraper = random_number('gauss', 35, 10)
def check_height(building_height, t):
"""check if a texture t fits the building height (h)
......@@ -266,12 +269,12 @@ def analyse(buildings, static_objects, transform, elev, facades, roofs, model_pr
# -- LOWI year 2525
if True:
if b.area > 2000:
b.levels = random_levels_skyscraper()
if b.area >= 1500:
b.levels = int(random_levels_skyscraper())
b.height = float(b.levels) * level_height
# if b.area < 8000. or (b.area < 500. and random.uniform(0,1) < 0.5):
if b.area < 200. or (b.area < 500. and random.uniform(0,1) < 0.5):
if b.area < 1500:
#if b.area < 200. or (b.area < 500. and random.uniform(0,1) < 0.5):
tools.stats.skipped_small += 1
continue
......
......@@ -399,11 +399,11 @@ def write_xml(fname, LOD_lists, LM_dict, buildings):
for b in buildings:
if b.levels > 30:
if len(b.refs) > 6: step = 2
else: step = 1
for i in range(0, len(b.refs), step):
xo = b.X[i,0]# - offset.x # -- b.X already in cluster coordinates
yo = b.X[i,1]# - offset.y
# step = max(len(b.refs)/4, 1)
# for i in range(0, len(b.refs), step):
for i in np.arange(0,len(b.refs),len(b.refs)/4.):
xo = b.X[int(i+0.5), 0]# - offset.x # -- b.X already in cluster coordinates
yo = b.X[int(i+0.5), 1]# - offset.y
zo = b.ceiling + 1.5
# <path>cursor.ac</path>
xml.write(textwrap.dedent("""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment