CSM 131 Chapter 5 to Chapter 7-الهندسة PDF
CSM 131 Chapter 5 to Chapter 7-الهندسة PDF
“report all employees born between 1950 and 1955 who earn
between $3,000 and $4,000 a month and have between two
and four children”?
To answer the query we now have to report all points inside the
axisparallel box [19,500,000 : 19,559,999]×[3,000 :
4,000]×[2:4].
A query in 3 dimensions
The geometric approach
VORONOI DIAGRAMS
Objectives
pi : site points
e : Voronoi edge
v : Voronoi vertex
v
pi e
Definition of Voronoi Diagram
Segment v
pi : site points
e : Voronoi edge
v : Voronoi vertex v
pi e
Voronoi Properties
v
pi e
Drawing Voronoi diagram
(1) The input points, step one, are called sites, labeled
here A, B, C, etc.
Drawing Voronoi diagram
(2) The next step is to connect the sites to all of their nearest
neighbors without making a line that crosses another.
This is known technically as the Delauney Triangulation.
Drawing Voronoi diagram
(4) The fourth step is to draw the perpendicular bisector for each
Delauney line.
This is where careful accuracy, in finding the centerpoints, and in
drawing a tight 90 degree angle, pays off. If everything has been
done correctly, there will always be three lines converging at a
point, unless the input sites are on a perfectly regular rectangular
grid
Drawing Voronoi diagram
(5) The fifth step is to retrace the outline of each Voronoi cell
from the perpendicular bisectors.
Drawing Voronoi diagram
Chapter 7
1
VISIBILITY GRAPHS
1/29/2022
We would like to find a good path, rather than any
feasible path as done in motion planning.
Shortest path is usually good, but not necessarily the
best. Number of turns is important, speed is important,
etc.
Roadmap
construction
Find shortest
path in roadmap
Shortest path
Pgoal
Pstart Shortest path
of roadmap
6 1/29/2022
void ShortestPath ( S, pstart , pgoal ) {
Gvis VisibilityGraph ( S p start , pgoal ) ;
Assign weight to each eu, v Gvis ; // Euclidean length uv
Find shortest path from pstart to pgoal with Dijkstra's algorithm ;
}
With n polygonal objects and O(n) nodes, naïve
computation of Gvis would take O(n3) time.
7 1/29/2022
Computing the Visibility Graph
graph VisibilityGraph ( S ) {
Initialize GV, E, V is all vertices of S, E ;
u V {
W VisibleVertices(u, S) ;
v W { add eu, v to E }
} return GV, E ; }
Checking the visibility between two vertices, not much
can be done. All objects must be tested for intersection,
taking O(n) time. By ordering the vertices it is possible
to accelerate tests by using info obtained in previous
tests.
8 1/29/2022
Scanning Ray – Rotational Planar
4
Sweep
5
3
1 6
p
7
14
9
13
10
12 11
9 1/29/2022
points VisibleVertices ( p, S ) {
1. Sort vertices of S clockwise w.r.t p. In case of
tie closer precedes farther. Let w1, , wn be the
points ;
2. Construct balanced search tree T storing edge
intersections with scanning ray ; Initialize T ;
W ; // initialize visible points
for ( i 1 to n ) { // traverse all points
if Visible (p, wi ) { W W wi } // visibility test
add / delete to / from T edges starting / ending at wi .
} return W ; }
10 1/29/2022
p p
wi1 wi1
wi wi
p wi is visible p wi is not
wi1 wivisible
1
wi wi
11 1/29/2022
boolean Visible ( p, wi )
if ( pwi intersects wi's object, locally at wi ) {return false}
// ordinary hiding test
else if (( i 1 ) || ( wi1 is not on pwi )) {
find in T the leftmost edge e ;
if ((e exists) && pwi (intersects e)) {return false}
else {return true}
}
// colinear p, wi1, wi
else if (wi1 is not visible) {return false}
else {
find in T edge e intersecting wi1wi ;
if (e exists) {return false}
else {return true}}}
12 1/29/2022
Chapter 6
VORONOI DIAGRAMS
Objectives
pi : site points
e : Voronoi edge
v : Voronoi vertex
v
pi e
Definition of Voronoi Diagram
Segment v
pi : site points
e : Voronoi edge
v : Voronoi vertex v
pi e
Voronoi Properties
v
pi e
Drawing Voronoi diagram
(1) The input points, step one, are called sites, labeled
here A, B, C, etc.
Drawing Voronoi diagram
(2) The next step is to connect the sites to all of their nearest
neighbors without making a line that crosses another.
This is known technically as the Delauney Triangulation.
Drawing Voronoi diagram
(4) The fourth step is to draw the perpendicular bisector for each
Delauney line.
This is where careful accuracy, in finding the centerpoints, and in
drawing a tight 90 degree angle, pays off. If everything has been
done correctly, there will always be three lines converging at a
point, unless the input sites are on a perfectly regular rectangular
grid
Drawing Voronoi diagram
(5) The fifth step is to retrace the outline of each Voronoi cell
from the perpendicular bisectors.
Drawing Voronoi diagram