1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Effective Computational Geometry for Curves & Surfaces - Boissonnat & Teillaud Part 3 docx

25 160 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 25
Dung lượng 2,36 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Let P x1denote the plane x = x1.LetA x1 denote the partial two-dimensional decomposition of the arrangement AP x1∩ T of segments induced on the plane P x1 by intersecting it with the tr

Trang 1

the term arcpoint for either an endpoint of an arc or an intersection point.

An arcpoint is represented by a root of a system of two bivariate polynomial

equations Finding this root reduces to the algebraic operation:

• solve, that computes the common roots of two given bivariate

polynomi-als

The basic operations necessary to implement geometric predicates andconstructions are kept at a high level, not imposing any specific algebraictool The main operations can then be rephrased as:

• compare, that compares two algebraic numbers,

• x critical points, that computes the critical points of a bivariate

poly-nomial,

• sign at that computes the sign of a bivariate polynomial evaluated at the

root of a system of bivariate equations

Comparisons can be carried out exactly and efficiently using algebraic

methods adapted to algebraic numbers of low degree [116, 144] This is plained in Chap 3

ex-It is crucial to note, however, that the concepts are general enough to allowalso completely different methods, such as interval analysis, that will be usedtogether with exact algebraic methods, for filtering purposes

1.4.5 How To Speed Up Your Arrangement Computation in Cgal

• When the curves to be inserted into an arrangement are x-monotone and

pairwise disjoint in their interior to start with, then it is more efficient (inrunning time) and less demanding (in traits-class functionality) to use thenon-intersection insertion-functions instead of the general ones

• The main trade-off among point-location strategies, is between time and

storage Using the naive or walk strategies, for example, takes more querytime but saves storage space and requires less time for maintaining theauxiliary structures

• If point-location queries are not performed frequently, but other modifying

functions, such as removing, splitting, or merging edges are, then using apoint-location strategy that does not require the maintenance of auxiliarystructures, such as the naive or walk strategies, is preferable

• When the curves to be inserted into an arrangement are available in

ad-vance (as opposed to supplied on-line), it is advised to use the more efficientaggregate (sweep-based) insertion over the incremental insertion

• The various traits classes should be instantiated with an exact number

type to ensure robustness, when the input of the operations to be carriedout might be degenerate, although inexact number types could be used atthe user’s own risk

• Maintaining short bit-lengths of coordinate representations may drastically

decrease the time consumption of arithmetic operations on the coordinates

Trang 2

(a) (b)

Fig 1.13 Vertical decomposition (a) and partial decomposition (b) of an

arrange-ment of segarrange-ments [315] inside a bounding rectangle

This can be achieved by caching certain information or normalization (ofrational numbers) However, both solutions should be used cautiously, asthe former may lead to an undue space consumption, and indiscriminatenormalization may considerably slow down the overall process

• Geometric functions (e.g., traits methods) dominate the time

consump-tion of most operaconsump-tions Thus, calls to such funcconsump-tion should be avoided or

at least their number should be decreased, perhaps at the expense of creased combinatorial-function calls or increased space consumption Forexample, repetition of geometric-function calls could be avoided by storingthe results obtained by the first call, and reusing them when needed

in-1.5 Exact Construction in 3-Space

Moving from two-dimensional arrangements of curves to three-dimensionalarrangements of surfaces is a major endeavor In this section we report onprogress in and plans for coping with three-dimensional arrangements Westart with an efficient space-sweep algorithm for computing a useful refine-ment of arrangements of surfaces, and proceed with algebraic primitives andalgorithms for the case of quadrics

1.5.1 Sweeping Arrangements of Surfaces

We describe a method to effectively compute a representation of a

three-dimensional arrangement of well-behaved surface patches15[315] The method

is fairly simple and efficient and has been successfully implemented for

ar-rangements of triangles and of polyhedral surfaces It computes the vertical

15

For a detailed discussion of what constitute well-behaved surfaces or surfacepatches in the context of arrangements, see [15] These are, for example, a collec-tion of algebraic surface patches of bounded degree each bounded by at most someconstant number of algebraic curves of bounded degree and each decomposed into

a constant number of xy-monotone patches.

Trang 3

decomposition of the arrangement, which is a convenient representation

break-ing the three-dimensional cells of the arrangement into vertical prisms It is

an extension to three-dimensional space of the well-known two-dimensionaltrapezoidal decomposition (as briefly described already in Sect 1.3); by ver-

tical we mean parallel to the z-axis.

A raw arrangement is often too complicated to handle and use as it mayhave cells with many features and complex topologies What is typicallyneeded is a further refinement of the arrangement into cells, each homeomor-phic to a ball and of small combinatorial complexity (that is, a small constantnumber of features) Additionally, we would like the refinement to be eco-nomical and not to increase the complexity of the arrangement by much A

refinement that satisfies these requirements is the so-called vertical sition Fig 1.13(a) depicts an arrangement of segments (in bold lines) refined

decompo-by vertical decomposition: We extend a vertical line upwards and downwardsfrom every vertex of the arrangement (either a segment endpoint or the inter-section of two segments) until it hits another segment or extends to infinity.Vertical decompositions are defined for any dimension and for arrangements

of any collection of “well-behaved” objects [85, 196, 312]

For simplicity of exposition we describe the three-dimensional variant for

arrangements of triangles Let T = {t1, t2, , t n } be a collection of triangles

in 3-space For a curve γ in R3 let H(γ) denote the vertical wall through γ, namely the union of vertical lines intersecting γ For an edge e of the arrange- ment we define the wall of the edge, denoted W (e), as the union of points in H(e) that can be connected to e with a vertical segment that does not cross any of the triangles in T The vertical decomposition of A(T ) is obtained as

follows First we erect walls from triangle boundary edges Second, walls areerected from the intersection edges between pairs of triangles to produce afiner decomposition Finally we refine the decomposition, in a straightforwardmanner, into a convex subdivision consisting of trapezoidal prisms (See e.g

[109] for details.) We call the refined subdivision the full (or standard)

ver-tical decomposition An alternative decomposition, which induces fewer cells,

called the partial decomposition, has also been proposed and investigated See

Fig 1.13(b) for an illustration of the two-dimensional partial decomposition

of an arrangement of segments

De Berg et al [109] showed that the maximum combinatorial complexity

of the vertical decomposition is the same as that of the arrangement, which

is Θ(n3), and the complexity of the vertical decomposition is sensitive to the

complexity of the underlying arrangement They gave a bound O(n 2+ + K) where K is the complexity of the arrangement, improved by Tagansky [326]

to O(n2α(n) log n + K), where α(n) is the extremely slowly growing inverse of

Ackermann’s function The near-quadratic overhead term is close to optimal inthe worst case as there are arrangements with linear complexity whose verticaldecomposition has quadratic complexity They also gave an output-sensitive

algorithm to compute the decomposition running in time O(n2log n+V log n), where V is the complexity of the decomposition.

Trang 4

The algorithm that we sketch here is an improvement and simplification of

the algorithm in [109] It runs in time O(n log2n + V log n) where V is the size

of the vertical decomposition of the arrangement of n well-behaved surfaces.

Thus, the algorithm has near-optimal running time A detailed description ofthe algorithm and its implementation can be found in [314, 315]

We assume that the input triangles in T are in general position For nience, we also assume that the triangles in T are bounded inside a big simplex

conve-(four extra triangles) and we are only interested in the decomposition inside

this bounding simplex The output of the algorithm is a graph G = (U, E) where each node in U describes one trapezoidal prism of the decomposition and there is an edge (u1, u2) in E if the two prisms corresponding to u1 and

u2share a vertical (artificial) wall

The algorithm consists of one pass of a space sweep with a plane orthogonal

to the x-axis moving from x = −∞ to x = ∞ Let P x1denote the plane x = x1.LetA x1 denote the partial two-dimensional decomposition of the arrangement

A(P x1∩ T ) of segments induced on the plane P x1 by intersecting it with the

triangles in T and the bounding simplex and by adding vertical extensions

only through segment endpoints (which looks, up to the bounding simplex,like Fig 1.13(b)) We use A x to denote this subdivision for an arbitrary x-

value

Besides the graph G in which the output is constructed, the algorithm

maintains three data structures A dynamic structure F that describes the

subdivision A x, a standard event queue Q, which maintains the events of the sweep ordered by their x-coordinate, and a dictionary D, which connects

betweenF and Q as we explain next.

The structureF supports efficient insertion or deletion of vertices, edges,

and faces of the subdivision In addition, it efficiently answers vertical shooting queries In order for the overall algorithm to be efficient, we wish torefrain from point location in the subdivision A x as much as we can, since

ray-in the dynamic settray-ing poray-int location queries are costly We achieve this byusing the dictionary D Each feature in the current subdivision A x is given

a unique combinatorial label (we omit the straightforward details here) Wekeep a dictionary of all these features with cross pointers to their occurrence

inF When we add an event that will occur later at x toQ we also insert the combinatorial labels of features of A x  that are related to the event This way,when we come to handle the event, we could use the dictionary D (paying O(log n) to search in the dictionary) and with the information thus obtained

we directly accessF.

If we do not compute events in advance (before the sweep starts), how do

we predict all the events together with the extra labels needed? The answerlies in the observation, which is similar to the key observation in the two-dimensional Bentley-Ottmann sweep algorithm: Before an event, the involvedfeatures of the arrangement must become neighbors inA x Thus it suffices topredict future events by only checking a small number of neighboring features,and repeat the test each time the neighbors of a feature change

Trang 5

A one-pass sweep with a plane suffices since almost all the events can bepredicted in this way, namely, every time we update the structureF we have

to go over a constant-length checklist involving the modified features of F The overall cost of the prediction is O(log n) (this is a property of F) and

at most a constant number of new events is created and inserted into thequeue Some of these events may later turn out to be ‘false alarms.’ However,

a false event never spawns a new event, the prediction of a false event can becharged to an actual event, and no actual event is charged for more than aconstant number of false events The full list of events, how they are detectedand handled, is given in [314]

Most features (or events) of the arrangementA(T ) can be fully predicted

during the sweep There is only one type of events, however, for which wecannot obtain the full event information from previous events This is obvi-

ously the appearance of a new triangle t, namely the first time that the sweep plane hits t This is what determines the choice of structure for F We use the

dynamic point location structure of Goodrich and Tamassia [187], which tains to monotone subdivisions (which in the case of triangles is even convex)

per-and takes O(log n) per update per-and O(log2n) per point location query menting it to support vertical ray shooting in a known face in time O(log n)

Aug-is trivial We use the structure for point location exactly n times.

Now we can summarize the performance of the algorithm The prediction

work, as well as handling a single event, take O(log n) time per event for a total

of O(V log n) (recall that V is the complexity of the decomposition) The extra

machinery required for handling the appearance of new triangles gives rise to

the overhead term O(n log2n) and it incurs additional work (of the point

location structure, which, although we use scarcely, needs to be maintained)

that is absorbed in the O(V log n) term The storage required by the algorithm

is O(V )—it is proportional to the complexity of the decomposition.

In the existing implementation of the algorithm the dynamic point-locationstructure is replaced with a na¨ıve test that goes over all triangles to find thetriangle that is immediately vertically above the query point According tothe experimental results reported in [315], this test is fast

In the case of triangles, as mentioned above, the subdivision A xis convex.The algorithm however does not rely on this fact in any way For the algorithm

to apply, it suffices that the subdivision A x be y-monotone (where y is the horizontal axis on the plane P x) The structure of Goodrich and Tamassiacan handle monotone subdivisions.16 Hence we can generalize the result tothe case of well-behaved surface patches:

Theorem 1 Given a collection S of n well-behaved surface patches in

gen-eral position in three-dimensional space, the time needed to compute the full vertical decomposition of the arrangement A(S) is O(n log2

Trang 6

1.5.2 Arrangements of Quadrics in 3D

Quadric surfaces, or quadrics for short, are defined as the set of roots of

quadratic trivariate polynomials For example, the ellipsoids R, G, and B in

the left picture of Fig 1.14 are defined by the following polynomials:

R(x, y, z) = 27x2+ 62y2+ 249z2− 10 ,

G(x, y, z) = 88x2+ 45y2+ 67z2− 66xy − 25xz + 12yz − 24x + 2y + 29z − 5 , B(x, y, z) = 139x2+ 141y2+ 71z2− 157xy + 97xz − 111yz − 3x − 6y − 17z − 7

On the surface of a given quadric p, the intersection curves of p with the

remaining quadrics induce a two-dimensional arrangement.17In our example,

the ellipsoid B and the ellipsoid G intersect the ellipsoid R This leads to two intersection curves on the surface of R (the right-hand side pictures of

Fig 1.14 and Fig 1.16) Vertices of this (sub)arrangement are common points

of two intersection curves, or rather intersection points of three quadrics

G

R

B

R

Fig 1.14 The ellipsoid B and the ellipsoid G intersect the ellipsoid R in two spatial

curves running on the surface of R

The Sweeping Approach

Sweeping a set of n quadrics {Q i , i = 1, , n } by a plane orthogonal to the axis allows to compute the so-called vertical decomposition of the arrangement

x-of the quadrics (as described above in Sect 1.5.1)

Trang 7

When applying this standard sweeping technique to arrangements ofquadrics in R3, the main issue is—as usual when applying computationalgeometry techniques to curved objects—the implementation of the geometricprimitives: predicates and constructions Therefore, it is essential to analyzethem precisely A first study of the way the primitives needed by the sweepcan be expressed in algebraic terms was conducted in [264, 265].

Fig 1.15 “Trapezoidal” decomposition of

conics in a plane

Let us denote by Q i both aquadric and its equation, which is

a degree 2 polynomial in the

vari-ables x, y, z The intersection of the

arrangement of quadrics with thesweeping plane in a fixed positionduring the sweep, gives rise to an

arrangement of conics in a (y,

z)-plane The equation of a conic for

a given position x = x0 of the plane

is Q i (x0, y, z) = 0, which is a

poly-nomial equation in the coordinates

y, z of a point in the planar section, denoted Q x0

i for short

This planar arrangement of conics can be decomposed into “curved zoids” generalizing in a straightforward way the cells of a trapezoidal decom-

trape-position of an arrangement of line segments (see Fig 1.15): A wall parallel

to the z-axis is drawn through every intersection point between two conics and every point where the tangent to the conic is parallel to the z-axis A

trapezoid is described by:

• two vertical walls, one of which (or even both) may degenerate to a single

point,

• a ceiling and a floor, which are segments of evolving conics, and

• signs to determine the side (above/below) of the trapezoid with respect to

each of these two conics

When the plane is moving, the conics are deforming The topology of thetrapezoidal decomposition changes at events of the sweep An event occurswhenever one of the two following possibilities occurs:

• either a new quadric is encountered by the sweeping plane (respectively, a

quadric is left by the plane), that is, a new conic appears on (respectively,

a conic disappears from) the plane

• or the description of a trapezoid is modified

- either because its ceiling and floor intersect,

- or because its walls coincide

Each event corresponds to the construction of a feature of the 3D verticaldecomposition

Trang 8

The detection of events boils down to the manipulation of roots of systems

of polynomial equations Let us briefly illustrate this by showing an example

of algebraic manipulation that is required by the algorithm

A wall in the sweeping plane x = x0 defined by the intersection of two

exactly two events, or equivalently, determine the sign of the difference of the

corresponding two algebraic numbers In the worst case, we are interested incomparing algebraic numbers of degree 16 belonging to independent algebraicextensions of the initial field So, the algorithm is highly demanding in terms

of algebraic manipulations

The solution proposed in [265] uses algebraic tools like Descartes’ rule,Sturm sequences, and rational univariate representation, described in Chap 3.The practicality of this solution is yet to be proven

Future work on replacing the vertical decomposition by a partial position is likely to improve the behavior of the algorithm:

decom-• Whereas the complexity of the arrangement is O(n3), the complexity V

of the vertical decomposition is known to be bounded by O(n3β(n)) where β(n) = λ s (n)/n = 2 α(n)16 [85]

Note that, though the size of this decomposition is slightly larger than thesize of the arrangement, it is much smaller than the size of Collins’ cylindricalalgebraic decomposition [101]

It is well known that in practice the number of cells in the vertical position can be much bigger than the number of cells in the arrangement Itwas shown experimentally, in the case of triangles in 3D, that the number ofcells in a partial decomposition can be smaller [315]

decom-• Another important motivation is that it could lead to smaller degree

predicates In fact we have seen that the highest degree predicates we get

come from the comparison of the y-coordinates of intersections of conics in

the sweeping plane Decompositions where regions would not be defined byintersections of conics would decrease the degree

Trang 9

The Projection Approach

An alternative approach to constructing arrangements of quadric surfaces inthree-dimensional space is based on projection [178] We sketch the mainideas of the approach below and refer the reader to detailed description oftheoretical and implementation aspects of the method [340], [47]

Independent of the special information about the arrangement of thequadrics one may be interested in, for example, the topological description

of a cell or of the whole arrangement, the basic computation that has to be

carried out in nearly all cases is: For each quadric p, locate and sort all vertices along the intersection curves on the surface of p.

Our approach for solving this problem operates similar to Collins’ cal algebraic decomposition By projection, it reduces the three-dimensionalproblem to the one of computing planar arrangements of algebraic curves We

cylindri-project for each quadric p all its intersection curves with the other quadrics

and additionally its silhouette onto the plane This projection step applied tothe quadrics Fig 1.14 results in the two-dimensional arrangement shown inFig 1.16

3

~g b

b r~

Fig 1.16 Project the intersection curves ˜b and ˜ g of the ellipsoid R with the ellipsoid

B and G, respectively, together with the silhouette ˜ r of R into the plane This leads

to the planar curves b, g, and r

We have to compute the planar arrangement resulting from the projection.All curves of the planar arrangement turn out to be defined by polynomials of

degree at most 4 For example, the curve g is the set of roots of the polynomial

408332484x4+ 51939673y4− 664779204x3y − 24101506y3x

+564185724x2y2− 250019406x3+ 17767644y3

+221120964x2y − 123026916y2x + 16691919x2+ 4764152y2

+14441004xy + 10482900x + 2305740y − 1763465.

Trang 10

The reduction is algebraically optimal in the sense that it does not affectthe algebraic degree of the curves we consider But due to the projection, thecurves in the planar arrangement can have six singular points and two curvescan intersect in up to 16 points The most difficult problem we face stemsfrom the high degree of the algebraic numbers that arise in the computation.For computing the resulting planar arrangements we again must be able

to perform the analysis of a single curve and of a pair of curves The extreme

points of one curve f are, as in the case for cubics, computed by comparing the order of f and f y slightly to the left and slightly to the right of theextreme points For locating the singular points we make use of the fact that

we consider projected quadric intersection curves One can prove that at mosttwo singular points result from the projection in the sense that two non-intersecting branches of the spatial intersection curve are projected on top ofeach other For example, the intersection curve ˜b in Fig 1.16 consists of two

non-intersecting loops They are projected on top of each other causing twoself-intersections We can compute the coordinates of these singular points

as one-root numbers In most cases one can express the coordinates of theremaining singular points as roots of quadratic rational polynomials Only

in the case that the spatial intersection curve consists of four lines do thecoordinates require a second square root

As described earlier in the section about planar arrangements of conicsand cubics, transversal intersection points of two curves are easy to compute

by determining the sequence of hits slightly to the left and slightly to theright of the intersection points Non-singular intersections of multiplicity 2are computed using the additional Jacobi curve already mentioned in the sec-tion about cubics We know that the Jacobi curve cuts transversally throughboth involved curves This fact enables us to reduce the problem of detect-ing tangential intersections of multiplicity 2 to the one of locating transversal

intersections For all remaining non-singular intersections of multiplicity > 2

one can prove that their coordinates are one-root numbers and can thus besolved directly

Parameterizing the Intersection of Two Quadrics

A parallel and complementary work was conducted outside ECG, on the version of object representation from Constructive Solid Geometry (CSG) toBoundary Representation (BRep), motivated by modeling for rendering Afundamental step of this conversion is the computation of the intersection of

con-two primitive volumes Dupont et al presented a robust and optimal algorithm

for the computation of an exact parametric form of the intersection of twoquadrics [128] Their method is based on the projective formalism, techniques

of linear algebra and number theory, and new theorems characterizing therationality of the intersection These theoretical results are major in the sensethat the output solution is a rational parameterization whenever one existsand the coefficients are algebraic numbers with at most one extra square root

Trang 11

Furthermore, for each geometric type of intersection, the number of squareroots in the coefficients is always minimal in the worst case This method isusable in practice (as opposed to the approach of Levin used before [241]).The algorithm was improved later to minimize the size (i.e., the number ofdigits) of the integer coefficients that appear in the parameterizations It wasimplemented in C++ [11] and its practical performance was analyzed [238].

1.6 Controlled Perturbation: Fixed-Precision

Approximation of Arrangements

The approaches taken in recent years to cope with precision and robustnessproblems in geometric computing can be roughly categorized in one of thefollowing two archethemes: (i) exact computing and (ii) fixed-precision ap-proximation The former mimics the real RAM model for certain primitives,whereas the latter adjusts the algorithmic solutions to the standard computerlimited-precision arithmetic

The approach favored by the Cgal project and related projects, as flected also in most of this chapter, is exact computing Exact geometriccomputing has many advantages, among them is solving the precision androbustness problem, giving the ultimate true results, and enabling the tran-scription of the geometric algorithms in the literature if the input is in generalposition

re-However, exact computing has some disadvantages In spite of the constantprogress, it is still slower than machine arithmetic especially when the objectsare non-linear or higher dimensional (beyond curves in the plane) Also, exactcomputing does not solve the degeneracy problem, and if we anticipate inputthat is not in general position, as is often the case in practice, degeneraciesrequire special (and often very tedious) treatment.18

Here we outline a method that has been employed for the robust mentation of arrangements of curves and surfaces while using floating-pointarithmetic The scheme seeks to perturb the input objects slightly such thatafter the perturbation their arrangement is degeneracy free and all the pred-icates that arise in the construction of the arrangement can be accuratelycomputed with the given machine precision Controlled perturbation has beensuccessfully applied to arrangements of circles [198], spheres [200, 153, 154],polygons [279], polyhedral surfaces [292], and more recently to Delaunay tri-angulations [172]

imple-One can view the goal of controlled perturbation as follows We look tomove the input objects slightly from their original placement such that whenconstructing the arrangement of the perturbed objects while using a fixed pre-cision floating-point filter (see, e.g., [251, 346]), the filter will always succeedand we will never need to resort to higher precision or exact computation

18

In Cgal though, the implementation of algorithms for two-dimensional ments do not assume general position and handle degeneracies

Trang 12

arrange-We give an overview of the controlled-perturbation scheme Although theideas that we present here could have been described in a more general setting,and have been applied more generally, we concentrate, for ease of exposition,

on arrangements of circles

The input to the perturbation algorithm is a collectionC = {C1, , C n }

of circles, each circle C i is given by the Cartesian coordinates of its center

(x i , y i ) and its radius r i; we assume that all the input parameters are sentable as floating-point numbers with a given precision The input consists

repre-of three additional parameters: (i) the machine precision p, namely the length

of the mantissa in the floating-point representation, (ii) an upper bound on

the absolute value of each input number x i , y i , and r i , and (iii) ∆ — the

maximum perturbation size allowed.19

For an input circle C i , the perturbation algorithm will output a copy C i 

with the same radius but with its center possibly perturbed We define C j

as the collection of circles {C1, , C j }, and C 

j as the collection of circles

degeneracies occur Once the j-th step of the procedure is completed, we do

not move the circles inC 

jagain We next describe the two key parameters thatgovern the perturbation scheme—the resolution bound and the perturbationbound

Resolution Bound

A degeneracy occurs when a predicate evaluates to zero The goal of theperturbation is to cause all the values of all the predicate expressions (thatarise during the construction of the arrangement of the circles) to become

“significantly non-zero”, namely to be sufficiently far away from zero so thatour limited precision arithmetic could enable us to safely determine whetherthey are positive or negative

Fig 1.17 Outer tangency —

two circles (bounding disjoint disks) intersect in asingle point

interior-The degeneracies that arise in arrangements

of circles have a natural geometric

characteri-zation as incidences For example, in outer

tan-gency (Fig 1.17), two circles intersect in a single

point We transform the requirement that the

predicates will evaluate to

sufficiently-far-from-zero values into a geometric distance

Ngày đăng: 10/08/2014, 02:20