Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computational Geometry 2

Similar presentations


Presentation on theme: "Computational Geometry 2"— Presentation transcript:

1 Computational Geometry 2
Paku Daichi

2 Last Lecture Map overlay of networks (line segments)

3 Last Lecture Problem: Find intersections of line segments
Input: a set of segments Output: all intersections of S

4 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments sweep

5 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

6 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

7 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

8 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

9 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

10 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure Switch

11 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

12 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

13 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

14 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

15 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

16 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

17 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

18 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

19 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

20 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

21 Last Lecture Output sensitive algorithm in time
Idea: Checking only near segments Status structure

22 Today: Planar Subdivision
Types of forest in Canada

23 Today’s problem Overlay of two planar subdivisions

24 How represent planar subdivisions?
Collection of line segments? No. It’s difficult. We need structural information

25 How represent planar subdivisions?
Planar embeddings of graphs Vertices, edges, faces Requirements Get face’s boundary f3’s boundary? Get incident egdes v1’s edges? ⇒ Doubly-connected edge list

26 Doubly-connected edge list
Idea Bidirectional edge (left-hand traffic)

27 Doubly-connected edge list
Idea Bidirectional edge (left-hand traffic)

28 Doubly-connected edge list
Vertex Coordinates IncidentEdge v1 (2, 3) e1,2 v2 (0, 3) e1,1 v3 (0, 1) e3,2 v4 (2, 0) =e4,2 Example Face OuterComponent InnerComponent f1 nil e1,1 f2 e1,2 Edge Origin Twin IncidentFace Next Prev e1,1 v2 e1,2 f1 e2,1 e3,2 v1 f2 e3,1 e2,2 e4,1 v3 e4,2 v4

29 Doubly-connected edge list
Vertex Coordinates IncidentEdge v1 (2, 3) e1,2 v2 (0, 3) e1,1 v3 (0, 1) e3,2 v4 (2, 0) =e4,2 Example Face OuterComponent InnerComponent f1 nil e1,1 f2 e1,2 Edge Origin Twin IncidentFace Next Prev e1,1 v2 e1,2 f1 e2,1 e3,2 v1 f2 e3,1 e2,2 e4,1 v3 e4,2 v4

30 Doubly-connected edge list
Vertex Coordinates IncidentEdge v1 (2, 3) e1,2 v2 (0, 3) e1,1 v3 (0, 1) e3,2 v4 (2, 0) =e4,2 Example Face OuterComponent InnerComponent f1 nil e1,1 f2 e1,2 Edge Origin Twin IncidentFace Next Prev e1,1 v2 e1,2 f1 e2,1 e3,2 v1 f2 e3,1 e2,2 e4,1 v3 e4,2 v4 f2’s boundary?

31 Doubly-connected edge list
Vertex Coordinates IncidentEdge v1 (2, 3) e1,2 v2 (0, 3) e1,1 v3 (0, 1) e3,2 v4 (2, 0) =e4,2 Example Face OuterComponent InnerComponent f1 nil e1,1 f2 e1,2 Edge Origin Twin IncidentFace Next Prev e1,1 v2 e1,2 f1 e2,1 e3,2 v1 f2 e3,1 e2,2 e4,1 v3 e4,2 v4 v3’s edges?

32 Doubly-connected edge list
Note1: Inner component is list Faces OuterComponent InnerComponent f1 nil e1,1 f2 e2,1 {e3, e4, e5}

33 Doubly-connected edge list
Note2: We have attribute information Faces OuterComponent InnerComponent Attributes f1 nil e1,1 “pine” f2 e2,1 {e3, e4, e5} “deciduous”

34 Doubly-connected edge list
How much storage is needed? n : complexity = #(edges) + #(vertices) + #(faces) Faces OuterComponent InnerComponent f1 nil e1,1 f2 e2,1 {e3, e4, e5} For each edges, pointed at most once

35 Now, Problem Input: two subdivisions
Output: overlay of two subdivision (Doubly-connected edge list)

36 Outline of algorithm Step1: Copy records into new one Vertex Coord… v1
Edge Origin… Edge Origin… Edge Origin… Edge Origin…

37 Outline of algorithm Step1: Copy records into new one
Step2: Make correct DCEL by sweep algorithm sweep Vertex Coord… v1 Vertex Coord… Edge Origin… Edge Origin…

38 Outline of algorithm Step1: Copy records into new one
Step2: Make correct DCEL by sweep algorithm Vertex Coord… Edge Origin… Done

39 Outline of algorithm Step1: Copy records into new one
Step2: Make correct DCEL by sweep algorithm Step3: Make face records with old records Vertex Coord… Edge Origin… structure Old Face Records Face Outer… Face Face attributes

40 Step1: Copy records Just copy records. In time. Vertex Coord… v1
Edge Origin… Edge Origin… Edge Origin… Edge Origin…

41 Step2: Sweep Based on the line segment intersection algorithm
We use balanced binary search tree , Find intersections between edges and edges But now… we have to modify the records correctly. Vertex Coord… v1 Edge Origin… Vertex Coord… Edge Origin…

42 Step2: Sweep Modify the records correctly during sweeping Cross-point
Case1 Case2 Case3 Vertex, Edge Edge, Edge Vertex, Vertex

43 Step2: Sweep modify the records correctly during sweeping Case1 Vertex
Coordinates IncidentEdge v (x, y) e2,1 Edge Origin Twin IncidentFace Next Prev e1,1 v2 e1,2 / ea eb v3 ec ed e2,1 e2,2 e3,1 e3,2 e4,1 e4,2

44 Step2: Sweep modify the records correctly during sweeping Case1 Vertex
Coordinates IncidentEdge v (x, y) e2,1 Edge Origin Twin IncidentFace Next Prev e1,1 v2 e1,2 / ea eb v3 ec ed e’1,1 v e’1,2 e2,1 e2,2 e3,1 e3,2 e4,1 e4,2

45 Step2: Sweep modify the records correctly during sweeping Case1 Vertex
Coordinates IncidentEdge v (x, y) e2,1 Edge Origin Twin IncidentFace Next Prev e1,1 v2 e’1,2 / ea eb e1,2 v3 e’1,1 ec ed v e2,1 e2,2 e3,1 e3,2 e4,1 e4,2

46 Step2: Sweep modify the records correctly during sweeping Case1 Vertex
Coordinates IncidentEdge v (x, y) e2,1 Edge Origin Twin IncidentFace Next Prev e1,1 v2 e’1,2 / ea eb e1,2 v3 e’1,1 ec ed v e2,1 e2,2 e3,1 e3,2 e4,1 e4,2

47 Step2: Sweep modify the records correctly during sweeping Case1
Vertex Coordinates IncidentEdge v (x, y) e2,1 Edge Origin Twin IncidentFace Next Prev e1,1 v2 e’1,2 / ea eb e1,2 v3 e’1,1 ec ed v e2,1 e2,2 e3,1 e3,2 e4,1 e4,2 Search the e1,1~e’1,2 location In time. m: degree of vertex

48 Step2: Sweep Each case: in time Case1 Case2 Case3 Vertex, Edge
Edge, Edge Vertex, Vertex

49 Step2: Sweep Each case: in time Step2 is in time
Find intersection algorithm : Complexity of S1 : Complexity of S2 : Complexity of Output

50 Step3: Make face records
How we make face records? One face has one outer boundary cycle Face OuterComponent InnerComponent f1

51 Step3: Make face records
How we make face records? One face has one outer boundary cycle Counter clockwise cycle Inner boundary cycle Clockwise cycle

52 Step3: Make face records
How we make face records? One face has one outer boundary cycle Counter clockwise cycle leftmost vertex’s left-side angle is counter clockwise is clockwise

53 Step3: Make face records
How we make face records? Subdivision and the corresponding graph leftmost vertex’s left edge ⇒ by sweeping (Step2)

54 Step3: Make face records
How we make face records? Subdivision and the corresponding graph Face OuterComponent InnerComponent f1 nil e1 f2 e2 {e3, e6} f3 e4 f4 e5 f5 e7 Each connected components by simple DFS Attributes?

55 Step3: Make face records
Attributes?: Case1 Look at f ’s any vertex v, and v is cross-point of edges Original subdivisions IncidentFace of e1,e2 Face OuterComponent InnerComponent attribute f

56 Step3: Make face records
Attributes?: Case2 Look at f ’s any vertex v, and v is not cross-point Original subdivisions IncidentFace of v ‘s immediately left edge ⇒ by sweeping (Step2)

57 Theorem 2.6 Step1: Copy record Step2: Sweep algorithm
in time Step2: Sweep algorithm in time Step3: Make face records Calculate all cycles in time

58 Applications Boolean Operations for polygons, In time


Download ppt "Computational Geometry 2"

Similar presentations


Ads by Google