• No results found

of a floor plan graphGf is a connected componentGm of the graph Gf, i.e. all nodes and edges which can be reached from a given start

nodem∈Nf. All regions bounded exclusively by edges inGm are

calledregions in the meshGm (see the example in Fig.29).

Regions in Mesh 1:

boundary

exterior boundary Mesh 2:

Mesh 3:

Figure29: Exemplary Floor Plan with Regions in Different Meshes

Definition 5.3.3 (Polygon(Computational Geometry)). A polygon P :=C1,C2, ..,Cz>3 in the sense of Computational Geometry is a se- quential list ofdistinctcornersCi∈1..z= (xi,yi)8 where neighbouring

corners are connected via boundary lines. Moreover, the tail Cz is

linked to the head C1. All corners are ordered counter-clockwise (ccw). Two conditions are crucial for polygons:

1. no cornerCi may appear repeatedly in the list (i.e. two bound- ary lines may not touch each other, except if they are neigh- boured),

2. no pair of boundary linesCiCi+1 andCjCj+1 (withi6=j) may cross each other, i.e. there may not be any intersection points

Cx:=CiCi+1 ∩CjCj+1 outside the list of corners.

Polygons correspond to elementary cycles in the floor plan graph. These are all minimum cycles which do not contain any other cycle.

The principal idea is to traverse the planar floor plan with a simple

graph search algorithm and determine these minimum cycles. The algorithm can proceed in a mesh from one region to another via their shared boundary (an edge in the floor plan graph). To determineall regions, one just needs to make sure that every edge is visited exactly

twice (in possibly opposite directions), for two different cycles/re- gions.

Despite the fact that edges in the floor plan graph are undirected, a traversal by a graph algorithm does naturally impose an order on the edges. We therefore distinguish between two conceptually different notions:

• anundirectededgeef =ABin a floor plan graph, 8 indices are calculatedmoduloz

• twodirected traversals (visits) of the edge, represented by the vectors→e−1 =−→AB,e−→2 =−→BA(they correspond to theorderedlist of pointsA,BrespectivelyB,A).

We refer to the latter also asdirected edge, in contrast to the undi- rected counterpart in a floor plan graph. An apt concatenation of these directed edges should result in the polygons which correspond to the minimal regions.

b a s i c a l g o r i t h m. In planar floor plan graphs regions are not

explicitlyrepresented. Nonetheless, a surrounding set of edges pos- itively defines a region. An algorithm is therefore needed which automatically determines all regions enclosed in a floor plan. Poly- gons are an ideal representation for these regions because they are the basic data structure used in Computational Geometry. The purpose

of the following algorithm is to obtain a set of polygons for a given

floor plan graph:

Generally, when we start going through the floor plan graph from any directed edge−→AB, there are several adjoining edgesBC1, ..,BCn∈Ef

(withCi6= A) where we can continue. We have to decide which of

these edges is the next in the counter-clockwise order of the currently constructed polygon.9

The special case where no consecutive edge

BCiexists (i.e. nodeBbeing a dead end in the floor plan graph) can of course also occur. This problem is deferred for the moment, since it complicates understanding the basic idea of the algorithm. It is covered along with other special cases in the next section.

The strategy for choosing the next directed edge−−→BCialong the poly- gon’s boundary is a core component in the processing of a floor plan graph, yet very simple. It is sketched in Fig.30:

φ1

inside

outside

(current edge, oriented ccw)

φ2 φ3 min A B C1 C2 C3

Figure30: Strategy for Choosing the Next Boundary Line Assuming we are currently at the directed edge−→AB, the pointCion

the next directed edge−−→BCiis part of the polygon iff we chooseBCi

9 the order of the polygon is only counter-clockwise if the first edge is also oriented in this direction. However, this condition can be ensured quite easily (see below).

5.3 m o d e l l i n g a s p e c t s a n d c o n s t r u c t i o n o f t h e h i e r a r c h y

such that the angle ϕi =](ABCi)(enclosed between

−→

ABand −−→BCi)

is minimal. In Fig.30, the minimum angle is depicted by the green

sectors.

The intuition is to find the leftmost point Ci as defined in Com- putational Geometry (theinteriorof a polygon is normally to the left of a counter-clockwise oriented edge−−→BCion the polygon’s boundary). By selecting the minimum angle we ensure that the respective edge

BCiforms a minimum cycle inGf in the sense that no other region

is enclosed: if we took another pointCjinstead, we would not obtain

theminimumregion (in some cases not even a polygon at all) because the edgeBCiwould be enclosed in it. However, by definition an edge separates exactly two regions.

Instead of using trigonometric functions – which are quite expensive

in terms of computation – there is a much simpler and elegant solu-

tion without actually calculating the angle. We can resort to means of Computational Geometry (see Alg.1):