Syntax 2D Manual - University of Michigan

advertisement
Syntax2D
Space Syntax Software
User’s Manual
Version 1.2
April, 2005
James A. Turner, Professor
College of Architecture and Urban Planning
The University of Michigan
2
Introduction .................................................................................................................................................... 5
Running the Program...................................................................................................................................... 5
Opening a Space Syntax File ..................................................................................................................... 6
Running the Problem ................................................................................................................................. 6
The Syntax2D Program ............................................................................................................................. 7
Pull-Down Menu Commands .................................................................................................................... 8
File ........................................................................................................................................................ 8
Edit .......................................................................................................................................................16
Compute ...............................................................................................................................................18
Display .................................................................................................................................................34
View .....................................................................................................................................................35
Viewport ..............................................................................................................................................35
Appendix .......................................................................................................................................................37
Mouse Options ..........................................................................................................................................37
Pop-Up Menus ..........................................................................................................................................37
Command Pop-Up Menu .....................................................................................................................37
File Format ...............................................................................................................................................38
Syntax File ("*.sx2") ............................................................................................................................38
Network ("*.nw2") ...............................................................................................................................38
Grid Data (*.txt) ...................................................................................................................................39
Path Data (*.txt) ...................................................................................................................................39
Isovist Measurements Algorithms ............................................................................................................39
Area: ....................................................................................................................................................39
Perimeter: .............................................................................................................................................40
Occlusivity: ..........................................................................................................................................40
Inclusivity ............................................................................................................................................42
Compactness: .......................................................................................................................................42
Minimum .............................................................................................................................................42
Standard Deviation...............................................................................................................................43
Variance ...............................................................................................................................................43
Circularity ............................................................................................................................................43
Radial Moment ....................................................................................................................................43
Skewness ..............................................................................................................................................43
Drift......................................................................................................................................................43
Dispersion ............................................................................................................................................43
Connectivity .........................................................................................................................................43
Integration ............................................................................................................................................44
Generating Isovist Polygons .....................................................................................................................44
End Note ...................................................................................................................................................48
4
Introduction
Syntax2D is a BETA version of a Space Syntax application developed to assist in that area of social/environment
behavior research. It is intended to work with architectural scale projects – floor plans. As such, it is capable of
importing floor plans from any DXF file, or from any NW2 file. Since this program, as its name implies, provides
analysis of two-dimensional drawings containing room (space) boundary edges with rough opening cuts for doors.
Currently, the algorithms and measures are all based on “Isovist” polygons. These include single Isovist polygons, a
grid of Isovists, and Isovist polygons along a path. Other Space Syntax algorithms such as Adjacency, Permeability,
and Justified Graphs (“j-graph”), axial lines and axial maps, and smart avatar simulations will be added as they are
developed. (The single and double-line wall floor plans shown in most of the figures are also graphs; to a
programmer, they are stored in graph and network data structures where the points are the connections between the
lines and the arcs are the wall edge lines.)
Figure 1“House1” – a Sample Floor Plan
The geometry of a floor plan should be prepared with an appropriate drawing, drafting or modeling program and
exported in the form of a *.dxf file which Syntax2D will be able to read and which the user will be able to analyze.
Also, Syntax2D can export some of the information it produces in the form of *.txt files which can be read with
other programs such as MS Notepad or MS Excel.
Running the Program
The Syntax2D screen looks like this:
Figure 2 – Syntax2D
5
At the top is the Title Bar showing the icon and the name of the program at the left-hand end. At the right-hand end
are the familiar buttons for minimize, restore/maximize, and exit. Just below this Title Bar is the Menu Bar with
seven entries: File, Edit, Compute, Display, View, Viewport, and Help, that provide for the operational control of the
program. Immediately below is the main window -- a moderately large blank area - where a Space Syntax problem
will appear when it has been activated. Nearer the bottom of the window, three palettes (Avatar, Opening
Tolerances,Command) have appeared with a few default selections in evidence. At the very bottom, the normal
Windows task bar will also be visible.
The Syntax program can be closed by either clicking on the X-button at the far right-hand end of the Title Bar, by
entering "Ctrl+Q" from the keyboard, or by clicking File on the menu bar and then clicking Exit which will appear
at the bottom of File’s pull-down menu.
The palettes at the bottom of the display are used to 1) control an intelligent avatar, 2) specify the opening tolerances
used to determine if a rough opening gap is within limits to be considered as a door, and 3) a command line dialog
which eventually will allow commands to be typed and echoed, but is currently used only to display messages from
the program (like a running count of the number of Isovists remaining in the calculation begun by the menu
command, Compute-Measurements).
Opening a Space Syntax File
Returning to the open Syntax2D window, presented above, the window is ready for the user to take the next steps in
calling up a Space Syntax problem. If an appropriate syntax problem has been created and saved previously, then it
can just be loaded. On the other hand, for a new problem, the user will need to call a previously prepared *.dxf or
*.nw2 file and convert it into a syntax problem. For now, however, assume that a syntax problem has been created
and saved previously; in this case “House1.”
To proceed, click on the File menu which opens a pull-down menu; then click on Open in the pull-down menu
(second item) and a Windows file dialog will appear preset to the *.sx2 file extension and listing of all of the
available *sx2 files. Click on it and the window will change to the following:-
Figure 3 - Previously prepared syntax file (*.sx2) loaded and ready to be run.
The display is the outline of a floor plan with rough opening cuts for doors.
Running the Problem
This representation is ready to be run or to be modified in support of whatever Space Syntax measurements are to be
investigated. For now, to get a first look at what Syntax2D does with this representation, just accept the default
settings.
6
Figure 4 – House1.sx2 syntax problem shown with regular grids
A grid with 3’ increment is shown. As an example of how to display Space Syntax measurements which are based
on “Isovists,” after generating the grid, choose the Display-Area menu command.
Figure 5 – Image showing relative area values.
A tutorial involving House1.sx2 can be taken up later in a much more thorough manner. It was simply introduced
here to provide something on the monitor to discuss. This document will proceed to present the various features,
menus and palettes of the program in detail now that there is some foundation for understanding how the program
works.
The Syntax2D Program
Most of the functionality of Syntax2D is initiated through pull-down menus. As presented above, when Syntax2D is
loaded, it produces a window with seven pull-down menus listed on the menu bar: File, Edit, Compute, Display,
View, Viewport and Help. These menu items actually have familiar meanings and functions in common with most
Windows programs. File and Edit should be completely familiar in concept; Compute, Display, View and, Viewport
may be less familiar but simply have to do with the unique tools of this program.
Briefly, the File menu deals primarily with bringing information to the program or exporting program results for
external use. It handles importing a geometric description of a room, calling or saving a prepared syntax problem,
e.g., the House1.sx2 file, and exporting information prepared within the program to another application, perhaps an
Excel spreadsheet. Edit deals with modifying of walls, and spaces using sketching tools found in most CAD
applications – line, polyline, grip-editing, trim, offset, etc. The Compute menu instructs the program to generate
spaces, openings, a perimeter, single Isovists, single Isovists animated, subdivision of spaces in preparation for “j7
graphs,” generation of Isovists along a path, and creation of overlay grids. The Display menu controls the display of
Isovist/grid measures. The View menu allows different aspects of the underlying model to be displayed. The
Vewport menu controls the size and location of the drawing. The Help menu is unsupported at this time. Thus, the
seven menus, in familiar computer concepts, enable the user to manipulate the situation at hand in potentially useful
ways.
Pull-Down Menu Commands
Since the functionality of the Syntax2D program resides primarily in its menus, these will now be presented and
discussed in some detail.
File
Figure 6 shows that eight items, arranged in five groups,
occur in this pull-down menu. All deal in some way with
transferring file information into or out of Syntax. The
second item is the obligatory identification of origin and
authorship. The others deal with opening, closing,
printing and renaming of syntax files.
Figure 6 –File menu
Open
To open and read a prepared syntax problem
file with an *.sx2 extent.
The Open command can be activated through the File menu or, without pulling down the file menu, by entering
"Ctrl+O" from the keyboard, or through the Command Pop-Up Menu (Pop-Up menus will be discussed later). Open
activates a standard file dialog preset for the *.sx2 file extension). Simply choose the one you want to work with
now and click the Open button to load it onto the screen.
Figure 7 - Common File dialog for opening a syntax file
8
Save
To write the current syntax project to an *.sx2 file in the
current directory.
The Save command can be activated through the File menu, by entering "Ctrl+S" from the keyboard, or through the
Command Pop-Up menu. A File dialog is displayed if the current project has never been saved before and it asks
you to choose a file name. Subsequent saves will write the project in that current *.sx2 file. The current file name is
displayed in parentheses at the upper left of the main window title bar. An example is already available in Figure 3,
which shows (House.sx2) at that location.
The native Syntax2D project file format is ASCII with an *.sx2 extent. Although it is possible to use a standard text
editor such as Notepad to create a similar syntax file, that is not recommended. Ideally, one should import the room
geometry data from a file saved in DXF or NW2 format and use the Save command to automatically generate an
*.sx2 file for future use and reference. Refer to the File Format section of this manual for an example and line-byline explanation of an *.sx2 file.
Save As
To save the current syntax problem to a different *.sx2 file.
The Save As command can be activated through the File menu or by entering "Shift+S" from the keyboard and the
File dialog will open. The primary use of this command is to save alternative versions of a particular syntax problem
for direct recall in the future. This command is not required for the first saving of a new syntax problem because the
program will automatically request a new file name.
Import
To read a new geometry available in another (not *.sx2)
format.
The Import command elicits two additional choices; DXF or NW2. Again, a standard file dialog opens and one has
to direct the program to the appropriate drive and file location. If your choice is the more typical DXF, the Layer
Attributes dialog will need to be negotiated first
DXF
There are three DXF options: Double Line, Single Line and Raw. The “Raw” option reads each DXF object and
attempts to convert it to walls. Layers are ignored. This is typically used when “cleaning” the drawing file
(AutoCAD, formZ, Revit, …). Cleaning is the usually time-consuming process of making decisions regarding the
“appropriateness” of the data. This could be a scale issue is, say, the range of the data is vast and the detail of the
geometry is small. This might be the case of a large office floor containing very small and intricate vector graphics
representing the usual office artifacts: copy machines, doors, drinking fountains, desks, partition, etc. Cleansing is
exacerbated in drawing files that were originally produced as “working drawings.” These often have less than
obvious layer names and because their intent is to produce plots, they contain much too much detail for the
generation of isovist polygons. The following figure is evidence of this problem, showing both nonsensical layer
names and visually challenging overlay of all layers.
9
Figure 8 – Cleansing: Layer Names
The usual first step in cleaning the data is to identify useful layers and to eliminate the others. Renaming the layers
will allow Syntax2D to make a good guess as to their type. Fixing the data is a more difficult undertaking. Some
layers will contain graphics that will be used as background. These lines are not to be used in determining isovist
polygons. Other groups of lines must be replaced by a much simplified representation.
Figure 9 - Cleansing: Substitution
The table and chair grouping on the left has detail sufficient for architectural working drawings, but too detailed for
the generation of an isovist, centered far away. Substituting a rectangle as seen boldly on the right or a convex hull
is sufficient for computing isovist polygons centered anywhere in the model.
It is dangerous to substitute either if the group of objects is to be traversed through, or the group is too close to the
vantage point of the isovist.
10
Figure 10 - Cleansing: Substitute
Figure 11 - Cleaning: Scale Issues
Figure 12– Double Line DXF Option
11
Figure 13– Single Line DXF Option
Figure 14 – Common File dialog to import a DXF file
The DXF choice is intended as the principal way to get the geometry of a problem into Syntax2D. Since most
drawing programs that might be used to produce a suitable *.dxf file representation do so in layers, the DXF choice
will next cause the display of a Layer Attributes dialog to be completed by the user. Syntax2D recognizes layers
with names containing “names” and “openings” (as well as other types) as layers containing room names (actually
assigned as activity) and opening data.
12
Figure 15 - Importing DXF: Two examples of the Layer Attributes dialog
Syntax2D recognizes the following DXF drawing entities: LINE, POLYLINE, LWPOLYLINE, CIRCLE, ELLIPSE,
ARC, POINT, ATTDEF, BLOCK and INSERT. Geometrical attributes such as thickness, lineweight, elevation and
line type are ignored. BLOCK and INSERT are intended to simplify multiple instances of items such as audience
seating, columns, etc., however, nested BLOCKS are not supported. This Layer Attributes dialog will appear for all
layers in the *.dxf file and require you to select a choice of how to interpret each layer.
The drawing elements on each layer may be stored as Walls which will be used to generate spaces; stored as Object
that are drawn but not used in the generation of spaces; Ignore, that are not used at all; Opening, that are lines
representing openings; Space/Room that are closed polylines representing rooms;Background that are drawn but not
used for anything; or Perimeter that is a closed polyline(s) to be used as a perimeter.
A note regarding sketching space polygons as closed POLYLINES in a double line model. If the target analysis is
grid-based, one of the spaces polygons should follow the rough opening to avoid having empty areas in the grid.
Figure 16 - Right figure shows space polyline tracing rough opening
The figure on the left has rectangular polylines for all spaces. The figure on the right has the upper left space
polyline follow the two rough openings. The proper opening geometry for the figure on the left must be an exactlyfitting rectangle. The figure on the right would have doors as single lines coinciding with the tangent portions of the
three space polylines. (I’m sorry this is so confusing. Future versions will allow inexact openings; that is, the
rectangle, lines or single line representing an opening will need only to be “close enough.”) The figure on the right
also shows the subdivision of (what would be) concave grid cells into smaller cells. Currently, this is working well,
but may not be necessary if the grid cells are small to begin with (I’m not sure if 1meter is “small enough.”)
Syntax2D responds to the $MEASUREMENT system variable which determines whether the *.dxf file contains
English (inches) or Metric (cm) units. If this variable is not found during the Import-DXF command, a Set Units
dialog will be displayed and the user must make the appropriate choice.
13
Figure 17 - Importing DXF: Set Units dialog
Note: If a layer is designated as a “Perimeter” and the lines on that layer are not closed circuits, the computation of
isovists (either as paths, grids, points in a file, or individual points) may fail. This is because a closed polygon is
necessary for the creation of isovists. If bad results occur, revisit the source of the perimeter and make sure it is a
correct polygon. As an alternative, when importing from the Perimeter layer, choose another type (say, Walls) and
let the program use the Convex Hull as perimeter. If this is not appropriate, you must use the original drawing
program to correct the Perimeter (perhaps, in ACAD, use PEDIT to close open POLYLINES or to connect pieces).
NW2
This format is for wall configurations which need not be defined as a DXF file, but instead are simple enough to be
typed directly into a file using a text editor such as Notepad. It has been used during the earliest phases of program
development before the *.dxf import phase was available. It can still be used if for some reason a DXF capable
drawing program was not available, but for architecture students, the DXF route is much preferred. This 2D network
format is described later, see the File Formats section.
Export
To write wall geometry data in another (not "*sx2") format.
The Export command elicits four additional choices. These represent the forms of files in which Syntax2D can
export some of its information.
Building
This is not yet supported.
Grid Data
When an overlay grid has been computed and Isovist measures have been calculated, the complete data set (as a
rectangular array of values – one line per grid cell) can be exported as a simple ASCII *.txt file by calling FileExport-Grid Data. Subsequently, this exported file can be imported into some other program, perhaps a related
spreadsheet program, where the data can be unpacked, sorted and operated upon with other appropriate calculations.
Set Export Values
The “Export ” dialog is used to choose the Isovist measures that are to be exported.
14
Figure 18– Set Export ValuesDialog
Adjacency Matrix
Strictly for debugging purposes, but may be useful to others. The user is asked for a (*.txt) filename and the roomdoor adjacency matrix is written.
Print
To print the contents of the current screen.
The Print command can be activated through the FILE menu or by entering "Ctrl+P". Print is a quick way to obtain
a hard copy of an interesting run result. The "default printer" is used and the print is not queued. Such a print
contains the name of the *.sx2 file. Any more extensive annotation must be added outside the Syntax2D program. At
present, entering "Ctrl+P" from the keyboard also unintentionally triggers a coordinate display on the screen but this
does not print; a visual nuisance but not a functional trouble.
In addition to the File-Print command, the usual MS Window’s "clipboard" feature is available through the "Print
Screen" or "Alt-Print Screen" key combinations. Another program such as MS Paint, MS Word or Adobe Photoshop
must be opened to provide a place to Edit-Paste this screen bitmap. "Print Screen" will copy the entire screen while
"Alt-Print Screen" will copy just the active window; if you have been running the program, you will need to click on
the main screen to get it instead of the last palette used. The figures used in this document were captured using these
techniques.
Exit
To quit the application.
The Exit command can be activated through the File menu, by entering "Ctrl+Q" from the keyboard, through the
Command Pop-Up Menu or the "X" button at the right end of the menu bar. Remember to Save or Save As first to
retain an updated *sx2 file if you think that you will want recall the current syntax problem to work with in the
future.
15
Edit
The Edit menu is the principle means of graphically modifying
walls, openings and spaces.
Figure 19 - Edit menu
Walls
Not implemented This will eventually allow missing, and
incorrect wall lines to be fixed, sketched, deleted,
trimmed, …
Openings
Not implemented.
Spaces
Not implemented
Layers
To change layer settings.
16
Preferences
To change various underlying variables which control the
operation of commands.
Two implemented preference variables are Number of Radial Lines, which controls the number of lines generated
for radial versions of Isovists, and relative Radius (J-Graph) 0 < 25. The latter controls the relative (5, as shown,
means five percent of the window. This value may be between 0 and 25%).
Figure 20 – Preferences Dialog
17
Change Units
To change the units of the underlying physical model..
Figure 21 - "Set Units" dialog showing conversion from Feet to Inches
Compute
The Compute menu controls the generation of
new geometries.
Figure 22 - Compute menu
Spaces
Spaces are automatically generated from the imported (or, eventually, sketched lines). For
this to work properly, it is important to draft carefully and connect lines so they can be put
“head to tail” to form closed space polygons. Rough openings must be included to represent
passages from space to space and from space to outside. The above figure of House1.dxf
shows a properly drafted floor plan.
It is hoped that future versions of Syntax2D will have a hybrid version of this algorithm.
Generating spaces from drafted floor plans or urban areas is nearly impossible. It is
necessary to sketch additional edges and re-configure automatically generated space
polygons. This is also true of windows (that must be generated prior to spaces since they fill
the rough-opening gaps.
A poorly drafted floor plan will not allow the generation of correct space polygons. Errors include: unclosed lines,
overlapping lines, coincident lines, missing lines and missing rough openings. During importing, Syntax2D will
18
keep a list of bad walls and graphically flag the errors. To fix the errors, return to the CAD program which was used
to create the DXF file. In future versions, Edit-Walls can be used to modify the incorrect walls.
Figure 23 – View-Bad Walls
Compute-Spaces initially creates pairs of opening lines which, for each opening, are parallel and a wall thickness
apart. The values shown in the Opening Palette are used to determine if a gap between parallel wall lines is within
range shown as “Small Opening Tolerance” and “Large Opening Tolerance.” If these values are not sufficient for
the imported file they may be modified to fit a smaller or larger gap.
As an alternative to generating spaces and perimeters automatically, it is possible to provide drafted, closed
POLYLINES to represent perimeters and spaces. These polygons must be on “Perimeter” and “Space” layers. (See
Figure 11.) If an imported file has space and perimeter layers, the “Compute/Spaces” or “Compute/Perimeter”
cannot be used.
Figure 24 – Opening Tolerance Dialog
Openings
To generate opening lines from the rough opening gaps in the walls drawing.
The figures to the left show the original door rough opening
and the resultant two opening lines added during either the
Compute-Spaces or Compute-Opening menu commands. It
is the intent of the program to allow door lines to be
“sketched” if they are not automatically created.
Figure 25 – Automatic Generation of opening lines
The figures to the left show what happens when the pairs of
parallel lines generate only one opening line even though
they are within the opening tolerances. The second parallel
opening line would have to cross two wall lines, which is
not allowed. Currently, the result of this case is shown in
the House1 example above – the “C-shaped” corridor-like
room is not added to the spaces list and, therefore, not
grided. This pathological case will be fixed in future
19
versions.
Figure 26 – Single opening line case.
Perimeter
The perimeter is a polygon which completely encloses all spaces. As is true
with all space polygons, the perimeter polygon (actually, a polygon-set) may
contain several polygons and holes.
Isovist
The Isovist menu command is the entry point for creating single Isovists. To
do so, after entering the command, locate the cursor inside one of the spaces
and click the mouse button. The result will be a filled Isovist polygon and the
appearance of a slim dialog box to the right of the main window that contains
the Isovists measures.
The algorithms used to produce the measurements in the modal dialog (“Isovist Values”) can be found in the
Appendix.
Figure 27 – Single Point Isovist
You are now under control of a sub-menu that allows for more single Isovists, changing to radial approximation of
Isovists and exiting the single Isovist command. Hitting the “Save to File” button on the lower left of the “IsoVist
Values” dialog will cause the current set of values to be written to a file. The user is prompted for the file name only
20
once for each isovist session (end session by right mouse click and choosing “Quit IsoVist.” The values written are
controlld by the Export-Set Export Values dialog.
The Command Line Dialog notes that an exact point may be entered by hitting the “P” key:
Figure 28 - Dialog for entering exact point coordinates.
The x and y coordinates may be entered using the current “units.”
Radial approximations to Isovists
The radial Isovist is a 360 degree fan of rays eminating from the Isovist center.
A few of the Isovist measures are based on this geometry. The number of rays
is set in the Edit-Preferences menu command.
Figure 29– Single Point Isovist – Radial Lines
When the Radial lines are shown, the Command Line dialog notes that by hitting an “F” key the radial lines and the
computed maximum and minimum radial lengths are written to “Radials.txt.” This is a temporary option during the
beta testing of the software
21
Show Measures
To toggle the display of Isovist measures.
Isovist Animate
Similar to Compute-Isovist except that Isovists are constantly being created as
the cursor is moved over the drawing. Currently, a very slow algorithm is used
to create Isovists which slows the animation considerably (animated radials do
much better). It is assumed that a much faster version will be substituted to
make the animation smooth. The complexity of the floor plan will always
affect the speed of the Isovist creation. It is possible that future generations of
processors will help smooth animations.
Similar to the Isovist command in that a new isovist is created for every
location read from a formatted file.
Figure 30 - Points to be read from file dialog
This dialog is a reduced version of the path isovist dialog. Like the path isovist, the points read from the *.pt2 file
become the focus of the set of isovists that may be: 1) written to a file (identical format to path isovists), 2) shown as
individual isovist polygons, 3) shown as a cumulative set of isovist polygons, and 4) shown as only points. The
Cone of Vision option is not yet implemented.
This command is almost identical to the path isovist command and dialogs. The difference is that the points are
exactly specified and not determined by stepping along a given path at a specified step length.
22
Figure 31 - Common file dialog
The format of a “*.pt2” file is:
Char float float
Name(tag) X coordinate
Y coordinate
22
-1475
21y
-1229
21-x
-1310
20y
-786
16
-227
8
1028
2
-107
2a
313
6a
647
12
874
17a
946
c0
-663
-16896
-17073
-17153
-17146
-16932
-16971
-17719
-17563
-17548
-17855
-18220
-18117
Figure 32 – Isovist point file
The X,Y coordinates can be taken directly from the Syntax2D display using the “P” single keyhit command, or by
using the point identification tool of the program that generated the DXF file (the “ID” command in AutoCAD).
Isovist Second Order
Similar to Isovist command in that a new isovist is created for every location
entered with the left mouse button. The isovists stay drawn until “Quit
IsoVist” is toggled from the sub-menu. The isovists are then drawn as
wireframe and the intersection of all selected isovists is drawn and filled.
23
Figure 33 – Intersection of two Isovists
Subdivision
This command provides the preliminary space subdivision that are often
desirable (sometimes, necessary) for the creation of “j-graphs.” Both
commands are similar – they reduce concave space polygons to convex
polygons.
Currently, there are five options for generating subdivisions. The Node option tends to add lines that are between
existing concave and convex points (third and fourth figures below). The Perp option connects concave points to
either the nearest (Short) or farthest (Long) line by adding a pair of perpendicular lines (first and second figures
below.
Figure 34 – Samples of four subdivision settings: Perp/Short, Perp/Long, Node/Short, Node/Long.
Note the undesirable result of the right-most figure; topologically correct, but five convex sub-polys and a very thin
polygon.
The conversion from concave space to convex sub-spaces can (and has) been made semi-automatic. First, the
algorithm initializes the data structures by converting the concave polygon to a network, flags each point as either
concave or convex. Second, it loops through each concave point and finds a connection to another concave point, a
non-concave point or a connection perpendicular to another line. Third, it puts two copies of the new line in the
network data structure, in opposite directions (and for the perpendicular case, divides the perpendicular, intersecting
line into two pieces). Fourth, after the addition of only one pair of lines, the network is converted (head to tail, turn
right if a choice emerges, stop when closed) to two new polygons. Fifth, if the next polygon on the list is convex, it
24
is added to the final polygon list; if not, the next polygon is processed, beginning at the first step. A recursive
algorithm was not used.
Figure 35 – Subdivision Options. I’m not sure what “Default” does.
There are many algorithms that will do the conversion and there is also more than one solution – there are, in fact,
many solutions. Two obvious variations are the different solutions resulting from either letting concave to concave
point connections have priority, or letting concave points resolve themselves by striking normals to un-occluded
lines. The five choices in the following figure show three concave-concave lines and two concave to perpendicular
lines:
Figure 36 – Various concave point resolutions.
Future implementations will provide a “look ahead” strategy to allow a more intelligent decision (other than shortest
length) to be made. The lower left corner of the figure shows how an early shortest length decision produced an
extra polygon.
Figure 37 – Subdivided spaces. This is a conversion of all concave spaces into convex spaces.
25
Figure 38 – A better first solution would generate two convex polygons and terminate.
Figure 39 – Example showing shortest perpendicular lines.
It is a good hunch that components of this capability in Syntax2D will be modified, repaired, augmented, removed
for many years. Much has been written about subdividing a concave polygon into convex polygons. n.b. Concave
polygons may contain un-tethered holes.
Figure 40 – Concave polygon containing a hole
Subdivision Single Space
To subdivide a single concave space polygon.
After clicking inside the concave space, a dialog is shown with the single room. A right-mouse click submenu is
available and used to set the subdivision type and to choose “Preview” and “Accept.” Accepting causes the surrent
subdivisions to be added to the space’s list of sub-polygons.
26
Figure 41 – Single Space Subdivision dialog and submenu.
Path
To choose a path and generate a sequence of Isovist along the path at a given step
length. The result is a pseudo-animation of the sequence of Isovists and a flat file
of Isovist measures, one line per Isovist, which can be imported into a spreadsheet
or word-processing program.
Paths must be saved as POLYLINES in DXF files. As the figure shows, there can be more than one path per file.
Paths must be on separate layers, usually with the word PATH embedded in the name (for automatic layer
identification).
Figure 42 – Syntax2D model with three paths (before clipping)
Before the path Isovists are created, the path(s) is clipped to the perimeter.
Figure 43 – Select Path Dialog
27
Paths are automatically named as “Path_N.” Check “Cumulative isovist” if you wish to have all isovists along the
path to by drawn together. Uncheck if you wish to show individual isovists. In either case, the display of isovists is
an animation. The isovist measures may be written to a file by checking “Write to file.” To generate the path points
only, check the “Path points only’ box.
2.515
2.265
2.015
1.766
1.738
2.052
2.366
2.681
2.995
3.309
3.623
3.938
3.798
3.757
4.726
5.694
6.662
7.623
8.572
9.522
10.471
11.420
12.370
13.319
14.269
15.248
83.981 56.072 31.749 1.498 0.258 20.231 2.976 0.780 3.106 17.763 0.331 175.952 7.980 -0.130 0 0.0000
89.166 58.435 25.523 1.526 0.537 19.340 3.859 3.141 2.491 14.500 0.525 137.699 7.063 1.368 0 0.0000
89.921 58.425 24.364 1.539 1.221 18.464 4.219 3.188 1.955 11.009 0.622 106.077 6.090 2.264 0 0.0000
89.924 58.352 26.479 1.541 2.163 17.600 4.385 3.652 1.622 8.732 0.672 83.016 4.355 2.762 0 0.0000
89.738 58.449 25.953 1.535 2.596 16.752 4.555 3.880 1.619 8.259 0.726 71.509 3.458 2.937 0 0.0000
93.744 59.507 22.687 1.575 1.725 15.647 4.648 4.164 1.715 7.528 0.724 51.329 3.192 2.933 0 0.0000
98.858 61.518 22.626 1.607 0.951 14.677 4.800 4.295 2.057 8.140 0.732 36.271 3.976 2.742 0 0.0000
105.809 62.827 23.931 1.684 0.898 13.706 5.017 5.007 2.252 8.816 0.747 22.856 3.016 2.766 0 0.0000
106.764 63.501 19.928 1.681 1.224 12.649 5.114 4.922 2.226 7.946 0.770 17.114 1.884 2.888 0 0.0000
104.590 63.245 22.352 1.654 1.582 11.860 5.089 4.335 2.227 7.691 0.778 19.187 1.037 2.862 0 0.0000
102.096 63.278 25.355 1.613 2.209 11.236 5.031 4.479 2.137 7.400 0.779 22.028 1.108 2.893 0 0.0000
100.912 62.840 25.225 1.606 2.221 10.935 4.976 3.923 2.167 7.780 0.771 24.349 1.436 2.808 0 0.0000
101.536 63.040 25.157 1.611 2.130 11.864 4.962 4.353 2.143 7.765 0.762 25.412 0.529 2.819 0 0.0000
Figure 44 - Path Isovist data written to a file
Figure 45 – Path points
Figure 46 – Single isovist at each path point
28
Figure 47– Cumulative isovists along same path
Mesh
To prepare for gird Isovist calculation the spaces must be meshed.
The Initial mesh size is the size of each grid cell. The Number of iterations is used with the non-Regular Grid option
to reduce concave grid cells. If extended, there will be a lower left corner of a grid cell at point (Origin X, Origin Y).
Angle is the angle of the grid cells. If Regular Grid is unchecked, each space will be filled with full-size grid cells
and concave cells will be subdivided (Number of iterations).
Note in the Regular Grid example, grid cell centers are drawn as small circles. Also note that in the Regular Grid
example, Grid cells are added only if their centers are inside a space. The bottom row of cells are missing since
their centers are inside the exterior wall. These grid cells are the basis for the following Compute-Measure menu
command.
Figure 48– Non-Regular Grid
29
Figure 49 – Regular Grid
Measurement
To compute an Isovist for each grid cell and compute a set of measures for each.
The program loops through each grid cell and creates an Isovist from the cell center. This can be very time
consuming if the number of cells and/or the number of walls is high. After the command concludes, a shaded image
of one of the measures can be displayed using the menu command Display-Area (or Perimeter, Compactness,…) A
flat file can also be exported using the menu command File-Export-Grid Data, and imported into a spreadsheet or
word-processing program.
Batch Processing
In many cases, a small grid size will cause the application to “disappear” for long periods while it is computing
isovists, radials and measures. You may find it to your advantage to compute the grid measures using the
“BatchSyntax” application. The application reads a “batch” file that contains one line for each set of measurements.
The following is a sample file that will produce four syntax files. The first computes grid measurements for the file
“HandsOnMuseum.sx2’ and produces a syntax file, “Hands1.sx2.” The mesh option is “Space” which means that
the grids will be inside the spaces (other options – Regular, Hull, Non-Regular). The mesh spacing is 50, and
measures using the polygonal isovists and “radials” will be computed. The fourth line will generate a file of data for
each point along “Path_1,” at a spacing of 4 units. Only measurement based on polygonal isovists will be computed
(noradial).
The “grid” option produces a standard Syntax2D file and includes all measures for all grid points (see Display
menu). The “path” option produces a text file with one line of space-delimited data for each point along the path.
grid HandsOnMuseum.sx2 Hands1.sx2 space 50 noradials
grid HandsOnMuseum.sx2 Hands2.sx2 space 75 radials
path HandsOnMuseum.sx2 Hands3.txt Path_1 4 radials
path HandsOnMuseum.sx2 Hands4.txt Path_2 6 noradials
Figure 50 – Sample batch file
30
Figure 51 – Batch Syntax program running
Justified Graph (J-Graph)
To compute a justified graph and associated measures.
(Some authors designate three types of graphs used in
this context: Boundary (floor plan), Adjacency (nodes
as spaces, arcs as passageways or shared wall),
Permeability (arcs as passageways only) and Justified
(Permeability with a root node – space – and a central,
straight line connecting spaces ending at the highest
level connected space, and secondary nodes branching
to the right and left side). I use the term “J-Graph” to
represent the last two types of graphs. (See “A Quick
Guide to Space Syntax Analysis and Quick Reference
Computer Manual For Students,” Dr. Laura Vaughn,
Bartlett School of Graduate Studies, UCL.)
A space must be chosen and a graph is created showing the space as root with arcs representing passageways
between spaces. The passageways may be as simple as shared edges between two tangent convex polygons or may
be doors.
Figure 52 – Permeable Graph
The Mean Depth and related measures are computed and displayed:
31
Figure 53 – Mean Depth and Relative Symmetry
Justified Graph
To generate a Justified Graph and measures.
After the “root” space is chosen, a “tree” graph (see previous figure) is created showing circles for each room and
arcs for connections between rooms (doors, or other passageways). The root node is drawn in red. Currently, the
circles are drawn at the centroid of the rooms. If a point outside of all the rooms is chosen, it is assumed that the
root space is the perimeter; that is, the outside. A circle is drawn for the perimeter and is placed inside the drawing.
Figure 54 - Root chosen outside all rooms
Convex Justified Graph
To generate a Justified Graph and measures based on convex subdivisions.
A similar graph and measures are computed based on room subdivisions (see Edit/Subdivide menu command).
Before toggling the command be sure to check the View/Space Subdivide menu command. Doors (passageways) are
automatically assigned to edges of the subdivision polygons that are tangent to other subdivision polygons, and not
tangent to wall edges. This command is under construction.
Figure 55 - Before and after concave subdivision.
32
Figure 56 - After Compute/Justified-Graph/Convex command
Permeable Justified Graph
Figure 57 – Permeable Justified Graph
Justified Graph All Spaces
To generate Justified Graph measures for all spaces..
A permeable graph is created for each space and measures are computed and written to a *.txt file.
space name
activity
mean depth (as defined in “The Social Logic of Space” by Hillier and Hanson)
relative asymmetry (as defined in “The Social Logic of Space” by Hillier and Hanson)
Space-0
NoActivity
3.2222
0.5556
33
Space-1
NoActivity
Space-2
NoActivity
Space-3
NoActivity
Space-4
NoActivity
Space-5
NoActivity
Space-6
NoActivity
Space-7
NoActivity
Space-8
NoActivity
Perimeter-10
Perimeter
3.8889
4.3333
3.4444
3.6667
2.7778
2.5556
2.5556
2.7778
4.7778
0.7222
0.8333
0.6111
0.6667
0.4444
0.3889
0.3889
0.4444
0.9444
Figure 58 - J-Graph - "All spaces" option
Axial Map
To generate an axial map
Also, axial maps will be created semi-automatically. The proposed algorithm will generate more axial lines than
needed to cover all convex polygons. The user will be expected to choose between coverage sets of axial lines. A
“coverage set” is a set of axial lines such that every convex polygon is crossed by at least one axial line. This
command is under development.
Fix Walls
To remove overlapping and duplicate walls
This is only partially implemented.
Display
After measurements have been computed using
Compute/Measurements, single measures can be
displayed as a shaded image with each cell filled
with a blue color whose intensity varies according
to the value of the cell for that variable.
Figure 2 above shows a shaded image of the Area
variable for House1.
An explanation of the algorithms for each of the
measures can be found in the Appendix.
Figure 59 - Display Menu
34
View
The View menu controls what is displayed on the screen.
Most of the graphic elements can be toggled on or off in
this menu.
Syntax2D began as a testing program for other
algorithms including intelligent avatar movement (note
the Avatar palette at the bottom of the screen), creation
of convex hull, and a variety of support routines. Future
versions of the program will include only Space Syntax
functions.
Figure 60 –View Menu
Viewport
To control the size and location of what
is drawn on the screen. These are
normal CAD viewport controls.
Figure 61 - Viewport Palette
Zoom In
Choosing Viewport-Zoom In allows for the re-scaling of the drawing through the
creation of a rectangular clipping window. One end of the diagonal of the
clipping rectangle will be at the point when the left mouse button is depressed
(and held) and the other end will be at the point when the left mouse button is
released. As the mouse is dragged to the second point, a dotted outline of the
window will be shown. The main window will be erased and the drawing will be
transformed such that the lines within the clipping window will be shown at a
larger scale. Before redrawing, the aspect ratio of the rectangular clipping
window will be adjusted to equal the aspect ratio of the main window.
Zoom Out
To reset the drawing to its original scale and location within the main window.
35
Zoom Previous
To back up to the previous viewport values; use Zoom All (Reset) to return to the
base display
Zoom In Step
To zoom in 25% about the center of the current displayed drawing.
Zoom Out Step
To zoom out 25% about the center of the current displayed drawing.
Pan
Choosing Viewport-Pan allows for the drawing to be shifted. The interaction is
similar to Viewport-Zoom; Depressing and holding the left mouse button, sliding
the mouse to a new location, and releasing the left mouse button define the
incremental X and Y values. As the mouse is dragged to the second point, a
dotted line will be shown. The main window will be erased and the lines redrawn
in a new location. The scale of the drawing will not be changed.
36
Appendix
Mouse Options
The computer mouse has been used in familiar ways up to this point to choose files, make menu and option
selections, etc.; the typical uses of the mouse in a Windows environment. There are, however, several additional
applications for the mouse in the Syntax2D program when the main window is active (indicated by the blue color of
the title bar).
Locating the arrow cursor at a point within the window and pressing the "p" key will cause the X,Y coordinates of
that location to be displayed on the screen as text. Since the scale of a plan or section on the screen is not obvious,
this mouse option produces a convenient reminder of the approximate coordinates for any point of interest.
Double clicking when the cursor is in a space brings up a space/activity-naming dialog. Space names are not used in
the current version.
Figure 62 - Space naming Dialog
Double clicking near an opening brings up an opening-naming dialog. Opening names are not used in the current
version.
Figure 63 – Opening naming Dialog
Pop-Up Menus
Single clicking the right mouse button will cause pop-up menus to appear as detailed below.
Command Pop-Up Menu
The Command pop-up menu is displayed by clicking the right mouse
button with the cursor located in any blank space. This menu provides a
short cut to often-used commands.
Figure 64 - Command menu
37
File Format
Syntax File ("*.sx2")
All *.sx2 files will begin with a number of lines of annotation followed by the word ENGLISH or METRIC.
1
Annotation goes here
ENGLISH
6
0 1 WINDOWS
0 1 COUNTERS
0 1 WALLS
0 1 DOORS
0 1 FURNITURE
0 1 0
224
1 2 0 1 2 223 0
0 1
5.333333 20.250000
5.333333 19.750000
1 2 0 1 2 222 0
…
…
16
Space-0 NoActivity
3
8
8 1 8
51.1395 20.2500
48.1395 20.2500
40.0978 20.2500
40.0978 29.5746
58.5686 29.5746
58.5686 14.9135
53.4728 14.9135
53.4728 20.2500
Space-1 NoActivity
3
5
5 1 5
52.9728 9.8333
52.9728 7.7917
45.2436 7.7917
45.2436 9.8125
47.0353 9.8125
Space-2 NoActivity
3
14
14 1 14
14.0833 0.7292
14.0833 3.3958
14.0833 4.0417
13.3750 4.0417
13.3750 9.8333
18.1667 9.8333
20.7083 9.8333
23.7083 9.8333
23.7083 6.3333
23.7083 3.8333
23.7083 0.5000
19.8333 0.5000
17.3333 0.5000
14.0833 0.5000
Space-3 NoActivity
3
28
…
…
232
3
4
4 1 4
3.0000 0.5000
0.5000 0.5000
0.5000 3.0000
3.0000 3.0000
1.500 1.500 286.878 177.139 1.620 1.000 46.694
5.411 1.440 5.694 62.682 0.321 1083.960 14.539 0.283 0.000 34 0.029
3
4
4 1 4
0.5000 3.0000
0.5000 6.0000
3.0000 6.0000
3.0000 3.0000
1.500 4.500 384.887 183.590 2.096 1.000 45.158
7.233 4.022 6.293 65.226 0.427 900.319 13.242 0.940
0.000 43 0.023
3
4
4 1 4
0.5000 6.0000
0.5000 9.0000
3.0000 9.0000
3.0000 6.0000
1.500 7.500 411.798 191.309 2.153 1.000 43.702
8.045 5.380 6.151 62.468 0.494 747.509 12.024 1.894
0.000 46 0.022
…
…
0
29
Opening-11
1
4
4
0 1
2 3
1 3
2 0
6.0997 30.0134
6.0997 33.7699
6.5997 30.0134
6.5997 33.7699
Opening-12
1
4
4
0 1
2 3
0 2
3 1
11.3978 37.6971
15.1577 37.6971
11.3978 37.1971
15.1577 37.1971
Opening-1
1
1
2
0 1
39.5978 32.5746
39.5978 30.0746
Opening-19
1
4
4
0 1
2 3
0 2
3 1
43.4155 3.1250
45.4155 3.1250
43.4155 3.5417
45.4155 3.5417
Network ("*.nw2")
The first line contains the number of lines (NL) and number of points (NP). This is followed by NL pairs of point
numbers representing begin and end of each line. This is followed by NP pairs of XY coordinates.
For a rectangular room measuring 200 units by 100 units:
4 4
0 1
1 2
2 3
3 0
0. 0.
38
0. 100.
200. 100.
200. 0.
Grid Data (*.txt)
The following listing shows an example of such exported data from House1 (see Figure 10b for the Export Dialog
which determined which Isovist measures were exported):
41.049
41.049
41.049
41.049
43.500
43.500
43.500
43.500
46.500
20.625
22.500
25.500
28.287
20.625
22.500
25.500
28.287
20.625
172.863
176.917
184.494
191.535
173.085
179.306
190.105
203.148
174.370
55.910
61.602
65.839
70.496
56.038
62.873
69.620
80.300
60.456
0.375
0.951
0.951
0.951
0.375
2.250
3.402
1.287
0.375
19.492
18.885
18.896
20.659
17.400
16.495
16.765
20.353
14.918
1.026
2.463
4.199
1.618
3.436
4.104
5.253
3.669
6.437
4.922
4.323
3.929
4.834
4.600
3.452
3.054
4.356
4.488
34.607
28.472
27.425
34.589
28.168
17.767
15.388
27.713
23.569
269.419 7.668 -0.446 25 0.040
202.973 7.187 0.975 26 0.038
190.123 7.522 1.693 28 0.036
276.273 8.994 0.322 30 0.033
124.175 5.531 0.626 25 0.040
84.563 4.748 2.815 27 0.037
86.699 5.367 3.652 30 0.033
159.975 8.290 1.799 29 0.034
22.704 3.346 1.159 25 0.040
Path Data (*.txt)
The following is a sample path file showing all measures:
Area, perimeter, compactness, min_radial, max_radial, ave_radial, med_radial, mom_inertia, occlusivity, inclusivity,
stddeviation, variance, circularity, skewness, drift, dispersion, connectivity and integration.
199.230
192.961
193.981
178.724
158.793
10.039
28.919
48.893
52.049
50.378
1759.295
4965.965
3825.535
3575.307
3624.531
408.316 230.277 4.309 7.855 88.578 18.183 11.739 10.936 220.216 0.590 7255.372 40.583 7.247 0 0.0000
1312.095 932.666 3.785 4.166 171.411 26.756 17.685 19.244 845.297 0.453 59256.762 66.658 7.512 0 0.0000
707.486 466.980 5.407 3.812 103.159 24.846 14.656 20.842 670.612 0.507 23800.416 28.329 4.003 0 0.0000
847.115 606.125 4.221 5.554 113.964 27.774 24.879 14.598 361.890 0.678 9585.554 39.382 13.176 0 0.0000
827.376 566.039 4.381 7.128 125.134 31.125 31.385 11.250 224.366 0.840 5174.235 46.001 19.875 0 0.0000
Isovist Measurements Algorithms
The following are the algorithms for each of the Isovist measurement values.
Figure 65 – Interactive isovist creation with measures shown
Area:
Area, perimeter and occlusivity are simple measures of a polygon. Syntax2D uses single function calls to computer
each:
area
= pg->area();
perimeter
= pg->perimeter();
occlusivity = compute_occlusive(pg, wallnw2);
Area of the Isovist polygon: The polygon data structure is defined as a “Polygon Set” – a collection of boundary
and hole polygons which define a single enclosed area. The boundary polygons are define clockwise and the holes
are define counter-clockwise. The data structure consists of three vectors, one integer and two floating points: id, x,
y. The topology is represented in “id” and the coordinates are stored in “x” and “y.” In the following function,
tr2_area computes the area of a triangle. float pg2_area(int id[], float x[], float y[])
39
{ float
area, x1, y1;
int
npg, i, j, k, npt;
area = 0.;
npg = id[1];
if ( npg < 1 )
{ return 0.;
}
k = 0;
// One polygon at a time.
for ( j=0; j<npg; j++ )
{ if ( id[2+j] < 3 )
{ k += abs(id[2+j]);
}
else
{ npt = id[2+j]-1;
x1 = x[k];
y1 = y[k];
for ( i=1; i<npt; i++ )
{ area += tr2_area (x1, y1, x[k+i], y[k+i], x[k+i+1], y[k+i+1]);
}
}
k+=(npt+1);
}
return area;
}
Perimeter:
The perimeter of the Isovist polygon. In the following function, pt2_dist_pt2 computes the distance between
two points. The function simply loops through each edge of each circuit and sums each length. The PG2SET data
structure allows multiple closed circuits, acting as either boundaries (clockwise) or holes (counter-clockwise).
perimeter
= pg->perimeter();
float pg2_perimeter (int id[], float x[], float y[])
{ int i, j, k, npts, npoly;
double perim;
k
= 0;
npoly = abs(id[1]);
perim = 0.;
for ( i=0; i<npoly; i++ )
{ npts = abs(id[i+2]) - 1;
if ( npts > 1 )
{ for ( j=0; j<npts; j++ )
{ perim += pt2_dist_pt2 (x[j+k],
y[j+k], x[j+k+1], y[j+k+1]);
}
if ( id[i+2] > 0 )
{ perim += pt2_dist_pt2 (x[npts+k], y[npts+k], x[k], y[k]);
}
}
k += npts+1;
}
return perim;
}
Occlusivity:
Occlusivity is theportion of the perimeter of the isovist polygon that does not coincide with wall lines. The dark
occlusive lines are shown in Figure 38.
occlusivity = compute_occlusive(pg, wallnw2);
40
Figure 66 - Occlusivity
The following function computes the “occlusivity,” the perimeter of the isovist polygon that doesn’t coincide with
room edges.
//-----------------------------------------------------------// Routine:
compute_occlusivity
// Purpose:
to compute the perimeter of the isovist polygon
//
that doesn't coincide with the walls
//
// Arguments: *pg
pointer to isovist polygon-set
//
*nw2
pointer to wall newtork
//------------------------------------------------------------float compute_occlusive(PG2SET *pg, NW2SET *nw2)
{ int i, j, k, i2, j2;
float tol, occlude, x0, y0, x1, y1, x2, y2, x3, y3;
int *id, ni, np, nl2, np2;
float *x, *y;
Line2D line1, line2;
Point2D point, mid;
tol = nw2->get_tolerance();
pg->get_info(ni, np);
nw2->get_info(nl2, np2);
id = new int[ni];
x
= new float[np];
y
= new float[np];
pg->get_raw(id, x, y);
// Work with raw polygon vectors
occlude = 0.;
for ( i=0, k=0; i<id[1]; i++ )
{ for ( j=0; j<id[i+2]; j++ )
{ x0 = x[j+k];
y0 = y[j+k];
if ( j == id[i+2]-1 )
{ x1 = x[k];
y1 = y[k];
}
else
{ x1 = x[j+k+1];
y1 = y[j+k+1];
}
// For each line segment in the isovist
line1.put_raw(x0, y0, x1, y1);
mid = line1.midpoint();
for ( i2=0; i2<nl2; i2++ )
{ nw2->get_line(i2, line2);
if ( mid.on_line(line2, tol) ) goto next1;
}
// Line does not coincide with wall lines. Add to occlusivity.
occlude += line1.length();
next1: continue;
}
k += id[i+2];
}
return occlude;
}
41
Inclusivity
The term “inclusivity” was chosen to represent the perimeter of an isovist minus the Occlusivity. Geometrically,
these are all the edges of an isovist that are tangent to occluding walls. This term is destined to be renamed
inclusivity = perimeter - occlusivity;
Figure 67 - Inclusivity
Compactness:
Compactness is the ratio of area to perimeter.
if
( perimeter > 0. )
{ compactness = area/perimeter;
}
else compactness = 0.;
totald
+= area;
totali
+= area;
Minimum, Maximum, Mean and Median Radial:
These measures are based on the radial version of the isovist:
Figure 68 – Radial isovist
After the radial version of the Isovist is computed, a loop through each ray will yield the shortest, longest, mean
length, and median length. In the following code, “ray” is a network of radials emanating from the isovist center,
“xc, yc.” The function “get_line” retrieves a line from ray. “distances” is a vector of lengths of all radial
lines.
int niterations, nl, np;
float totald, totali, bigarea, smallarea, dist, total, tiny, large;
float *distances, temp, xcent, ycent;
double sum1, sum2, sum3;
Boolean firsterror, firstnode, showisovist;
int NUMRADIALS;
// Compute radials metrics
*ray = new NW2SET;
*ray = walls->CompRays(xc, yc, NUMRADIALS, perim);
(*ray)->get_info(nl, np);
distances = new float[nl];
42
if (
total
tiny
large
nl == 0 ) return TRUE;
= 0.;
= 10e10;
= 0.;
// Loop through each radial line. Find shortest, longest. Save each length.
for ( int i=0; i<nl; i++ )
{ Line2D line;
line
= (*ray)->get_line(i);
dist
= line.length();
if ( dist < tiny ) tiny = dist;
if ( dist > large ) large = dist;
total
+= dist;
distances[i] = dist;
}
// Sort by length.
for ( i=0; i<nl-1; i++ )
{ for ( int j=i+1; j<nl; j++ )
{ if ( distances[j] < distances[i] )
{ temp
= distances[i];
distances[i] = distances[j];
distances[j] = temp;
}
}
}
ave_radial
= total/nl;
min_radial
= tiny;
max_radial
= large;
med_radial
= distances[(int)((nl/2.)+.5)];
Standard Deviation:
for ( i=0, sum1=0., sum2=0., sum3=0.; i<nl; i++ )
{ sum1 += fabs(distances[i] - ave_radial);
sum2 += (distances[i] - ave_radial) *
(distances[i] - ave_radial);
sum3 += (distances[i] - ave_radial) *
(distances[i] - ave_radial) *
(distances[i] - ave_radial);
}
stddeviation = sum1/NUMRADIALS;
Variance:
variance
= sum2/NUMRADIALS;
Circularity:
circularity
= ((ave_radial*ave_radial) * PI) / area;
Radial Moment:
Skewness
skewness
= sum3/NUMRADIALS;
drift
= pt2_dist_pt2(xc, yc, xcent, ycent);
Drift
Dispersion
dispersion
= ave_radial - stddeviation;
Connectivity
Connectivity is a measure of the number of grid points inside a given isovist polygon. It is an integer.
if
( grid )
{ connectivity = CompConnectivity(grid, tol);
}
43
The following function is used to compute the connectivity. “sum” is the accumulator. “point_inside” is a
function that determines if a point is inside a poilygon-set.
int IsoVist::CompConnectivity(Grid *grid, float tol)
{ GridPoint *gnode;
int sum;
sum
= 0;
gnode = grid->first;
while ( gnode )
{ if ( gnode->isovist != this )
{ if ( pg->point_inside(gnode->xc, gnode->yc, tol) )
}
gnode = gnode->next;
}
return sum;
}
sum++;
Integration
if
( connectivity != 0 )
{ integrationv
= 1./(double)connectivity;
}
else
{ integrationv
= 0.;
}
Generating Isovist Polygons
Two approaches were considered. The first was to use the available 2D polygon set-operations to combine view
triangles; made by constructing truncated pie pieces and subtracting them from a starting shape. The second
approach was to use only the 2D line intersection routines and connect lines from viewing point to endpoints of
occluding edges; to these intersections would be added the intersections of the same lines with other occluding lines.
Both algorithms were judged to be not too difficult to design and implement and both would produce a proper
isovist polygon.
Figure 69 - Occluding perimeter and interior walls
Both approaches were begun, but only the polygon set-version was completed. This algorithm is judged to be
significantly slower than a “one-off’ implementation of the line intersection approach; that is, the isovists are very
slow to generate. This is not evident in the single isovist tools, but is apparent in the grid and path isovist tools. It
was decided the slowness overhead would be more than offset by the advantage of using existing routines that have
been written, tested and debugged for over three decades. (GO TO FORtran FORever!)
44
Figure 70 - Variables used in isovist calculation
The algorithm begins by creating the convex hull (and calling it the “perimeter”) of the occluding wall points. This
polygon-set will be whittled away by subtracting “truncated pie pieces’ as shown in the next figure. One pie piece is
created for each occluding wall line. The figure shows the result of subtracting all perimeter walls from the hull.
Start with expanded convex hull
Figure 71 - Truncated Pie Piece using perimeter wall. All perimeter pie pieces.
The subtracting of the pie pieces generated from perimeter lines wipes out the expanded hull. The hull is used to
include some outside area if disjoint polygons define the perimeter.
45
Figure 72- Interior walls subtracted from isovist polygon.
#define CPT 36
//-----------------------------------------------------------------------// Function: make_isoview
// Purpose: to compute the "isovist" (viewing polygon) from a given
//
point inside a set of walls.
//
// Comment: The routine begins with an expanded convex hull PG2 computed
//
from the set of wall points. This is reduced by subtracting
//
a truncated "pie piece" with the viewing point as center,
//
a wall line as truncation, sides of pie as one line from
//
each wall endpoint with a large distance away from the
//
viewing point:
//
+ xv,yv
//
/ \
//
/
\
//
/
\
//
/-------\ <- wall line
//
/
\
//
/.
.\
//
. _ . <---arc
//
//
An arc finishes the polygon.
//
//-----------------------------------------------------------------------PG2SET *Walls::make_isovist (float xv, float yv, PG2SET *perimeter, NW2SET *wall_nw2)
{ PG2SET *iso_vist=NULL, *result=NULL, *temp=NULL;;
int i, j, nl, nlmax, np, npmax, npt, id[3] = {5,1,5}, nid, nidmax, nptmax;
float tol, x1, y1, x2, y2, x3, y3, x4, y4, big, begang, endang,
xmn, ymn, zmn, xmx, ymx, zmx,
x[CPT+2], y[CPT+2];
Boolean swapped, counter, good, sw=FALSE, DEBUG=FALSE, DEBUG2=FALSE;
Boolean *skip;
FILE *fp;
wall_nw2->get_info (nl, nlmax, np, npmax);
get_box (xmn, ymn, zmn, xmx, ymx, zmx);
big = max ( (xmx-xmn), (ymx-ymn) )*1.5;
tol = get_tolerance();
skip = new int[nl];
for ( i=0; i<nl; i++ ) skip[i] = FALSE;
// Compute convex hull.
if ( !perimeter )
{ perimeter = new PG2SET;
perimeter = wall_nw2->convex_hull();
46
}
// Is view point inside hull?
if ( !perimeter->point_inside (xv, yv, tol) )
{ return NULL;
}
if ( iso_vist ) delete iso_vist;
iso_vist = new PG2SET;
*iso_vist = *perimeter;
double a1, b1, c1, a2, b2, c2;
// Allocate enough data structure.
IsoEdge *lines, ltemp;
lines = new IsoEdge[nl];
// For each occluding line – add to “lines” See figure above for variables.
for ( i=0; i<nl; i++ )
{ wall_nw2->get_line (i, x1, y1, x2, y2);
lines[i].edge.put_raw(x1, y1, x2, y2);
lines[i].dist1 = pt2_dist_ln2(xv, yv, x1, y1, x2, y2);
lines[i].angbeg = rtod(ln2_angle(xv, yv, x1, y1));
lines[i].angend = rtod(ln2_angle(xv, yv, x2, y2));
lines[i].angdif = fabs(lines[i].angbeg-lines[i].angend);
lines[i].skip
= FALSE;
}
// Sort lines.
for ( i=0; i<nl-1; i++ )
{ for ( j=i+1; j<nl; j++ )
{ if ( lines[j].dist1 < lines[i].dist2 )
{ ltemp
= lines[i];
lines[i] = lines[j];
lines[j] = ltemp;
}
}
}
// For each occluding wall. Order the angles.
for ( i=0; i<nl; i++ )
{ if ( lines[i].skip ) continue;
lines[i].edge.get_raw(x1, y1, x2, y2);
begang = rtod(ln2_angle (xv, yv, x1, y1));
endang = rtod(ln2_angle (xv, yv, x2, y2));
if ( begang == endang ) continue;
swapped = FALSE;
counter = TRUE;
if ( begang > endang )
{ swap (x1, x2);
swap (y1, y2);
swap (begang, endang);
}
if ( endang-begang > 180. ) endang -= 360.;
if ( begang > endang )
{ swap (x1, x2);
swap (y1, y2);
swap (begang, endang);
}
npt = ((abs(endang-begang)/360.)*CPT) + 1;
if ( npt <=1 ) npt = 2;
// Create arc and begin making the truncated pie piece.
if ( !ln2_arc (xv, yv, big, npt, 1, FALSE, begang, endang,
id, x, y, 3, CPT+2) ) continue;
npt = id[0];
if ( !swapped )
{ x[npt]
= x2;
y[npt]
= y2;
x[npt+1] = x1;
y[npt+1] = y1;
}
else
{ x[npt]
= x1;
47
y[npt]
= y1;
x[npt+1] = x2;
y[npt+1] = y2;
}
id[0]+=2;
id[2]+=2;
if ( temp ) delete temp;
// Create a PG2SET truncated pie piece.
temp = new PG2SET;
temp->put_raw (id, x, y);
iso_vist->get_info(nid, nidmax, npt, nptmax);
if ( nid == 0 || npt == 0 )
{ if ( DEBUG2 ) fclose(fp);
return NULL;
}
if ( result ) delete result;
result = new PG2SET;
// Subtract truncated pie piece from convex hull
result->set_operation (A_B, iso_vist, temp);
result->get_info (nid, nidmax, npt, nptmax);
if ( nid == 0 || npt == 0 ) continue;
*iso_vist = *result;
for ( j=i+1; j<nl; j++ )
{ lines[j].edge.get_raw (x3, y3, x4, y4);
if ( temp->point_inside (x3, y3, tol) &&
temp->point_inside (x4, y4, tol) )
{ lines[j].skip = TRUE;
}
}
} // End of occluding wall loop. Do a little house cleaning.
delete [] skip;
iso_vist->fix_up ("IsoVist");
return iso_vist;
}
The following C++ class is used to support the isovist function.
class IsoEdge
{ public:
Line2D edge;
float dist1, dist2;
float angbeg, angend, angdif;
Boolean skip;
};
End Note
This manual has been written as a stand-alone document for using the current Syntax2D program. It presents a
particular stage in a continuing exploration of how to move conveniently from a drawing of a space to a
consideration of the Space Syntax measures.
Many of the components of this software have been lifted directly from the description of the OmniVista
application in the paper, “Omnivista: An Application for Isovist Field and Path Analysis,” by Ruth Conroy Dalton
and Nick Dalton. When our College failed to hire a Space Syntax expert, I felt it necessary to provide to our
doctoral students 1) a useful Space Syntax tool for analyzing building data, and 2) a basis for future extensions for
their research and mine. Luckily, the Daltons elevated many of the underlying functions to the public domain and
provided common terminology, both of which I didn’t attempt to disguise.
48
Algorithms, 37
Alt-Print Screen, 13
Appendix, 35
area, 7, 37
Axial Map, 31
Bad Walls, 17
Batch Processing, 28
BatchSyntax, 28
Change Units, 16
Circularity, 41
Command Pop-Up Menu, 8
Compactness, 40
Compute, 16
Compute-Measure, 27
Concave polygon containing a hole, 24
concave spaces, 23
Connectivity, 42
Dispersion, 41
Display, 32
Display Menu, 32
Drift, 41
dxf, 5, 9
Edit, 14
Exit, 13
Export, 12
File, 8
File Format
Grid Data, 37
Network, 36
Path Data, 37
Syntax File, 36
Fix Walls, 31
Grid Data, 12
Import, 9
Inclusivity, 40
Integration, 42
Isovist, 18, 19
Isovist Animate, 19
Isovist polygons, 5
Isovist Polygons, 42
Justified Graph, 28
Justified-Graph, 29, 30, 31
Layer Attributes dialog, 9, 11
Layers, 14
Maximum Radial, 40
Mean Depth, 29
Mean Radial, 40
Measurement, 28
Median Radial, 40
Mesh, 27
Minimum Radial, 40
Mouse Options, 35
Non-Regular Grid, 27
nw2, 6, 12
Occlusivity, 38
Omnivista, 46
Open, 6, 8
Opening naming Dialog, 35
Opening Tolerance Dialog, 17
Openings, 14, 17
Pan, 34
Path, 24
Path points, 26
Perimeter, 18, 38
Pop-Up Menus, 35
Preferences, 15
Preferences Dialog, 15
Print, 13
Radial approximations, 19
Radial Moment, 41
Regular Grid, 27
Regular Grids, 7
Save, 9
Save As, 9
Select Path Dialog, 26
Show Measures, 19
Single Point Isovist, 18
Single Space Subdivision, 24
Skewness, 41
Space naming Dialog, 35
Spaces, 14, 16
Standard Deviation, 41
Subdivision, 21
Subdivision Options, 22
Variance, 41
View, 32
View Menu, 32
Viewport, 33
Viewport Palette, 33
Walls, 14
Zoom In, 33
Zoom In Step, 33
Zoom Out, 33
Zoom Out Step, 33
Zoom Previous, 33
49
List of Figures
Figure 1“House1” – a Sample Floor Plan....................................................................................................... 5
Figure 2 – Syntax2D ....................................................................................................................................... 5
Figure 3 - Previously prepared syntax file (*.sx2) loaded and ready to be run. .............................................. 6
Figure 4 – House1.sx2 syntax problem shown with regular grids .................................................................. 7
Figure 5 – Image showing relative area values............................................................................................... 7
Figure 6 –File menu........................................................................................................................................ 8
Figure 7 - Common File dialog for opening a syntax file............................................................................... 8
Figure 8– Double Line DXF Option..............................................................................................................11
Figure 9– Single Line DXF Option ...............................................................................................................12
Figure 10 – Common File dialog to import a DXF file .................................................................................12
Figure 11 - Importing DXF: Two examples of the Layer Attributes dialog ..................................................13
Figure 12 - Right figure shows space polyline tracing rough opening ..........................................................13
Figure 13 - Importing DXF: Set Units dialog ................................................................................................14
Figure 14– Export Isovist Measurements Dialog ..........................................................................................15
Figure 15 - Edit menu ....................................................................................................................................16
Figure 16 – Preferences Dialog .....................................................................................................................17
Figure 17 - "Set Units" dialog showing conversion from Feet to Inches .......................................................18
Figure 18 - Compute menu ............................................................................................................................18
Figure 19 – View-Bad Walls .........................................................................................................................19
Figure 20 – Opening Tolerance Dialog .........................................................................................................19
Figure 21 – Automatic Generation of opening lines ......................................................................................19
Figure 22 – Single opening line case. ............................................................................................................20
Figure 23 – Single Point Isovist ....................................................................................................................20
Figure 24 - Dialog for entering exact point coordinates. ...............................................................................21
Figure 25– Single Point Isovist – Radial Lines .............................................................................................21
Figure 27 - Points to be read from file dialog ................................................................................................22
Figure 28 - Common file dailog ....................................................................................................................23
Figure 29 – Intersection of two Isovists ........................................................................................................24
Figure 30 – Samples of four subdivision settings: Perp/Short, Perp/Long, Node/Short, Node/Long. ...........24
Figure 31 – Subdivision Options. I’m not sure what “Default” does. ...........................................................25
Figure 32 – Various concave point resolutions. ............................................................................................25
Figure 33 – Subdivided spaces. This is a conversion of all concave spaces into convex spaces. ..................25
Figure 34 – A better first solution would generate two convex polygons and terminate. .............................26
Figure 35 – Example showing shortest perpendicular lines. .........................................................................26
Figure 36 – Concave polygon containing a hole ...........................................................................................26
50
Figure 37 – Single Space Subdivision dialog and submenu. .........................................................................27
Figure 38 – Syntax2D model with three paths (before clipping) ...................................................................27
Figure 39 – Select Path Dialog ......................................................................................................................27
Figure 40 - Path Isovist data written to a file .................................................................................................28
Figure 41 – Path points ..................................................................................................................................28
Figure 42 – Single isovist at each path point .................................................................................................28
Figure 43– Cumulative isovists along same path ..........................................................................................29
Figure 44– Non-Regular Grid........................................................................................................................29
Figure 45 – Regular Grid ...............................................................................................................................30
Figure 46 – Sample batch file ........................................................................................................................30
Figure 47 – Batch Syntax program running ..................................................................................................31
Figure 48 – Permeable Graph ........................................................................................................................31
Figure 49 – Mean Depth and Relative Symmetry .........................................................................................32
Figure 50 - Root chosen outside all rooms ....................................................................................................32
Figure 51 - Before and after concave subdivision. ........................................................................................32
Figure 52 - After Compute/Justified-Graph/Convex command.....................................................................33
Figure 53 - J-Graph - "All spaces" option .....................................................................................................34
Figure 54 - Display Menu..............................................................................................................................34
Figure 55 –View Menu ..................................................................................................................................35
Figure 56 - Viewport Palette .........................................................................................................................35
Figure 57 - Space naming Dialog ..................................................................................................................37
Figure 58 – Opening naming Dialog .............................................................................................................37
Figure 59 - Command menu ..........................................................................................................................37
Figure 60 – Interactive isovist creation with measures shown ......................................................................39
Figure 61 - Occlusivity ..................................................................................................................................41
Figure 62 - Inclusivity ...................................................................................................................................42
Figure 63 – Radial isovist ..............................................................................................................................42
Figure 64 - Occluding perimeter and interior walls .......................................................................................44
Figure 65 - Variables used in isovist calculation ...........................................................................................45
Figure 66 - Truncated Pie Piece using perimeter wall. All perimeter pie pieces. ..........................................45
Figure 67- Interior walls subtracted from isovist polygon.............................................................................46
51
Download