Efficient Clipping of Arbitrary Polygons
|
|
- Rudolf Small
- 5 years ago
- Views:
Transcription
1 Efficient lipping of Arbitrary Polygons Günther Greiner Kai Hormann omputer Graphics Group, University of Erlangen Abstract lipping 2D polygons is one of the basic routines in computer graphics. In rendering complex 3D images it has to be done several thousand times. Efficient algorithms are therefore very important. We present such an efficient algorithm for clipping arbitrary 2D polygons. The algorithm can handle arbitrary closed polygons, specifically where the clip and subject polygons may selfintersect. The algorithm is simple and faster than Vatti s [] algorithm, which was designed for the general case as well. imple modifications allow determination of union and set-theoretic difference of two arbitrary polygons. R ategories: I.3.3 [omputer Graphics]: Picture/Image Generation Display Algorithms I.3.5 [omputer Graphics]: omputational Geometry and Object Modelling Keywords: lipping, Polygon omparison Introduction lipping 2D polygons is a fundamental operation in image synthesis. For example, it can be used to render 3D images through hidden surface removal [0], or to distribute the objects of a scene to appropriate processors in a multiprocessor ray tracing system. everal very efficient algorithms are available for special cases: utherland and Hodgeman s algorithm [4, 0] is limited to convex clip polygons. That of Liang and Barsky [4, 5] require that the clip polygon be rectangular. More general algorithms were presented in [, 6, 8, 9, 3]. They allow concave polygons with holes, but they do not permit self-intersections, which may occur, e.g., by projecting warped quadrilaterals into the plane. For the general case of arbitrary polygons (i.e., neither the clip nor the subject polygon is convex, both polygons may have selfintersections), little is known. To our knowledge, only the Weiler algorithm [2, 4] and Vatti s algorithm [] can handle the general case in reasonable time. Both algorithms are quite complicated. In this paper we present an algorithm for the clipping of arbitrary polygons, that is conceptually simple, for example, the data structure for the polygons we use is less complex. While in Weiler s algorithm the input polygons are combined into a single graph structure, we represent all polygons (input as well as output) as doubly linked lists. In all three approaches all the intersections between the two input polygons have to be determined first (in Vatti s algorithm, self-intersections of each input polygon as well). Merging these intersection points into the data structure is the decisive step. We think that our approach is more intuitive and considerably simpler than Weiler s algorithm. Finally, we obtain each output polygon by a simple traversal of the (modified) input polygons. In Weiler s algorithm, traversals of the tree are necessary. A runtime comparison with Vatti s algorithm is given in the final section. Weiler s algorithm as well as the one presented here can also determine other Boolean operations of two arbitrary polygons: union and set-theoretic difference. greiner@cs.fau.de hormann@cs.fau.de This paper is organized as follows. In the next section we specify what the interior of an arbitrary polygon is. In ection 3 we outline the basic concept of the algorithm. We then describe the data structure used to represent polygons in ection 4. In ection 5 we describe how the intersection points are merged into the data structure and give details of the implementation. In the final section, results are discussed and compared to Vatti s algorithm. 2 Basics A closed polygon P is described by the ordered set of its vertices P 0,P,P 2,...,P n = P 0. It consists of all line segments consecutively connecting the points P i, i.e. P 0P, P P 2,...,P n P n = P n P 0. For a convex polygon it is quite simple to specify the interior and the exterior. However, since we allow polygons with selfintersections we must specify more carefully what the interior of such a closed polygon is. We base the definition on the winding number [4]. For a closed curve γ and a point A not lying on the curve, the winding number ω(γ,a) tells how often a ray centered at A and moving once along the whole closed curve winds around A, counting counterclockwise windings by + and clockwise windings by (see Figure ). The winding number has several important properties: When A is moved continuously and/or the curve γ is deformed continuously in such a way that A always keeps a positive distance to γ, the winding number will not change. For a fixed curve γ the winding number ω(γ, ) is constant on each component of the complement IR 2 \ γ. Moreover, if A lies in the unbounded component of IR 2 \γ then ω(γ,a)=0. If A moves and thereby crosses the curve once, the winding number decreases or increases by exactly. The third statement is the basis for the algorithm presented below. It can be derived from the first as is illustrated in Figure 2. The interior of a closed curve (e.g., a closed polygon) now is defined as follows: Definition A point A lies in the interior of the closed curve γ if and only if the winding number ω(γ,a) is odd. This definition and the third property of the winding number stated above then imply the following: A path that intersects the polygon exactly once traverses either from the interior to the exterior of the polygon, or vice versa. A γ Figure : Winding number: ω(γ,a)= 2π dϕ. ϕ
2 γ add circle γ A Ã ω ω ω+ ω+ Figure 2: hange of the winding number when a point crosses the curve. (a) (b) (c) (d) Figure 3: Winding numbers ( 0) and interior for an arbitrarily complex polygon. This property leads to an efficient algorithm to detect whether a point lies inside or outside a polygon, namely the even-odd rule (see [4]). In Figure 3 the winding numbers and the interior of a closed polygon are shown. Given two polygons, a clip (clipper) and a subject polygon (clippee), the clipped polygon consists of all points interior to the clip polygon that lie inside the subject polygon. This set will be a polygon or a set of polygons. Thus, clipping a polygon against another polygon means determining the intersection of two polygons. In general, this intersection consists of several closed polygons. Instead of intersection, one can perform other Boolean operations (to the interior): e.g., union and set-theoretic difference. (see Figure 5). 3 General oncept The process of clipping an arbitrary polygon against another arbitrary polygon can be reduced to finding those portions of the boundary of each polygon that lie inside the other polygon. These partial boundaries can then be connected to form the final clipped polygon. To clarify this, consider the example in Figure 4 where the task is to clip the polygon with the dotted lines (referred to as the subject polygon ) against the polygon with the broken lines (referred to as the clip polygon ). We start by determining which parts of the subject polygon boundary lie inside the clip polygon (Figure 4.c). We can find those parts by considering the following analogous situation: Imagine pushing a chalk cart along the subject polygon boundary. We start at some vertex of the polygon, and open the distribu- Figure 4: Example of clipping a subject polygon against a clip polygon. The lower row shows parts of subject polygon inside clip polygon ( int) and parts of clip polygon inside the subject polygon ( int), respectively. tion hatch at the start if the vertex lies inside the clip polygon. Then we push the cart along the subject polygon toggling the position of the hatch (open/closed) whenever we cross an edge of the clip polygon. We stop when we reach our starting vertex. Then the parts of the subject polygon that lie inside the clip polygon will be marked with chalk. We use the same technique, but this time running our chalk cart along the clip polygon in order to discover those parts of the clip polygon that lie inside the subject polygon (Figure 4.d): Once we have found all those parts of the polygon edges that lie inside the other polygon, we merge these parts to obtain the clipped polygon (Figure 4.b). The process of merging is easy, considering the fact that each part of the subject polygon that will be in the outcome is bounded by two intersection points of subject and clip polygon. These vertices are also the beginning or end of one of the clip polygon s relevant parts. Therefore, if you keep track of the intersection points and the parts they come from, connecting the supporting parts in the correct order is easy and shown in ection 5. et-theoretic difference and the union of the two polygons can also be calculated by making the following modification to the algorithm. To determine \, one first marks the parts of the subject polygon that are exterior to the clip polygon. These will be merged with the relevant parts of the clip polygon. The procedure is illustrated in the left part of Figure 5. Determination of the union is sketched in the middle of Figure 5 and the right part shows how the difference \ can be obtained.
3 int ext ext int \ \ Figure 5: et theoretic differences and union of two polygons 4 Data structures Our algorithm requires a data structure for representing polygons. As shown later, a doubly linked list of nodes is most suitable. Each node represents one of the polygon s vertices and contains the following information: vertex = { x, y : coordinates; next, prev : vertexptr; nextpoly : vertexptr; intersect : boolean; : vertexptr; alpha : float; _ : boolean; } Figure 6: Vertex data structure. Normally a vertex only needs x and y to store its coordinates and next and prev as links to the ing vertices. As the clipping process may result in a set of n polygons (P,...,P n), we use nextpoly to be able to handle a linked list of polygons, i.e., we let the nextpoly pointer of the first vertex of the k-th polygon (P k,0 nextpoly) point at the first vertex of the (k +)th polygon P k+,0, k =,...,n. The remaining fields (intersect,, alpha, ) are used internally by the algorithm. Intersection points of subject and clip polygon are marked by the intersect flag. During execution of the algorithm, all intersection points will be determined and two copies, linked by the pointer, will be inserted into the data structures of both the subject and the clip polygon. That means, the intersection point which is inserted into the subject polygon s data structure will be connected to the one inserted into the clip polygon s data structure using the pointer and vice versa. To accelerate the sorting process, we store an alpha-value indicating where the intersection point lies relatively to start and end point of the edge. Remembering the chalk cart analogy we also need an flag to record whether the intersecting point is an or an point to the other polygon s interior. Figure 7 shows an example clipping problem and the data structure generated by the algorithm. 5 The algorithm The algorithm operates in three phases: In phase one (see Figure 8), we search for all intersection points by testing whether each edge of the subject polygon and each of the clip polygon intersect or not. If they do, the intersection routine (Figure ) will deliver two numbers between 0 and, the alphavalues, which indicate where the intersection point lies relatively to
4 2 4 I4 4 2 I3 I2 I clip polygon 2 3 I I2 I3 I4 4 next last I 2 I2 3 I3 4 I4 5 subject polygon clipped polygon I I 2 I2 nextpoly I3 4 I4 Figure 7: Data structure for polygons. for each vertex i of subject polygon do for each vertex j of clip polygon do if intersect (i,i+,j,j+,a,b) I = reatevertex(i,i+,a) I2 = reatevertex(j,j+,b) link intersection points I and I2 sort I into subject polygon sort I2 into clip polygon Figure 8: Pseudo-code for phase one. start and end point of both edges. With respect to these alphavalues, we create new vertices and insert them into the data structures of subject and clip polygon between the start and end point of the edges that intersect. If no intersection points are detected we know that either the subject polygon lies entirely inside the clip polygon or vice versa or that both polygons are disjoint. By performing the even-odd rule we can easily decide which case we have and simply return either the inner polygon as the clipped polygon or nothing at all. Phase two (see Figure 9) is analogous to the chalk cart in ection 3. We trace each polygon once and mark and points to the other polygon s interior. We start at the polygon s first vertex and detect using the even-odd rule whether this point lies inside the other polygon or not. Then we move along the polygon vertices and mark the intersecting points that have been inserted in phase one (and marked by the intersect flag) alternately as and points respectively. for both polygons P do if P0 inside other polygon status = else status = for each vertex Pi of polygon do if Pi->intersect then Pi->_ = status toggle status Figure 9: Pseudo ode for phase two. In phase three (see Figure 0) we create the desired clipped polygon by filtering it out of the enhanced data structures of subject and clip polygon. In order to build the clipped polygon we use two routines: newpolygon and newvertex. newpolygon registers the beginning of a new polygon while the vertices of that polygon are transferred by newvertex; for example, the sequence newpolygon newvertex (A) newvertex (B) newvertex () newpolygon newvertex (D) newvertex (E) newvertex (F) newvertex (G)
5 while unprocessed intersecting points in subject polygon current = first unprocessed intersecting point of subject polygon newpolygon newvertex (current) repeat if current-> repeat current = current->next newvertex (current) until current->intersect else repeat current = current->prev newvertex (current) until current->intersect current = current-> until Polygonlosed end while Figure 0: Pseudo-code for part three. intersect(p,p2,q,q2,alphap,alphaq) WE_P = <P - Q (Q2 - Q) > WE_P2 = <P2 - Q (Q2 - Q) > if (WE_P*WE_P2 <= 0) WE_Q = <Q - P (P2 - P) > WE_Q2 = <Q2 - P (P2 - P) > if (WE_Q*WE_Q2 <= 0) alphap = WE_P/(WE_P - WE_P2) alphaq = WE_Q/(WE_Q - WE_Q2) return (); return (0) end intersect Figure : Pseudo-code for the intersection. generates a set of two Polygons P = AB and P 2 = DEFG and A nextpoly points at D. To illustrate the pseudo-code of phase three (Figure 0) we use our chalk cart again, here called current. First we place it at one of the intersection points. ince we want to mark the clipped polygon we open the hatch (newpolygon) and move the cart along the subject polygon s edge into the interior of the clip polygon. The flag tells us which direction to choose: means forward direction (next) while signals us to go backward (prev). Each time we reach a vertex we remember it by calling newvertex. We leave the clip polygon s interior as soon as we come to the next intersection point. This is where we turn the cart (current = current->) in order to move along the clip polygon s edges. Again the flag tells us which route leads to the other polygon s interior. We continue this process until we arrive at the starting vertex and close the hatch (and the polygon). If there are still intersection points that have not yet been chalked (i.e., the clipped polygon is a set of polygons) we move the chalk cart there and repeat the whole procedure until there are no unmarked intersection points left. Q P Q 2 Figure 2: Two degenerate configurations (left and right) and two possible perturbations for each example (upper and lower row). learly finding the intersection of two lines, say P P 2 and Q Q 2, is a basic operation of the algorithm. This can be done effectively in the following way. Determine window edge coordinates, outcodes and α-values (see [3, 4]) of P i with respect to Q Q 2 and, if necessary, also for Q i with respect to P P 2. By this algorithm, many cases where there is no intersection will be detected early. When there is an intersection, the procedure intersect (Figure ) will return the α-values alphap and alphaq for the point of intersection with respect to P P 2 and Q Q 2 respectively. o far, we tacitly assumed that there are no degeneracies, i.e., each vertex of one polygon does not lie on an edge of the other polygon (see also [2]). Degeneracies can be detected in the intersect procedure. For example, P lies on the line Q Q 2 if and only if alphap =0and 0 alphaq. In this case, we perturb P slightly such that for the perturbed point P we have alphap 0. We allow the algorithm to continue, replacing P with P. Two typical examples are given in Figure 2. For each case two possible perturbations are sketched. If we take care that the perturbation is less than pixel width, the output on the screen will be correct. 6 Evaluation Both Vatti s algorithm and the one presented here have been implemented in on a ilicon Graphics Indigo work station. Given an integer n, a subject and a clip polygon with n vertices were generated at random and clipped against one other, first using Vatti s algorithm and then the on described above. This was done a thousand times, and the running times of both algorithms were recorded. The resulting average times (in ms) are listed in columns two and three of Table. The improvement factors of our method over Vatti s algorithm are shown in the next column. The table demonstrates that the improvement factor increases with the size of n. An explanation for that will be given below. As explained above, the intersection points of subject and clip polygon are part of the clipped polygon, hence there is no way to avoid calculating them. In order to illustrate the typical number of intersections, we recorded them for each trial. The averages of these numbers are listed in the last column of Table. Inspecting these values, we observe that they grow with n 2. Figure 3 shows that if we have a polygon with n edges and another with m edges, the number of intersections can be nm in the worst case. o the aver- Q P Q 2
6 n Vatti New Algorithm Improvement Intersections Table : Results of the implementation. References [] Andreev, R. D. Algorithm for clipping arbitrary polygons. omput. Graph. Forum 8 (989), 83 9 [2] Blinn, J. Fractional Invisibility. IEEE omput. Graph. Appl. 8 (988), [3] Blinn, J. Line lipping. IEEE omput. Graph. Appl. (99), [4] Foley, J. D., A. van Dam,. K. Feiner, and J. F. Hughes. omputer Graphics, Principles and Practice. Addison-Wesley, Reading, MA, 990 [5] Liang, Y. and B. A. Barsky. An analysis and algorithm for polygon clipping. ommun. AM 26 (983), [6] Montani,. and M. Re. Vector and raster hidden surface removal using parallel connected stripes. IEEE omput. Graph. Appl. 7 (987), 4 23 Figure 3: Worst case for intersection of two polygons. [7] Preparata, F. P. and M. I. hamos. omputational Geometry: An Introduction. pringer, New York, NY, 985 [8] Rappaport, A. An efficient algorithm for line and polygon clipping. Visual omput. 7 (99), 9 28 [9] echrest,. and D. Greenberg. A visible polygon reconstruction algorithm. omput. Graph. 5 (98), 7 26 [0] utherland E. E. and G. W. Hodgeman. Reentrant polygon clipping. ommun. AM 7 (974), [] Vatti, B. R. A generic solution to polygon clipping. ommun. AM 35 (992), Figure 4: Worst case for self-intersection. age number of intersections grows by the order of O(nm). There is a well-known result in computational geometry based on the plane sweep algorithm, which says that if there are N line segments generating k intersections, then these intersections can be reported in time O((N + k)log(n)) [7]. Note that this relation yields an even worse comply in the worst case. ince the computation of the intersections involves floating point operations, it is a complex task compared to the remaining work that has to be done by the algorithm (sorting, pointer assignments, etc.). Measurements revealed that intersection calculation accounts for roughly 80% of the running time. onsequently, any clipping algorithm supporting arbitrary polygons must have comply O(nm) with n and m being the edge numbers of the polygons. This statement is confirmed by the average timings of both algorithms. The reason for the poorer performance of Vatti s algorithm is that it also has to compute the self-intersection points of both polygons. Figure 4 indicates that the number of self-intersection points for a polygon with n edges can be O(n 2 ) in the worst case. This might be the reason why the improvement factor of our algorithm (compared to Vatti s algorithm) grows with increasing number of edges. [2] Weiler, K. Polygon comparison using a graph representation. In IGGRAPH 80 (980), 0 8 [3] Weiler, K. and P. Atherton. Hidden surface removal using polygon area sorting. In IGGRAPH 77 (977), Acknowledgments The authors wish to thank the anonymous referees for their critical comments which helped to improve this paper.
Computer Graphics. - Clipping - Philipp Slusallek & Stefan Lemme
Computer Graphics - Clipping - Philipp Slusallek & Stefan Lemme Clipping Motivation Projected primitive might fall (partially) outside of the visible display window E.g. if standing inside a building Eliminate
More informationPart IV. 2D Clipping
Part IV 2D Clipping The Liang-Barsky algorithm Boolean operations on polygons Outline The Liang-Barsky algorithm Boolean operations on polygons Clipping The goal of clipping is mainly to eliminate parts
More informationCS452/552; EE465/505. Clipping & Scan Conversion
CS452/552; EE465/505 Clipping & Scan Conversion 3-31 15 Outline! From Geometry to Pixels: Overview Clipping (continued) Scan conversion Read: Angel, Chapter 8, 8.1-8.9 Project#1 due: this week Lab4 due:
More informationFROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU
FROM VERTICES TO FRAGMENTS Lecture 5 Comp3080 Computer Graphics HKBU OBJECTIVES Introduce basic implementation strategies Clipping Scan conversion OCTOBER 9, 2011 2 OVERVIEW At end of the geometric pipeline,
More informationFrom Vertices To Fragments-1
From Vertices To Fragments-1 1 Objectives Clipping Line-segment clipping polygon clipping 2 Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives
More informationClipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling
Clipping & Culling Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling Lecture 11 Spring 2015 What is Clipping? Clipping is a procedure for spatially partitioning geometric primitives,
More information(Refer Slide Time: 00:02:00)
Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 18 Polyfill - Scan Conversion of a Polygon Today we will discuss the concepts
More informationChapter 8: Implementation- Clipping and Rasterization
Chapter 8: Implementation- Clipping and Rasterization Clipping Fundamentals Cohen-Sutherland Parametric Polygons Circles and Curves Text Basic Concepts: The purpose of clipping is to remove objects or
More informationExamples. Clipping. The Rendering Pipeline. View Frustum. Normalization. How it is done. Types of operations. Removing what is not seen on the screen
Computer Graphics, Lecture 0 November 7, 006 Eamples Clipping Types of operations Accept Reject Clip Removing what is not seen on the screen The Rendering Pipeline The Graphics pipeline includes one stage
More informationTwo-Dimensional Viewing. Chapter 6
Two-Dimensional Viewing Chapter 6 Viewing Pipeline Two-Dimensional Viewing Two dimensional viewing transformation From world coordinate scene description to device (screen) coordinates Normalization and
More informationMIT EECS 6.837, Teller and Durand 1
MIT EECS 6.837, Teller and Durand 1 Clipping MIT EECS 6.837 Frédo Durand and Seth Teller Some slides and images courtesy of Leonard McMillan MIT EECS 6.837, Teller and Durand 2 Administrative Assignment
More informationDetermining Differences between Two Sets of Polygons
Determining Differences between Two Sets of Polygons MATEJ GOMBOŠI, BORUT ŽALIK Institute for Computer Science Faculty of Electrical Engineering and Computer Science, University of Maribor Smetanova 7,
More informationOverview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal
Overview Pipeline implementation I Preliminaries Clipping Line clipping Hidden Surface removal Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives
More informationTopics. From vertices to fragments
Topics From vertices to fragments From Vertices to Fragments Assign a color to every pixel Pass every object through the system Required tasks: Modeling Geometric processing Rasterization Fragment processing
More informationComputer Science 474 Spring 2010 Viewing Transformation
Viewing Transformation Previous readings have described how to transform objects from one position and orientation to another. One application for such transformations is to create complex models from
More informationLine segment intersection. Family of intersection problems
CG Lecture 2 Line segment intersection Intersecting two line segments Line sweep algorithm Convex polygon intersection Boolean operations on polygons Subdivision overlay algorithm 1 Family of intersection
More informationCSCI 4620/8626. Computer Graphics Clipping Algorithms (Chapter 8-5 )
CSCI 4620/8626 Computer Graphics Clipping Algorithms (Chapter 8-5 ) Last update: 2016-03-15 Clipping Algorithms A clipping algorithm is any procedure that eliminates those portions of a picture outside
More informationComputer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 24 Solid Modelling
Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 24 Solid Modelling Welcome to the lectures on computer graphics. We have
More informationPractical Linear Algebra: A Geometry Toolbox
Practical Linear Algebra: A Geometry Toolbox Third edition Chapter 18: Putting Lines Together: Polylines and Polygons Gerald Farin & Dianne Hansford CRC Press, Taylor & Francis Group, An A K Peters Book
More informationCOMP30019 Graphics and Interaction Scan Converting Polygons and Lines
COMP30019 Graphics and Interaction Scan Converting Polygons and Lines Department of Computer Science and Software Engineering The Lecture outline Introduction Scan conversion Scan-line algorithm Edge coherence
More informationClipping and Intersection
Clipping and Intersection Clipping: Remove points, line segments, polygons outside a region of interest. Need to discard everything that s outside of our window. Point clipping: Remove points outside window.
More information2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into
2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into the viewport of the current application window. A pixel
More informationLine Arrangement. Chapter 6
Line Arrangement Chapter 6 Line Arrangement Problem: Given a set L of n lines in the plane, compute their arrangement which is a planar subdivision. Line Arrangements Problem: Given a set L of n lines
More informationPolygon Filling. Can write frame buffer one word at time rather than one bit. 2/3/2000 CS 4/57101 Lecture 6 1
Polygon Filling 2 parts to task which pixels to fill what to fill them with First consider filling unclipped primitives with solid color Which pixels to fill consider scan lines that intersect primitive
More informationA Procedure to Clip Line Segment
Vol.5, No.1 (2014), pp.9-20 http://dx.doi.org/10.14257/ijcg.2014.5.1.02 A Procedure to Clip Line Segment Bimal Kumar Ray School of Information Technology & Engineering VIT University, Vellore 632014, India
More information3D Rendering Pipeline (for direct illumination)
Clipping 3D Rendering Pipeline (for direct illumination) 3D Primitives 3D Modeling Coordinates Modeling Transformation Lighting 3D Camera Coordinates Projection Transformation Clipping 2D Screen Coordinates
More informationγ 2 γ 3 γ 1 R 2 (b) a bounded Yin set (a) an unbounded Yin set
γ 1 γ 3 γ γ 3 γ γ 1 R (a) an unbounded Yin set (b) a bounded Yin set Fig..1: Jordan curve representation of a connected Yin set M R. A shaded region represents M and the dashed curves its boundary M that
More informationLecture 3: Art Gallery Problems and Polygon Triangulation
EECS 396/496: Computational Geometry Fall 2017 Lecture 3: Art Gallery Problems and Polygon Triangulation Lecturer: Huck Bennett In this lecture, we study the problem of guarding an art gallery (specified
More informationIllumination Models III: Ray Tracing (View Dependent Global Illumination)
Illumination Models III: Ray Tracing (View Dependent Global Illumination) The University of Texas at Austin 1 Basic Definitions Ray Tracing/Casting: Setting: eyepoint, virtual screen (an array of virtual
More informationComputer Graphics. The Two-Dimensional Viewing. Somsak Walairacht, Computer Engineering, KMITL
Computer Graphics Chapter 6 The Two-Dimensional Viewing Somsak Walairacht, Computer Engineering, KMITL Outline The Two-Dimensional Viewing Pipeline The Clipping Window Normalization and Viewport Transformations
More informationLecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13
Lecture 17: Solid Modeling... a cubit on the one side, and a cubit on the other side Exodus 26:13 Who is on the LORD's side? Exodus 32:26 1. Solid Representations A solid is a 3-dimensional shape with
More informationSolutions to problem set 1
Massachusetts Institute of Technology Handout 5 6.838: Geometric Computation October 4, 2001 Professors Piotr Indyk and Seth Teller Solutions to problem set 1 (mostly taken from the solution set of Jan
More informationClipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015
Clipping 1 Objectives Clipping lines First of implementation algorithms Clipping polygons (next lecture) Focus on pipeline plus a few classic algorithms 2 Clipping 2D against clipping window 3D against
More informationComputational Geometry
Lecture 1: Introduction and convex hulls Geometry: points, lines,... Geometric objects Geometric relations Combinatorial complexity Computational geometry Plane (two-dimensional), R 2 Space (three-dimensional),
More informationClipping and Scan Conversion
15-462 Computer Graphics I Lecture 14 Clipping and Scan Conversion Line Clipping Polygon Clipping Clipping in Three Dimensions Scan Conversion (Rasterization) [Angel 7.3-7.6, 7.8-7.9] March 19, 2002 Frank
More informationLet s start with occluding contours (or interior and exterior silhouettes), and look at image-space algorithms. A very simple technique is to render
1 There are two major classes of algorithms for extracting most kinds of lines from 3D meshes. First, there are image-space algorithms that render something (such as a depth map or cosine-shaded model),
More informationThe Geometry of Carpentry and Joinery
The Geometry of Carpentry and Joinery Pat Morin and Jason Morrison School of Computer Science, Carleton University, 115 Colonel By Drive Ottawa, Ontario, CANADA K1S 5B6 Abstract In this paper we propose
More informationS U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T
S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T Copyright 2018 Sung-eui Yoon, KAIST freely available on the internet http://sglab.kaist.ac.kr/~sungeui/render
More informationClipping a Mesh Against a Plane
Clipping a Mesh Against a Plane David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International License. To
More informationPreferred directions for resolving the non-uniqueness of Delaunay triangulations
Preferred directions for resolving the non-uniqueness of Delaunay triangulations Christopher Dyken and Michael S. Floater Abstract: This note proposes a simple rule to determine a unique triangulation
More informationConstructing a Cycle Basis for a Planar Graph
Constructing a Cycle Basis for a Planar Graph David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International
More informationEULER S FORMULA AND THE FIVE COLOR THEOREM
EULER S FORMULA AND THE FIVE COLOR THEOREM MIN JAE SONG Abstract. In this paper, we will define the necessary concepts to formulate map coloring problems. Then, we will prove Euler s formula and apply
More informationCS S Lecture February 13, 2017
CS 6301.008.18S Lecture February 13, 2017 Main topics are #Voronoi-diagrams, #Fortune. Quick Note about Planar Point Location Last week, I started giving a difficult analysis of the planar point location
More informationCSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012
CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Homework project #2 due this Friday, October
More informationGraphics and Interaction Rendering pipeline & object modelling
433-324 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Lecture outline Introduction to Modelling Polygonal geometry The rendering
More informationSimultaneously flippable edges in triangulations
Simultaneously flippable edges in triangulations Diane L. Souvaine 1, Csaba D. Tóth 2, and Andrew Winslow 1 1 Tufts University, Medford MA 02155, USA, {dls,awinslow}@cs.tufts.edu 2 University of Calgary,
More informationGraphics (Output) Primitives. Chapters 3 & 4
Graphics (Output) Primitives Chapters 3 & 4 Graphic Output and Input Pipeline Scan conversion converts primitives such as lines, circles, etc. into pixel values geometric description a finite scene area
More informationRenderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005
INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Renderer Implementation: Basics and Clipping David Carr Virtual Environments, Fundamentals Spring 2005 Feb-28-05 SMM009, Basics and Clipping 1
More information[Ba] Bykat, A., Convex hull of a finite set of points in two dimensions, Info. Proc. Lett. 7 (1978),
[Ba] Bykat, A., Convex hull of a finite set of points in two dimensions, Info. Proc. Lett. 7 (1978), 296-298. [Ch] [CI] [EET] [ET] [FM] [GJPT] [Gr] [HM] [KKT] Chazelle, B., A theorem on polygon cutting
More informationComputer Graphics. - Rasterization - Philipp Slusallek
Computer Graphics - Rasterization - Philipp Slusallek Rasterization Definition Given some geometry (point, 2D line, circle, triangle, polygon, ), specify which pixels of a raster display each primitive
More informationElementary Planar Geometry
Elementary Planar Geometry What is a geometric solid? It is the part of space occupied by a physical object. A geometric solid is separated from the surrounding space by a surface. A part of the surface
More informationVISIBILITY & CULLING. Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH
VISIBILITY & CULLING Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH Visibility Visibility Given a set of 3D objects, which surfaces are visible from a specific point
More informationChapter 4. Chapter 4. Computer Graphics 2006/2007 Chapter 4. Introduction to 3D 1
Chapter 4 Chapter 4 Chapter 4. Introduction to 3D graphics 4.1 Scene traversal 4.2 Modeling transformation 4.3 Viewing transformation 4.4 Clipping 4.5 Hidden faces removal 4.6 Projection 4.7 Lighting 4.8
More informationNotes and Answers to Homework Exam 1, Geometric Algorithms, 2017
Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017 Below are some notes and sketches of correct answers for the first homework exam. We have also included the most common mistakes that were
More informationLast class. A vertex (w x, w y, w z, w) - clipping is in the - windowing and viewport normalized view volume if: - scan conversion/ rasterization
Lecture 6 Last class Last lecture (clip coordinates): A vertex (w x, w y, w z, w) - clipping is in the - windowing and viewport normalized view volume if: - scan conversion/ rasterization normalized view
More information1/60. Geometric Algorithms. Lecture 1: Introduction. Convex Hulls
1/60 Geometric Algorithms Lecture 1: Introduction Convex Hulls Geometric algorithms scope 2/60 Geometry algorithms (practice): Study of geometric problems that arise in various applications and how algorithms
More informationMath 451: Euclidean and Non-Euclidean Geometry MWF 3pm, Gasson 204 Homework 8 Solutions
Math 451: Euclidean and Non-Euclidean Geometry MWF 3pm, Gasson 204 Homework 8 Solutions Exercises from Chapter 2: 5.5, 5.10, 5.13, 5.14 Exercises from Chapter 3: 1.2, 1.3, 1.5 Exercise 5.5. Give an example
More informationA Simple Algorithm for Computing BOCP
A Simple Algorithm for Computing BOCP 1 Jack Wang Abstract arxiv:1211.0729v8 [cs.ds] 3 Jul 2018 In this article, we devise a concise algorithm for computing BOCP. Our method is simple, easyto-implement
More informationAn Efficient Visual Hull Computation Algorithm
An Efficient Visual Hull Computation Algorithm Wojciech Matusik Chris Buehler Leonard McMillan Laboratory for Computer Science Massachusetts institute of Technology (wojciech, cbuehler, mcmillan)@graphics.lcs.mit.edu
More informationComputational Geometry
Casting a polyhedron CAD/CAM systems CAD/CAM systems allow you to design objects and test how they can be constructed Many objects are constructed used a mold Casting Casting A general question: Given
More informationComputational Geometry
Motivation Motivation Polygons and visibility Visibility in polygons Triangulation Proof of the Art gallery theorem Two points in a simple polygon can see each other if their connecting line segment is
More informationAnnouncements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics
Announcements Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class 1 Scan Conversion Overview of Rendering Scan Conversion Drawing Lines Drawing Polygons
More informationBackground for Surface Integration
Background for urface Integration 1 urface Integrals We have seen in previous work how to define and compute line integrals in R 2. You should remember the basic surface integrals that we will need to
More informationCMSC 754 Computational Geometry 1
CMSC 754 Computational Geometry 1 David M. Mount Department of Computer Science University of Maryland Fall 2005 1 Copyright, David M. Mount, 2005, Dept. of Computer Science, University of Maryland, College
More informationCOMP30019 Graphics and Interaction Rendering pipeline & object modelling
COMP30019 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Lecture outline Introduction to Modelling Polygonal geometry The rendering
More informationPolygon Triangulation
Polygon Triangulation Definition Simple Polygons 1. A polygon is the region of a plane bounded by a finite collection of line segments forming a simple closed curve. 2. Simple closed curve means a certain
More informationLecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling
Lecture outline COMP30019 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Introduction to Modelling Polygonal geometry The rendering
More informationChapter 4 Determining Cell Size
Chapter 4 Determining Cell Size Chapter 4 Determining Cell Size The third tutorial is designed to give you a demonstration in using the Cell Size Calculator to obtain the optimal cell size for your circuit
More informationComputational Geometry. Geometry Cross Product Convex Hull Problem Sweep Line Algorithm
GEOMETRY COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges books. Computational
More informationUnit 1, Lesson 1: Moving in the Plane
Unit 1, Lesson 1: Moving in the Plane Let s describe ways figures can move in the plane. 1.1: Which One Doesn t Belong: Diagrams Which one doesn t belong? 1.2: Triangle Square Dance m.openup.org/1/8-1-1-2
More information: Mesh Processing. Chapter 8
600.657: Mesh Processing Chapter 8 Handling Mesh Degeneracies [Botsch et al., Polygon Mesh Processing] Class of Approaches Geometric: Preserve the mesh where it s good. Volumetric: Can guarantee no self-intersection.
More informationTriangulation by Ear Clipping
Triangulation by Ear Clipping David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International License. To
More informationAn Efficient Algorithm for Boolean Operation on Circular-arc Polygons
An Efficient Algorithm for Boolean Operation on Circular-arc Polygons Zhi Jie Wang 1,, Xiao Lin 1, Bin Yao 1,, Yong-Xi Gong 2, and Mei-e Fang 3 1 Department of Computer Science and Engineering, Shanghai
More informationA New Algorithm for Pyramidal Clipping of Line Segments in E 3
A New Algorithm for Pyramidal Clipping of Line Segments in E 3 Vaclav Skala 1, Duc Huy Bui Department of Informatics and Computer Science 2 University of West Bohemia Univerzitni 22, Box 314 306 14 Plzen
More informationCS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15
Describing Shapes Constructing Objects in Computer Graphics 1/15 2D Object Definition (1/3) Lines and polylines: Polylines: lines drawn between ordered points A closed polyline is a polygon, a simple polygon
More informationFigure 2.1: An example of a convex set and a nonconvex one.
Convex Hulls 2.1 Definitions 2 Convexity is the key to understanding and simplifying geometry, and the convex hull plays a role in geometry akin to the sorted order for a collection of numbers. So what
More informationEinführung in Visual Computing
Einführung in Visual Computing 186.822 Rasterization Werner Purgathofer Rasterization in the Rendering Pipeline scene objects in object space transformed vertices in clip space scene in normalized device
More informationOn the perimeter of k pairwise disjoint convex bodies contained in a convex set in the plane
On the perimeter of k pairwise disjoint convex bodies contained in a convex set in the plane Rom Pinchasi August 2, 214 Abstract We prove the following isoperimetric inequality in R 2, conjectured by Glazyrin
More informationGeometric Modeling Mortenson Chapter 11. Complex Model Construction
Geometric Modeling 91.580.201 Mortenson Chapter 11 Complex Model Construction Topics Topology of Models Connectivity and other intrinsic properties Graph-Based Models Emphasize topological structure Boolean
More informationComputer Graphics Geometry and Transform
! Computer Graphics 2014! 5. Geometry and Transform Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2014-10-11! Today outline Triangle rasterization Basic vector algebra ~ geometry! Antialiasing
More informationpine cone Ratio = 13:8 or 8:5
Chapter 10: Introducing Geometry 10.1 Basic Ideas of Geometry Geometry is everywhere o Road signs o Carpentry o Architecture o Interior design o Advertising o Art o Science Understanding and appreciating
More informationRealtime 3D Computer Graphics Virtual Reality
Realtime 3D Computer Graphics Virtual Reality From Vertices to Fragments Overview Overall goal recapitulation: Input: World description, e.g., set of vertices and states for objects, attributes, camera,
More informationSpatial Data Structures
15-462 Computer Graphics I Lecture 17 Spatial Data Structures Hierarchical Bounding Volumes Regular Grids Octrees BSP Trees Constructive Solid Geometry (CSG) April 1, 2003 [Angel 9.10] Frank Pfenning Carnegie
More informationDefinition 1 (Hand-shake model). A hand shake model is an incidence geometry for which every line has exactly two points.
Math 3181 Dr. Franz Rothe Name: All3181\3181_spr13t1.tex 1 Solution of Test I Definition 1 (Hand-shake model). A hand shake model is an incidence geometry for which every line has exactly two points. Definition
More informationEXTERNAL VISIBILITY. 1. Definitions and notation. The boundary and interior of
PACIFIC JOURNAL OF MATHEMATICS Vol. 64, No. 2, 1976 EXTERNAL VISIBILITY EDWIN BUCHMAN AND F. A. VALENTINE It is possible to see any eleven vertices of an opaque solid regular icosahedron from some appropriate
More informationSolid Modelling. Graphics Systems / Computer Graphics and Interfaces COLLEGE OF ENGINEERING UNIVERSITY OF PORTO
Solid Modelling Graphics Systems / Computer Graphics and Interfaces 1 Solid Modelling In 2D, one set 2D line segments or curves does not necessarily form a closed area. In 3D, a collection of surfaces
More informationCS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15
Describing Shapes Constructing Objects in Computer Graphics 1/15 2D Object Definition (1/3) Lines and polylines: Polylines: lines drawn between ordered points A closed polyline is a polygon, a simple polygon
More informationThe Traditional Graphics Pipeline
Final Projects Proposals due Thursday 4/8 Proposed project summary At least 3 related papers (read & summarized) Description of series of test cases Timeline & initial task assignment The Traditional Graphics
More informationTriangulating mult iply-connected polygons: A simple, yet efficient algorithm.
EUROGRAPHICS '94 / M. Daehlen and L. Kjelldahl (Guest Editors), Blackwell Publishers Eurographics Association, 1994 Volume 13, (1994), number 3 Triangulating mult iply-connected polygons: A simple, yet
More informationPebble Sets in Convex Polygons
2 1 Pebble Sets in Convex Polygons Kevin Iga, Randall Maddox June 15, 2005 Abstract Lukács and András posed the problem of showing the existence of a set of n 2 points in the interior of a convex n-gon
More informationFlavor of Computational Geometry. Voronoi Diagrams. Shireen Y. Elhabian Aly A. Farag University of Louisville
Flavor of Computational Geometry Voronoi Diagrams Shireen Y. Elhabian Aly A. Farag University of Louisville March 2010 Pepperoni Sparse Pizzas Olive Sparse Pizzas Just Two Pepperonis A person gets the
More informationRASTERIZING POLYGONS IN IMAGE SPACE
On-Line Computer Graphics Notes RASTERIZING POLYGONS IN IMAGE SPACE Kenneth I. Joy Visualization and Graphics Research Group Department of Computer Science University of California, Davis A fundamental
More informationCS4733 Class Notes. 1 2-D Robot Motion Planning Algorithm Using Grown Obstacles
CS4733 Class Notes 1 2-D Robot Motion Planning Algorithm Using Grown Obstacles Reference: An Algorithm for Planning Collision Free Paths Among Poyhedral Obstacles by T. Lozano-Perez and M. Wesley. This
More informationDiscrete Optimization. Lecture Notes 2
Discrete Optimization. Lecture Notes 2 Disjunctive Constraints Defining variables and formulating linear constraints can be straightforward or more sophisticated, depending on the problem structure. The
More informationSpatial Data Structures
15-462 Computer Graphics I Lecture 17 Spatial Data Structures Hierarchical Bounding Volumes Regular Grids Octrees BSP Trees Constructive Solid Geometry (CSG) March 28, 2002 [Angel 8.9] Frank Pfenning Carnegie
More informationComputational Geometry [csci 3250]
Computational Geometry [csci 3250] Laura Toma Bowdoin College Polygon Triangulation Polygon Triangulation The problem: Triangulate a given polygon. (output a set of diagonals that partition the polygon
More informationComputer Engineering and Intelligent Systems ISSN (Paper) ISSN (Online) Vol.5, No.4, 2014
Implementation of an Efficient Scan-Line Polygon Fill Algorithm Dr. Ismail Al-Rawi Arab Open University (Kuwait Branch), P.O 830 Al Ardia, P.C 92400, Kuwait *E-Mail: ism_49@hotmail.com Abstract Area filling
More informationGeometry. Zachary Friggstad. Programming Club Meeting
Geometry Zachary Friggstad Programming Club Meeting Points #i n c l u d e typedef complex p o i n t ; p o i n t p ( 1. 0, 5. 7 ) ; p. r e a l ( ) ; // x component p. imag ( ) ; // y component
More informationR. C. TECHNICAL INSTITUTE, SOLA
R. C. TECHNICAL INSTITUTE, SOLA Information Technology Department SEMESTER 3 Assignments list for all subjects Subject Name: DIGITAL MEMORY SYSTEMS Subject Code: 3331601 ASSIGNMENT-1- Digital Memory Systems
More informationClipping. CSC 7443: Scientific Information Visualization
Clipping Clipping to See Inside Obscuring critical information contained in a volume data Contour displays show only exterior visible surfaces Isosurfaces can hide other isosurfaces Other displays can
More information