-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatemap.py
More file actions
30 lines (23 loc) · 733 Bytes
/
createmap.py
File metadata and controls
30 lines (23 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import mapBuilder
import structureBuilder
from shapely.geometry import *
#HOUSE SETUP
SEED = 2
SYMMETRIC = True
INNER_SQUARE = 4
OUTER_SQUARE = 9
TURN_ODDS = 0.8
OUTER_BOUNDS = box(-OUTER_SQUARE,-OUTER_SQUARE,OUTER_SQUARE,OUTER_SQUARE)
INNER_BOUNDS = box(-INNER_SQUARE,-INNER_SQUARE,INNER_SQUARE,INNER_SQUARE)
#MAP OUTPUT SETUP
CANVAS_SIZE = 512 #512 by 512px
MULTIPLIER = 16 #16x magnification of points.
#building the house.
house = structureBuilder.structureBuilder(SEED,INNER_BOUNDS,OUTER_BOUNDS)
walls = house.generateRandomWalk(40)
rwalls = LineString(house.reflect(walls))
map = mapBuilder.mapBuilder(MULTIPLIER,CANVAS_SIZE)
map.drawPolygon(OUTER_BOUNDS)
map.drawPolygon(INNER_BOUNDS)
map.drawLine(rwalls)
map.showMap()