HAL Id: inria-00480045
https://hal.inria.fr/inria-00480045
Submitted on 3 May 2010
HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.
Constructing the Exact Voronoi Diagram of Arbitrary Lines in Space
Michael Hemmer, Ophir Setter, Dan Halperin
To cite this version:
Michael Hemmer, Ophir Setter, Dan Halperin. Constructing the Exact Voronoi Diagram of Arbitrary
Lines in Space. [Research Report] RR-7273, INRIA. 2010, pp.19. �inria-00480045�
a p p o r t
d e r e c h e r c h e
0 2 4 9 -6 3 9 9 IS R N IN R IA /R R -- 7 2 7 3 -- F R + E N G
Algorithms, Certification, and Cryptography
Constructing the Exact Voronoi Diagram of Arbitrary Lines in Space
with Fast Point-Location
Michael Hemmer — Ophir Setter — Dan Halperin
N° 7273
May 2010
Centre de recherche INRIA Sophia Antipolis – Méditerranée 2004, route des Lucioles, BP 93, 06902 Sophia Antipolis Cedex
with FastPoint-Loation
Mihael Hemmer
∗
, Ophir Setter
†
,Dan Halperin
†
Theme: Algorithms,Certiation,andCryptography
Algorithmis,Programming,SoftwareandArhiteture
Équipes-ProjetsGeometria
Rapportdereherhe n° 7273May201016pages
Abstrat: We introdue a new, eient, and omplete algorithm, and its
exatimplementation,to omputetheVoronoidiagram oflinesin spae. This
is a major milestonetowardsthe robust onstrution of the Voronoi diagram
of polyhedra. As we follow the exat geometri-omputation paradigm, it is
guaranteed that we always ompute the mathematially orret result. The
algorithmisompletein thesense thatitanhandleallongurations,inpar-
tiular all degenerate ones. The algorithm requires
O(n 3+ε )
time and spae,where
n
isthenumberoflines. TheVoronoidiagram isrepresentedbyadata struture that permits answering point-loation queriesinO(log 2 n)
expetedtime. The implementation employs the Cgal pakages for onstruting ar-
rangementsandlowerenvelopesonparametrisurfaestogetherwithadvaned
algebraitools. Supplementarymaterialandinpartiulartheprototypialode
of our implementation anbe found in the website: http://ag.s.tau.a.
il/projets/internal-projets/3d-lines-vor/projet- page.
Key-words: VoronoiDiagram,PointLoation,LowerEnvelope,ExatGeo-
metriComputing,CGAL
ThisworkhasbeensupportedinpartbytheIsraelSieneFoundation(grantno.236/06),
by the German-Israeli Foundation (grant no. 969/07), and by the Hermann Minkowski
MinervaCenterforGeometryatTelAvivUniversity.
∗
Geometria,INRIASophiaAntipolis,Frane;Mihael.Hemmersophia.inria.fr
†
ShoolofComputerSiene,Tel-AvivUniversity,Israel;[ophirset,danha℄post.tau.a.il
droites quelonques dans l'espae
ave loalisation eae
Résumé: Nousprésentonsunnouvelalgorithmeeaeetomplet,ainsique
sonimplantationexate,pouralulerlediagrammedeVoronoïdedroitesdans
l'espae. C'est une étape majeureverslaonstrution robuste du diagramme
deVoronoïdepolyèdres. Noussuivonslemodèledualul géométriqueexat,
il est dongaranti quenous alulons toujours le résultat mathématiquement
orret. L'algorithmeestompletenesensqu'ilpeuttraitertouteslesong-
urations, enpartiuliertous lesas dégénérés. L'algorithmea une omplexité
O(n 3+ε )
entempsetenespae,oùn
estlenombrededroites. LediagrammedeVoronoïestreprésentéparunestruturededonnéespermettantderépondreaux
requêtesde loalisationsdepointsave uneomplexité moyenneen
O(log 2 n)
.L'implantation utilise les modules CGAL de onstrution d'arrangements et
d'enveloppesinférieures surdes surfaesparamétriques ainsiquedes outilsal-
gébriques avanés. Lematériel supplémentaireet en partiulierle ode proto-
type de notre implantation peuvent être trouvés sur lesite: http://ag.s.
tau.a.il/projets/internal-projets/3d-lines-vor/projet- page.
Mots-lés : DiagrammedeVoronoï,Loalisation,EnveloppeInférieure,Cal-
ulGéométriqueExat,CGAL
1 Introdution
TheVoronoidiagram(
VD
)isamongthemostfundamentalstruturesinCom- putational Geometry,andisknowntobeausefultoolin avarietyof domains.Forinstane,struturalbiology[24,35℄androbotmotionplaning[19,34℄apply
Voronoi diagrams to enode point sets keepingmaximal distane from atoms
or obstales, respetively. A related onept is the medial-axis transform [6℄,
whih is onsidered fundamental in solid modeling and applied to problems
suhasnite elementmeshing, shapemorphing,andfeature reognition. Yet,
theadaptation ofomplexthree-dimensional Voronoidiagrams in professional
tools has been very slow. Their use is hindered by the diulty of design-
ing and implementing reliablegeometri algorithms for omplexstrutures in
three-dimensionalspae.
Voronoidiagramshavebeenthesubjetofatremendousamountofresearh.
WereferthereadertothesurveybyAurenhammerandKlein[2℄ofworkpub-
lisheduptill2000. Voronoidiagramsin
R 2
arewellunderstoodinalmostallas-pets,thatis,intermsofomplexityandoptimalalgorithmsaswellasinterms
ofrobustandeientimplementations. In
R 3
muhlessisknown,evenforsim-ple objetssuh aslines, segments, orpolyhedra. Forexample, atight bound
on the ombinatorial omplexity of the
VD
ofn
lines or line segments inR 3
isunknown; itis onjeturedthattheomplexityisnear-quadrati;theknown
lower bound is
Ω(n 2 )
[1℄, but the best known upper bound is1O(n 3+ǫ )
[31℄.Intheaseoflineswith axednumber
c
oforientationstheupperbound was improvedtoO(c 4 n 2+ε )
[25℄. A omplete analysis ofall possibleombinatorial asesforthree arbitrarylines ispresentedbyEverettetal.[17,18℄.Today,therearemanypublishedresultsonrobustonstrutionsofdierent
typesofVoronoidiagramsin
R 2
. NotonlyVoronoidiagramsofpointsareon-sidered,butalsoVoronoidiagramsoflinesegments[22℄,irles[15℄,ellipses[16℄,
and more [8, 2℄. In
R 3
, an exat implementation of the Voronoi diagram of additively-weightedpointswasanalyzedin[7℄,butwearenotawareofanyex-at, omplete,and implementedalgorithm that omputesVoronoidiagrams of
lines,linesegments,orpolyhedra. Nevertheless,progresshasbeenmadetoward
theexatomputationofthearrangementofquadris[5,13℄. EahVoronoiell
ofthediagramoflinesinspaeanberepresentedastheunionofellsofsuh
an arrangement. Other approahesexpliitlyaim foran exatorrobustom-
putationof theVoronoidiagram (or themedial axis)[10,26℄. However,those
approahes are not omplete. For example, Culver'salgorithm [10℄ does not
handlesingulartrisetor-urves.
Finally, Hanniel and Elber [20℄ provided an algorithm to onstrut the
Voronoi ell of bounded planes, spheres, and ylinders in
R 3
. Though it isin some aspets similar to ours, the approah is approximate, does not deal
withdegeneraies,andleavesrobustnessissuesaside.
Wepresentanexatandomplete(andthusrobust)algorithmforomputing
theVoronoidiagram ofarbitrarylines in threedimensionswith respetto the
Eulidean metri. The algorithmrequires
O(n 3+ε )
time andspae, wheren
isthenumberofinputlines. Thedatastrutureadmitsansweringofpoint-loation
queriesin
O(log 2 n)
time. Weantiipate thatthe natureof thealgorithm and1
Aboundoftheform
O(f(n) · n ε )
meansthattheatualupperboundisC ε f(n) · n ε
,forany
ε > 0
,whereC ε
isaonstantthatdependsonε
,andgenerallytendstoinnityasε
goesto
0
.thegeneralapproahofitsimplementationonstituteamajormilestonetowards
anexatandrobustonstrutionoftheVoronoidiagramofpolyhedrain
R 3
.Weutilizethe fatthat in Eulidean spae theVoronoiellanbeonsid-
eredasalowerenvelopesinetheellessentiallyhasaertainstarshapedness
property: Foranypoint
p
insidetheVoronoiellofaspeilinesiteℓ
,thelinesegment onneting
p
to itsprojetionp ℓ
ontoℓ
,is fully ontainedin theell.ThisobservationenablesustorepresenttheVoronoiellof
ℓ
asaminimization diagram,whihis(oneptually)embeddedonaninnitesimallysmallylinderaround
ℓ
. Thisobservationissimilar to (butnotthesameas) thewell-known onnetionbetweenVoronoi diagramsand lowerenvelopes[14℄. Lowerdimen-sionalellsarerepresentedseveraltimes,namelyaspartoftheboundaryofthe
VC
ofeahline theyare assoiatedwith. Theimplementationisdevelopedin andbasedonCgal,ComputationalGeometryAlgorithmsLibrary.2
Thepaperisorganizedasfollows. Setion2disussespreliminarysubjets,
suh as properties of bisetors and trisetors of lines in spae and the lower
envelope algorithm. Setion 3 desribes the details of the onstrution of a
Voronoiell. Setion 4disussesthepointloationalgorithm anditsanalysis.
Setion 5gives implementation details and presentspreliminary experimental
resultsthatwereobtainedwithoursoftware.
2 Preliminaries
Let
O = { s 1 , s 2 , . . . , s n }
be a set of objets inR d
, also referred to as sites.We follow the Voronoidiagram denition by Everett et al. [18℄: TheVoronoi
diagram
VD( O )
is the subdivision ofR d
into ells, where eah ellVC (S)
isassoiated with a subset
S ⊆ O
, suh that every point inVC(S)
is stritlyloser to all sites in
S
than to all other sites inO
and is equidistant from all sitesinS
. Theformaldenition is:VC(S) =
p ∈ R d
∀ s ∈ S, t ∈ O \ S : d(p, s) < d(p, t)
∀ s, t ∈ S : d(p, s) = d(p, t)
In theontextof this paper,
O
denotesa set of arbitraryrational lines inR 3
and
d( · , · )
denotestheEulideandistanefuntion. Thesetofpointsthat isofequaldistanetotwoorthreesitesisalledabisetorortrisetor,respetively.
where
d( · , · )
denotes theEulidean distanefuntion. Whentheardinallyof
S
istwoorthreeitisalledbisetorortrisetor, respetively.2.1 Properties of Bisetors and Trisetors
WenextstatesomepropertiesofbisetorsandtrisetorsoftheVoronoidiagram
oflinesin
R 3
thatareusedthroughoutthispaper. Proposition1givesproperties ofbisetors;seeFigure1forillustrations.Proposition1 The bisetorof twolines
ℓ 1
andℓ 2
in three-dimensional spae iseither(a)ahyperboliparaboloid(asurfaeofalgebraidegree2),ifℓ 1
andℓ 2
areskew,(b)aplane,if
ℓ 1
andℓ 2
areparallel,or()apairoforthogonalplanes,if
ℓ 1
andℓ 2
areonurrent. In the latterase, the singularlousof thebisetor2
www. gal. org
(a) (b) ()
Figure1: Bisetorof:(a)twogenerilines;(b)twoparallellines;()twointersetinglines.
Thediagramswerereatedwithourimplementation(seeSetion5),and werelippedbya
sphereforonveniene.
isalinethat isperpendiular to
ℓ 1
andℓ 2
andpassesthrough theirintersetion point.Themain theoremofEverettetal. [17,18℄providesagoodoverviewofthe
dierentasesofthetrisetor:
Theorem2 (Everett etal.) The trisetor of three lines is either (i) a non-
singular quarti, if the three lines are pairwise skew but not all parallel to a
ommonplanenoronthe surfaeofahyperboloidofrevolution,(ii)aubiand
a line that do not interset, if the three lines are pairwise skewand lie on the
surfaeofahyperboloid ofrevolution,(iii)anodalquarti,if thethreelinesare
pairwiseskewandallparalleltoaommonplane,(iv)oneparabolaorhyperbola,
ifthereisexatlyonepairofoplanarlineswhihareparallel,(v)twoparabolas
or hyperbolas that interset, if there is exatly one pair of oplanar lines that
interset, (vi) between 0 and 4 lines, if there are two pairs of oplanar lines,
or (vii) one line, in the ase of three oplanar onurrent lines, the ommon
singularlousof the bisetors.
WeuseaorollaryoftheabovetheoreminSetion3,wherewedesribethe
onstrutionofaVoronoiellin thediagramoflines.
2.2 Lower Envelope Algorithm
Again, we regardeah three-dimensional
VC
asalowerenvelopewith respettoitslinesite
ℓ 0
. Thisloverenvelopeisrepresentedasaminimization diagram whihisoneptuallyembeddedinin theuv
-parameterspaeofthesurfaeofaninnitesimallysmallylinderaround
ℓ 0
.3 Weutilizethedivide-and-onquer algorithmforonstrutinglowerenvelopes[1℄asitisimplementedinCgal[32,8.5℄,whihwebrieydesribenext.
Sinethealgorithmprojetsbisetorsintotheparameterspae,allbisetors
are initiallysplit upinto
uv
-monotonesurfaes. Thealgorithm thensplits theresultingset
G
intotwosubsetsG 1
andG 2
ofroughlyequalsize,andreursivelyomputestheir minimization diagrams
M 1
andM 2
. Inthe onquerstep, thetwodiagrams are mergedinto one. First,the overlayof
M 1
andM 2
is om-puted, whereeahfeatureislabeledwithuptotwosets oflabels
L 1
andL 2
ofandidatesurfaes frombothdiagrams. Thereafter,thearrangementis further
renedsuhthat eahfeatureaneitherbelabeledwith
L 1
,L 2
,orL 1 ∪ L 2
. In3
SeeSetion3fordetailsonthe
uv
-parameterspaesetting.partiular, eahfae that is labeled withtwobisetorsis rened by theorre-
spondingprojetedtrisetorurve. Notethatthis stepanalsosplitupedges.
After theomparison of bisetorsthealgorithm removesredundantedges and
verties,whihyieldsthenaldiagram. Theomplexityoftheabovealgorithm
is
O(n 2+ε )
,withtheonditionthatthebisetorsurfaesarewell-behaved.Note that the algorithm heavily relies on arrangement operations suh as
overlay,whihareprovidedby[32,8.1℄and[4℄. Thoughwetreatthisasablak
boxthroughoutmostofthepaper,somemoredetailsanbefoundinSetion5.
Theadditionalonstrutionsandprediatesrequiredbythelowerenvelopealgo-
rithmare: theonstrutionoftheprojetedboundaryof
uv
-monotonesurfaes,theonstrutionoftheprojetedintersetionoftwo
uv
-monotonesurfaes,andtheomparisonoftwobisetorsaboveafae,edge,orvertex.
3 Computing a Voronoi Cell
Thissetiondisussestheomputationofthe
VC
ofoneline, referredtoasthebaseline anddenotedby
ℓ 0
.The two-dimensional pakage of Cgal has the infrastruture to ompute
envelopesoverylinders. However,fortheeienyoftheimplementationitis
importanttokeepthealgebraidegreeoftheprojetedurvesaslowaspossible.
Therefore,weprojettheurvesontwoparallelplanesthatsandwih thebase
line,whilekeepingtheprojetiondiretionnormaltotheylinder. Thisredues
themaximumdegreeofaprojetedtrisetor urvefrom sixteendownto eight.
3.1 Parametrization and Projetion
Let
F = { − → b 1 , − →
b 2 , − →
b 3 }
beanorthogonalbasisofR 3
whihishosensuhthat− → b 1
isthediretionofthebaseline
ℓ 0
. Moreover,letp 0
besomerationalpointonℓ 0
.Now,onsider the parametrization
X (u, v, r) = p 0 + u · − →
b 1 + v · r · − →
b 2 + r · − → b 3
.Notethat
X (u, v, ± 1)
denestwoparallelplanes(uv
-planes)thatsandwihℓ 0
,whih we all the positiveand the negativeplane, respetively. Thus a point
X (u 0 , v 0 , ± 1)
representsaraythatoriginatesfrompointp 0 + u 0 · − →
b 1
onℓ 0
withdiretion
± (v 0 · − → b 2 + − → b 3 )
.Notethattheplane
H ∗ = { x ∈ R 3 | (x − p 0 ) T · − → b 3 = 0 }
isnotoveredbytheparametrization. However, onean simplyglue the arrangementstogether as
longasthehosenframeisgeneri,thatis,urvesarenotallowedtotouh
H ∗
,interset in
H ∗
, or even be ontainedinH ∗
. However, urvesare allowedtotransverselyinterset
H ∗
,whereeahintersetiongivesrisetoasimplevertial asymptoteintheprojetion.Inordertoavoidtheseritialases,wegeneratetheloalframebysetting
−
→ b 2
to somerandomvetorthat is orthogonalto
−
→ b 1
. Thoughthisframe isgeneriwith high probability, we also hek in all relevant prediates that the frame
is indeed generi. If neessary, we restart the omputation hoosing another
random frame. We hose the standardstrategy that inreasesthe number of
randombitsused foreahiteration. Thiswayweguaranteeterminationanda
smallnumberofadditionalbitsdue totherandomization.
Wehighlightbelowseveralmajorissuesintheprojetionofatrisetor. The
projetionof abisetors' boundaryand adetailed ase analysis is deferredto
AppendixA . Werelymerelyonthegeneriframeandonthefollowingorollary
that diretlyfollowsfromTheorem 2:
Corollary 3 Thesetofpointswherethetrisetordoesnotrepresentatransver-
sal intersetion of the bisetors is a 0-dimensional set, namely, the singular
pointsof thetrisetor. Theonly exeptionisthe aseofthreeoplanaronur-
rent lines; inthis asethe trisetor isthe ommon singular lous (line) of the
three bisetors.
For atrisetor
T 0ij
letB 0i , B 0j , B ij ∈ Q [x 1 , x 2 , x 3 ]
be the three trivariatepolynomialsoftherelevantbisetors. Nowlet
B 1
andB 2
bethetwobisetorsof minimal degree,
d 1
andd 2
, respetively. The projetionis arried outbya resultant omputation [33℄. However,sine wewish to projettowardsℓ 0
werstsubstitute
X (u, v, r)
intoB 1
andB 2
andomputetheresultantwithrespetto
r
.res(u, v) := resultant(B 1 ( X (u, v, r), B 2 ( X (u, v, r)), r) ∈ Q[u, v] .
−
→ v 2
−
→ v 3
−
→ v 1
B 0 i
B 0 j
X (u, v,+1)
X (u, v, − 1) v →
← v ℓ 0
T 0 ij
T 0 ij
cross-section perpendicular to ℓ 0
Thisisatmostabivariatepolynomialof
degree
2d 1 d 2
. Thus, in theworst ase (thegeneri ase) this is an irreduible polyno-
mial of degree 4
only
8
. However,due to itsalgebrai nature the approah an not im-
mediately distinguish between the positive
andthenegativeparameterspae. TheFig-
uretotherightillustrateshowtheresultant
projets
T 0ij
into the positiveand negativeplane. Werstsplituptheprojetedurveinto
u
-monotonesegmentsusing[4℄.Inpartiular,urvesaresplitupatvertialasymptotes.
Inordertodeidethatanar
α
isonaertainplain weutilizeCorollary3,namelytheobservationthatinallbutoneexeption(whihishandledexpliitly)
twobisetorsmustintersettransverselyalongthetrisetorurve,whihimplies
that theymustinterhangetheirorderwhilepassingtheprojetedtrisetor.
Thisisdetetedbytworayshootsatrationalpointsrightaboveandbelow
α
.Let
p
andp
bethese twopoints, respetively. Toensurethat bothpoints are hosensuientlylose,weonstrutarationalvertiallineL
thatintersetsα
initsinterior,sayatpoint
p α
. WehoosethepointsonL
suhthattheyisolatethearfromallother intersetionsof
L
withres
. NowonsiderthepathonL
from
p
(orp
)top α
.p
issuientlylosetoα
sinethispathdoesnotintersetres
until itreahesα
. Inaseα
isvertial,wehooseL
tobehorizontal.Furtherdetailsandin partiularhowtoguaranteethatthehosenframeis
generi,anbefoundinAppendix A.
3.2 Lower Envelope Prediates
A ore part of the envelope algorithm is the representation of minimization
diagrams as labeled arrangementsand the overlayof suharrangements. The
requiredprediates forthese operations relateto planaralgebraiurvesonly,
4
More preisely, itisa bivariatepolynomialofbi-degree atmost
(4, 4)
. Fora standardrationalparametrizationoftheylinder,wewouldobtainapolynomialofbi-degree
(8, 8)
or16
intotal.whih are provided by[4℄. However,it remains to ensurethat nointersetion
takesplaein
H ∗
. This boilsdownto testingthattheleadingoeientswithrespet to
v
of twonon overlapping (o-prime) urveshave no ommon root.Thus, weprovideaslightly modiedset ofprediatesthat additionallyensure
thisondition.
Theprediatesthatareadditionallyrequiredbytheenvelopealgorithmare
theomparisonoftwobisetorsaboveafae,anedge,oravertex,respetively;
seealsoSetion2.2. Forafae,itissuienttoseletarationalpointinsideit
and omparethesurfaes along theorrespondingray. The pointis hosenin
asimilar way to theapproah used whensorting thetrisetorsto thepositive
and negative planes. For an edge we onstrut a vertex in its interior and
omparealongtheorrespondingray. Foravertex,whihmaynothaverational
oordinates, we rst hek whether the point is on the projetedintersetion
of the two bisetors, and report equality if it is indeed the ase. Otherwise
weomparebisetorsatarationalpointsuiently loseto thevertex, where
suientlyloseisagaindeterminedbyasimilarstrategyasinsortingtrisetor
urves.
3.3 Complexity
Forthetimeomplexityandspaeomplexityanalysisweignoreadditionalosts
that mayarise due to variable bit-lengthof various implementationsadhering
totheexatomputationparadigm[36℄. Wealsoignoretheadditionalrun-time
that anresultfrom apoorhoieofageneriframe(Setion3.1),asitisnot
thegeneralase,andhasnoimpatonperformaneinexpetation.
Thebisetorsurfaes arealgebraisurfaes ofmaximumdegreeof
8
there-fore,thetime-omplexityof thelowerenvelopealgorithmis
O(n 2+ε )
(whih isalsothebestknownupperbound). Thustherun-timeomplexityofomputing
theellsforall
n
linesisO(n 3+ε )
,whihalsobounds thespaeomplexity.4 Fast Point Loation
Given a query point
p
we wish to nd the losest line to it. Consider thefollowingpoint-loationstrategy: Westartwitharandomline site
ℓ
. Firstweprojet
p
onℓ
andloateitsimageintheminimizationdiagramofℓ
. Theimageisloatedonafeature oftheminimizationdiagramwhihislabeledwitha(in
generalnotempty)setof linesites
S
. Wethen omparethedistaned(ℓ, p)
tod(ℓ ′ , p)
foronelineℓ ′ ∈ S
. Ifd(ℓ, p)
islessthanorequaltod(ℓ ′ , p)
wereportℓ
or
S ∪ ℓ
,respetively. Otherwiseweontinueintheellofℓ ′
. ThiswalkthroughtheVoronoidiagramterminatessinethereisonlyanite numberofellsand
thedistaneof
p
totheurrentlinealwaysdereases. Weanloatetheimageof
p
insidetheminimizationdiagraminexpetedO(log n)
timebyusingpoint-loation based on trapezoidal deomposition [27℄. Combining this algorithm
withtheideaoflandmarks[21℄mayalreadyhavegoodperformaneinpratie.
However,thealgorithmhasaworst-timetimeomplexity
O(n log n)
.Weturnitintoanalgorithmwithatime-omplexity
O(log 2 n)
byombiningitwith astrategythat issimilar toskip lists. Webuild ahierarhyofVoronoi
diagrams. Thelowest layerontainsthe
VD
of thefull setof lines, whileeahother layersontainthe
VD
ofonly1/k
(random)linesof thepreedinglayer,where
k > 1
issomeonstant. Thehighestlayer(therootlayer)ontainsonlyaonstantnumberoflines,andthenumberoflayersis
O(log n)
. Inordertoloateapoint
p
werstloateitin the root layerusing the walkstrategy desribedabove. Wethenproeedtothenextlayerstartingatthelinethatwasfoundin
thepreedinglayer.
The following theorem summarizes the performane of the point-loation
struture(see[11,23℄ forsimilar analysisin2D):
Theorem4 The expetedrunningtimeofthe point-loation queryinthe hier-
arhial VDstrutureis
O(log 2 n)
.Proof: The number of ells visited at the root layer is obviously at most
k
. For all otherlayers,onsider thethepath bakward,from its targetto thesoure: foreveryelltheprobabilitythatitisalreadythesoureis
1/k
. Thus,the expeted length of a path is
P n i=1
i
k ( k − k 1 ) i − 1 ≤ k
. That is, theexpetedrunning-timeis
k P log k n
i=1 T(k i )
, whereT (m)
istheexpeted timespentonthepoint loationin theminimizationdiagramof
m
lines. Thus weobtainanex-petedrunning-timeof
O(log 2 n)
intotal.2
Weremarkthatsomespeialasesareleftoutinthisdisussionforbrevity
(e.g.,pointsthatare ontainedin
H ∗
),buttheyareompletelyhandled inoursoftware.
5 Implementation Details
OurimplementationisbasedonCgal,whihfollowsthegeneri-programming
paradigm[3℄. Algorithmsareformulatedandimplementedsuh that theyare
abstratfromtheatualtypes,onstrutions,andprediates. Thus, theimple-
mentation of every algorithm and data struture in Cgal is parametrized by
a so-alledtraits lass [28℄, in whih these funtionalities are dened. Inpar-
tiular,auseranemployanalgorithmwithhisowntypes,onstrutions,and
prediatesby providinghis own traitslass. This wayitispossibleto ahieve
a great amount of exibility. At the extreme, it is possible to even partially
hange the nature of an algorithm, as we do here for the three-dimensional
lowerenvelopelass[32,8.5℄.
The ore of our implementation is the traits lass for the lower envelope
algorithm, whih also needstobeavalidtraits lassforCGAL's arrangement
pakage. Therequiredfuntionalitiesbythearrangementpakageareprovided
bythetraits lasspresentedin [4℄. Theapproahredues allonstrutionand
prediates to ylindrial algebraideompositions of the plane for oneortwo
urves.Theapproahusesadditionalresultantomputationthatprojetsinter-
setion pointsontothe
u
-axis, that is,u
-oordinatesof intersetionpointsare represented as real roots of this univariateresultant polynomial. Thereafter,thebersabovetherootsareinvestigatedin orderto determinethearofthe
urveonwhih theintersetion takesplae.
Weessentiallywraptheabovetraitslassandadd therequiredfuntional-
itiesby theenvelopealgorithm;see also Setion 3. Inasewe detetthat the
urrentframe is notgeneri an exeption is thrown, whih is then aught by
ourprimary lassthat omputesanewframeandrestartstheomputation of
(a) (b) ()
Figure 2: Diagramsarelippedbyasphere foronveniene. (a)
VD
of4
lines, obtainedbyrotating onelinearound the
z
-axis. Allbisetorsmeetinthat axis. (b)VD
of4
linesinterseting inonepoint. ()
VD
of4
lines,twolinesintersetandtheothersareparalleltoeahofthem,respetively.
the ell. Foreah Voronoi ellwe keep aseparate instane ofthe traits lass,
whihisusedforbothplanes. Thisallowsahingofrelevantresults.
Approximationofthethree-dimensionaloordinatesofavertex,isbasedon
multi-preision oating-point interval arithmeti (MPFI) [8, 8℄. Sine this is
aertied approximation,weobtainabounding boxthat ontainsthevertex.
This ouldbe usedto easily establishtheadjaeny among lowerdimensional
ells. Forinstane, let
v
denote a vertex in aminimization diagramM
. Thelabelof
v
pointstoallotherminimizationdiagramsthatontainarepresentation of it. LetM ′
be oneof these diagrams andv ′
be the representationthat we wish to ndtherein. We oulduseasimilar approah to theoneusedin [13℄:Byusingthelabels,weidentifyallpossibleandidatesin
M ′
. Thissetontainsonlyupto
8
representationsandontainsatleastv ′
. Weomputeprogressively more preise bounding boxes for allandidates until only one (the one ofv ′
)overlapsthebounding boxof
v
.Our implementation an handle arbitrary rational lines, in partiular, it
anhandle all possible degenerateases. Figure 2depits degenerateVoronoi
diagrams. Eah mesh was generated using CGAL's pakagefor labeledmesh
domains[30℄. Theorale,whihisrequiredbythemeshgeneration,waswritten
suhthatitonlyutilizes(andtherebytests)ourpointloationstruture. Lower
dimensional features were approximated using the approah disussed above.
In order to ahieve sharp edges the proteting balls tehnique introdued by
Bolthevaetal.[9℄wasapplied. medit[29℄wasusedforthenalvisualization.
Sineweaim to eventually inorporate our ode into aCgal pakagethe
software is developed within the revision ontrol system of the projet. All
experimentswithin thissetion wherearriedoutonan internalCgal release
CGAL-3.7-I-27,whihalreadyomprisesalltheneessaryalgebraitools[4℄.
However, the trapezoidal map is urrently not available for minimization di-
agrams due to ongoinghanges in the arrangementpakage (it is antiipated
soon),whih foresus toresortto asimplerpointloationstrategiesfornow.
Finally,wepresentpreliminaryresultsobtainedwithoursoftware. Thepoint
loationstrutureasitisdisussedinSetion4leavestheratio
k
amonglevelsN \k
2 4 8 16 20 24 28+∞
16 6.48 4.30 4.34 N/A N/A N/A N/A 3.94
36 8.09 6.33 5.33 5.67 N/A N/A N/A 5.62
64 9.77 6.42 5.73 6.07 6.00 6.12 6.83 6.63
100 9.87 7.22 6.18 6.45 6.97 6.83 7.13 7.43
Table1: Averagenumberofvisitedellsperquery,where
k
denotestheratioofthehierarhyand
N
the number oflines. Entriesforn < 2k
arerepesented bythe lastolumn. TotherightisdepitedaVoronoidiagramof
5
parallellines.undetermined. Inorder to show theimpat of
k
wereated random instaneof parallel lines with oeients in the range
[0, 2 10 ]
.5 For eah instane, wereated
10
Voronoidiagramhierarhies,whihwherequeriedwith1000
randompointsin
[0, 2 10 ] 3
eah.Table 1shows theaverage numberof visited ellsperquerydepending on
thenumberoflinesandthehosenvaluefor
k
. Thelastolumnshowsthepurewalkwithoutahierarhy,whih suggestsanaveragequery timein
O( √ n)
, asonemayalso expet due to resultsin [12℄. For largerinstanes, itseemsthat
hoosing
k
equalto8
isappropriate.6 Conlusions
We havepresented anexat, omplete, and thus robust, algorithm that om-
putes the Voronoi diagram of arbitrary rational lines in
R 3
. The algorithmrequires
O(n 3+ε )
time and spae, wheren
is the number of lines. The in-trodued datastruture permits to answerpoint loation queriesin
O(log 2 n)
expeted time. The implemented prototype is exat and an handle all de-
generateases. Wereferto http://ag.s.tau.a.il/projets/internal-
projets/3d-lines-vor/projet- page forthe mostreentversionand sup-
plemental material.
Thealgorithmisintentionallydesignedsuhthatitavoidstediousasedis-
tintions, whih makesit implementable,maintainable and, in partiular, ex-
tensibleto otherprimitivessuhaspoints,line segments,andtriangles. Thus,
weonsiderourapproahasamajormilestonetowardstheomputationofthe
Voronoidiagramofpolyhedrainthreedimensions.
Moreover,weexpetthatitwillpavethewaytodevisingathree-dimensional
variantofthevisibility-Voronoiomplex[34℄,astruturethatenablestotrade-
o learaneand pathlength in robot motionplanning,and hasproved tobe
espeially usefulin theplane.
Ourapproahmayalsobegeneralizedtospheres(seealso[20℄)whihwould
open the doorfor innovative solutionsto entral problems in StruturalBiol-
ogy[24,35℄.
Aknowledgments: Theauthors thankS. Lazard andM. Yvineforfruitful
disussionsandMoniqueTeillaudforhertranslationof theabstratto Frenh.
5
Sinethetrapezoidalmapisnotyetavailableforenvelopes,wehadtoresorttoinstanes
thatkeeptheomplexityofaellsmall.
Referenes
[1℄ P. K.Agarwal, O.Shwarzkopf,andM. Sharir. The overlay oflowerenvelopes
anditsappliations. Dis.Comput. Geom.,15(1):113,1996.
[2℄ F. Aurenhammerand R.Klein. Voronoi diagrams. InJ.Sak and G.Urrutia,
editors,Handb.Comput. Geom.,hapter5,pages201290.Elsevier,2000.
[3℄ M.H.Austern. Generi ProgrammingandtheSTL. Addison-Wesley,1999.
[4℄ E.Berberih,M.Hemmer,andM.Kerber. AnalgebraikernelforCGAL. Sub-
mittedtoESA,2010.
[5℄ E. Berberih,M. Hemmer,L. Kettner,E.Shömer,and N.Wolpert. Anexat,
ompleteandeientimplementationforomputingplanarmapsofquadriin-
tersetionurves.InPro.21stAnnu.ACMSymp.Comput.Geom.,pages99106,
ACMPress, 2005.
[6℄ H. Blum. A transformation for extratingnewdesriptors of shape. InModels
forthePereption ofSpeeh andVisualForm,MITPress, 1967.
[7℄ J.-D.BoissonnatandC.Delage. ConvexhullandVoronoidiagramofadditively
weightedpoints. InESA,pages367378,2005.
[8℄ J.-D.BoissonnatandM.Teillaud,editors. EetiveComputationalGeometryfor
Curves andSurfaes. Springer-Verlag,MathematisandVisualization,2006.
[9℄ D. Boltheva, M. Yvine, and J.-D. Boissonnat. Feature preserving Delaunay
mesh generation from 3D multi-material images. Computer Graphis Forum,
2009.
[10℄ T.Culver,J.Keyser,andD.Manoha. Exatomputationofthemedialaxis of
apolyhedron. Computer AidedGeometriDesign, 21(1):6598,2004.
[11℄ O.Devillers. ImprovedinrementalrandomizedDelaunaytriangulation.InPro.
14thAnnu.ACMSymp.Comput.Geom.,pages106115,ACMPress,1998.
[12℄ L.Devroye,C.Lemaire,andJ.-M.Moreau. Expetedtimeanalysisfordelaunay
pointloation. Computational Geometry,29(2):6189, 2004.
[13℄ L. Dupont, M. Hemmer, S. Petitjean, and E. Shömer. Complete, exat and
eient implementationfor omputing the adjaeny graphof anarrangement
ofquadris. InPro.15thAnnu. Eur.Symp.Alg.,volume4698ofLNCS, pages
633644,Springer,2007.
[14℄ H.EdelsbrunnerandR.Seidel.Voronoidiagramsandarrangements.Dis.Com-
put.Geom.,1:2544,1986.
[15℄ I. Z. Emiris and M. I. Karavelas. The prediates of the Apollonius diagram:
Algorithmianalysis and implementation. Comput. Geom.Theory Appl., 33(1-
2):1857,2006.
[16℄ I.Z.Emiris,E.P.Tsigaridas,andG.M.Tzoumas.TheprediatesfortheVoronoi
diagramofellipses.InPro.22ndAnnu.ACMSymp.Comput.Geom.,pages227
236,ACMPress,2006.
[17℄ H.Everett,C.Gillot,D.Lazard,S.Lazard,andM.Pouget.TheVoronoidiagram
ofthreearbitrarylinesin
R 3
.InAbstratsof25thEur.WorkshopComput.Geom.,2009.
[18℄ H. Everett, S.Lazard, D. Lazard, and M. S.E. Din. The Voronoi diagram of
three lines. InPro. 23rd Annu. ACM Symp. Comput. Geom., pages 255264,
ACMPress, 2007.
[19℄ D.Halperin,L.E.Kavraki,andJ.-C.Latombe. Robotis.InJ.E.Goodmanand
J.O'Rourke,editors,Handb.Dis.Comput.Geom.,hapter48,pages10651093.
Chapman&Hall/CRC,2ndedition,2004.
[20℄ I. Hanniel and G. Elber. Computing the Voronoi ells of planes, spheres and
ylindersin
R 3
. Comput. AidedGeom.Des., 26(6):695710,2009.[21℄ I. Haran and D. Halperin. An experimental study of point loation inplanar
arrangementsinCGAL. ACMJournalofExperimentalAlgorithmis,13, 2008.
[22℄ M. I. Karavelas. A robustand eent implementation for thesegment Voronoi
diagram. In Int. Symp. on Voronoi Diagrams in Si. and Engineering, pages
5162,2004.
[23℄ M. I.KaravelasandM.Yvine. DynamiadditivelyweightedVoronoidiagrams
in2D. InPro.10thAnnu.Eur.Symp.Alg.,pages586598,Springer,2002.
[24℄ D.-S.Kim,J.Seo,D.Kim,Y.Cho,andJ.Ryu.Thebeta-shapeandbeta-omplex
for analysis of moleular strutures. In M. L. Gavrilova, editor, Generalized
Voronoi Diagram: A Geometry-Based Approah to Computational Intelligene,
volume158ofStudiesinComputationalIntelligene,pages4766.Springer,2008.
[25℄ V.KoltunandM.Sharir.3-dimensionalEulideanVoronoidiagramsoflineswith
axednumberoforientations. SIAMJ.onComputing,32(3):616642,2003.
[26℄ V.Milenkovi. RobustonstrutionoftheVoronoidiagramofapolyhedron. In
Pro.5thCanad.Conf.Comput. Geom.,pages473478,1993.
[27℄ K.Mulmuley. A fast planarpartition algorithm, I. InPro.29th Annu. IEEE
Sympos.Found. Comput.Si.,pages580589,1988.
[28℄ N.Myers. Traits: Anewandusefultemplatetehnique. C++Gems,17,1995.
[29℄ Pasal J.Frey. MEDIT:AninterativeMeshvisualizationSoftware. Tehnial
ReportRT-0253,INRIA,De2001.
[30℄ L.RineauandM.Yvine.3Dsurfaemeshgeneration.InCGALEditorialBoard,
editor,CGALUserandReferene Manual.3.5 edition,2009.
[31℄ M.Sharir. Almosttightupperboundsforlowerenvelopesinhigherdimensions.
Dis.Comput. Geom.,12(1):327345,1994.
[32℄ TheCGALProjet. CGALUserandRefereneManual.CGALEditorialBoard,
3.6 edition,2010. http//www.gal.org/.
[33℄ J.vonzurGathenandJ.Gerhard. ModernComputer Algebra. CambridgeUni-
versityPress,1999.
[34℄ R.Wein,J.P.vandenBerg,andD.Halperin.Thevisibility-Voronoiomplexand
itsappliations.ComputationalGeometry: TheoryandAppliations,36(1):6687,
2007.
[35℄ E. YaeandD. Halperin. Approximating thepathway axisand thepersistene
diagram of a olletion of balls in 3-spae. In Pro. 24th Annu. ACM Symp.
Comput. Geom.,pages260269,ACMPress,2008.
[36℄ C.-K. Yapand T. Dubé. Theexat omputation paradigm. In D.-Z. Du and
F. K. Hwang, editors, Computing in Eulidean Geometry, volume 1 of LNCS,
pages452492.WorldSienti,2ndedition,1995.
A Projetion of Bisetors and Trisetors
Reall, from thedisussion in Setion 3that the parametrization
X (u, v, r)
isdened with respetto a loal frame
F = { − → b 1 , − → b 2 , − → b 3 }
and that the plainH ∗
,whihisorthogonalto
−
→ b 3
,isnotontainedinX
.Ingeneral this is not aproblem sinea urve (trisetor)that transversely
intersets
H ∗
appearsasasimplevertialasymptoteintheuv
-parameterspae.Forinstane,ifaprojetedurveleavesoneplaneasavertialasymptoteatplus
innity,thenitreappearsatminusinnityontheotherplane. Ifthisistheonly
asethathappensitislearthatthereisaone-to-onorrespondeneamongthe
vertialasymptote (andthus edges) in thetwo minimization diagrams,whih
makesitpossibletogluethemtogether.
Weallaframeforwhihthisispossibleageneriframe,morepreisely:
Denition5 (GeneriFrame) Wedenetheframe
F
tobe generiif(i)no1-dimensional omponents of the trisetor (a oni or a line) 6
are ontained
in
H ∗
,(ii)everyintersetionofatrisetorwithH ∗
isatransversalintersetion, (iii)notwourves(trisetors)intersetinH ∗
,and(iv)the intersetionsofH ∗
with allbisetors
B 0i
areregular.Inthissetion weanalyze theasesthat weenounterwhile projetingbi-
setorboundariesandtrisetorurves. Inpartiular,wedisusshowwedetet
anon-generiframe.
A.1 Projetion of Bisetors Boundary
TheaseshereorrespondtotheasedistintioninProposition1.
Generi Case Let
B 0i ∈ Q[x 1 , x 2 , x 3 ]
be the polynomial representing the bisetorbetweenℓ 0
(thebaseline)andsomeotherlineℓ i
. InthegeneriaseB 0i
representsahyperboliparaboloidthat isdenein almostalldiretions ofthe
projetion. Theonlyexeptionareraysthat areperpendiularto
ℓ i
andpointawayfrom
ℓ i
. Thesediretionsarerepresentedbyahorizontal(representingrays in thesamediretion)line. Thelineis haraterizedbytheleadingoeientof
B 0i ( X (u, v, r))
with respettor
. Oneah oftheuv
-planeweinterpret thissurfae as one or two
uv
-monotone surfaes. On the plane that ontains theabove line, we split the bisetor into two
uv
-monotone surfaes; on the otherplanethereisexatlyone
uv
-monotonesurfae.Parallel Lines Inase
ℓ 0
andℓ i
areparallel,B 0i
isof degree1
sineitrep-resents aplane. Theleading oeientof
B 0i ( X (u, v, r))
with respettor
isa horizontal line that represents all rays that do not interset
B 0i
. That is,oneah ofthe
uv
-planesweobtainoneuv
-monotonesurfae,whose projetedboundaryisthisline. Theproperhalfspaeanbedeterminedbyasimpleray
shoot.
6
Notethataubiannotbeontainedin
H ∗
.IntersetingLines Inase
ℓ 0
andℓ i
interset,thebisetorB 0i
degenerates to twoplanesthat intersetalong asingularrational lineℓ s
, whih is perpen-diular to
ℓ 0
andℓ i
. Let(u 0 , v 0 ) ∈ Q 2
be theparameter valuesfor that line.All lines
X (u 0 , v, r), v 6 = v 0
have a double intersetion withB 0i
. The linesX (u, v 0 , r), u 6 = u 0
donot intersetB 0i
, sine theyare parallel to it. Thepa-rameterspaeissplitupalong
v = v 0
andu = u 0
,whihresultsinuv
-monotonesurfaes,
4
onethepositiveand4
onthenegativeside.Ensuringa GeneriFrame Forallasesitholdsthattheonstrutionmay
trigger arestart of theomputation ifone of the horizontal lines is not seen,
thatis,iftheleadingoeientof
B 0i ( X (u, v, r))
withrespettor
hasdegree0
.A.2 Projetion of Trisetors
Besides the exatness of the method desribed in Setion 3.1, it has the ad-
vantage that it is general and forgoesa huge ase distintion. In partiular,
wedonotfatorize thepolynomialinto itsfators thatrepresentthe dierent
omponentsmentionedinTheorem 2.
Twobisetorsareomparedabove(below)a
u
-monotonearc u
,7
onthepos-
itive(negative) planeasfollows. Forasuientlylose rationalpoint
p(u 0 , v 0 )
above(below)
c u
, the orrespondingline is substituted into thetwobisetors.Thisisatmosttwoquadratipolynomialsin
r
,eahhavingatmostonepositiveand one negativeroot. If present, the positive (negative) roots from the two
bisetors are ompared. In ase that no root is present, there is no bisetor
above
p
andtheomparisonisnotrequired.8Aspeial treatmentisgivenfortheaseofthreeoplanaronurrentlines.
Thetrisetorinthisaseisasingleperpendiularlineto
ℓ 0
. Hene,itsproje-tionisjustarationalpointthatisvalidforbothsides.
Ensuring a GeneriFrame First,itishekedthatno1-dimensionalom-
ponentisontainedin
H ∗
,inthatasedegree(res)
isneessarilylessthan2d 1 d 2
but the degreemay alsodrop in fewother ases. Thus ifthedegree issuspi-
ious, we simply interset
B 1
andB 2
withH ∗
. There is no 1-dimensional omponentif the degreeof thegcd
of thetworesulting bivariate polynomials is onstant. Moreover, we hek that the projetion has only simple vertialasymptotebyhekingthattheleadingoeientofthesquarefreepartof
res
issquarefree. Thisensuresthatthetrisetorintersets
H ∗
transverselyalways.7
Aboveistheareatotheleftoftheurvewhengoingfromitslexiographiallysmaller
toitslexiographiallylargerend.
8
Thishappensinasethebisetorisjustasimpleplane.
Contents
1 Introdution 3
2 Preliminaries 4
2.1 PropertiesofBisetorsandTrisetors . . . 4
2.2 LowerEnvelopeAlgorithm. . . 5
3 Computinga Voronoi Cell 6
3.1 ParametrizationandProjetion . . . 6
3.2 LowerEnvelopePrediates . . . 7
3.3 Complexity . . . 8
4 Fast Point Loation 8
5 ImplementationDetails 9
6 Conlusions 11
A Projetion of Bisetorsand Trisetors 14
A.1 ProjetionofBisetorsBoundary . . . 14
A.2 ProjetionofTrisetors . . . 15
2004, route des Lucioles - BP 93 - 06902 Sophia Antipolis Cedex (France)
Centre de recherche INRIA Bordeaux – Sud Ouest : Domaine Universitaire - 351, cours de la Libération - 33405 Talence Cedex Centre de recherche INRIA Grenoble – Rhône-Alpes : 655, avenue de l’Europe - 38334 Montbonnot Saint-Ismier Centre de recherche INRIA Lille – Nord Europe : Parc Scientifique de la Haute Borne - 40, avenue Halley - 59650 Villeneuve d’Ascq
Centre de recherche INRIA Nancy – Grand Est : LORIA, Technopôle de Nancy-Brabois - Campus scientifique 615, rue du Jardin Botanique - BP 101 - 54602 Villers-lès-Nancy Cedex
Centre de recherche INRIA Paris – Rocquencourt : Domaine de Voluceau - Rocquencourt - BP 105 - 78153 Le Chesnay Cedex Centre de recherche INRIA Rennes – Bretagne Atlantique : IRISA, Campus universitaire de Beaulieu - 35042 Rennes Cedex Centre de recherche INRIA Saclay – Île-de-France : Parc Orsay Université - ZAC des Vignes : 4, rue Jacques Monod - 91893 Orsay Cedex
Éditeur
INRIA - Domaine de Voluceau - Rocquencourt, BP 105 - 78153 Le Chesnay Cedex (France)
http://www.inria.fr