PMC and Booleans Point-Membership Classification

Slides:



Advertisements
Similar presentations
Computer Graphics Lecture 3 Modeling and Structures.
Advertisements

Computer Graphics- SCC 342
Computer Graphics1 Geometry Area of polygons & Volume Of Polygonal surfaces.
Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Classes of Polygons Planar polygons Non-planar polygons Simple
Some Basic Morphological Algorithm
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Advanced Computer Graphics Spring 2014
Chapter 12: Surface Area and Volume of Solids
Complex Model Construction Mortenson Chapter 11 Geometric Modeling
Chapter 12 Surface Area and Volume. Topics We Will Discuss 3-D Shapes (Solids) Surface Area of solids Volume of Solids.
12.3 Surface Area of a Pyramids and Cones Slant Height ( l )
Computational Geometry
Triangle Scan Conversion. 2 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Rasterization Rasterization (scan conversion) –Determine which.
Vertex – A point at which two or more edges meet Edge – A line segment at which two faces intersect Face – A flat surface Vertices, Edges, Faces.
Collision handling: detection and response
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
Geometry B Section 12.3 Surface Area of Pyramids and Cones.
12.1– Explore Solids.
CAP4730: Computational Structures in Computer Graphics
12.1 – Explore Solids.
Chapter 12.1 Notes Polyhedron – is a solid that is bounded by polygons, called faces, that enclose a single region of space. Edge – of a polygon is a line.
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
Basic Ray Tracing CMSC 435/634.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner Rasterization.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
12.1 Exploring Solids.
1 k Jarek Rossignac,  2008 Practice  Quiz next time –Geometry –Topology  One quiz will not count towards your grade –The one.
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
CS6234 Advanced Algorithms - Convex hull. Terminologies – ◦ Convex hull of a set Q of points is the smallest convex polygon P for which each point in.
Introduction to Meshes Lecture 22 Mon, Oct 20, 2003.
Section 12-1 Exploring Solids. Polyhedron Three dimensional closed figure formed by joining three or more polygons at their side. Plural: polyhedra.
Introduction to 3D Solids and Solids of Revolution Some 3D shapes can be formed by revolving a 2D shape around a line (called the axis of revolution).
Surface Area and Volume of Pyramids Goal: Students will find the surface area and volume of pyramids.
Geometric Shapes and Area
Geometric Shapes and Area
The point opposite the base of the pyramid
3. Polygon Triangulation
Lecture 5 Basic geometric objects
Goal 1: Using Properties of Polyhedra Goal 2: Using Euler’s Theorem
Polyhedra and Prisms.
Introduction to Spatial Computing CSE 555
Unit 11: 3-Dimensional Geometry
Intersecting Simple Surfaces
Query Processing in Databases Dr. M. Gavrilova
Geometric Shapes and Area
Collision handling: detection and response
Unit 11: 3-Dimensional Geometry
The Art Gallery Problem
The Art Gallery Problem
2.4. Primitive Tests - Closest point
2.5. Basic Primitive Intersection
The Bernstein Basis and Bezier Curves
Lesson 2.6 Subsets of Space pp
Warm-up: Fill in all degree and  radian measures of the unit circle
Geometric Shapes and Area
Ray Tracing Polyhedra ©Anthony Steed
Geometric Shapes and Area
Segment Clipping Simple algorithm. For each segment compute the intersection with the four sides of the rectangle, and then determine which sub-segment.
Identify Points Lines and Planes
Vertical Angles Vertical angles are across from each other and are created by intersecting lines.
Geometric Shapes and Area
Geometric Shapes and Area
Lesson 2.3 Subsets of planes pp
Clipping University of British Columbia CPSC 314 Computer Graphics
Computational Geometry
Polygons.
Convex Hull - most ubiquitous structure in computational geometry
Presentation transcript:

PMC and Booleans Point-Membership Classification Regularized Booleans between polygons

Point-in-polygon test in 2D Given a polygon P and a point q in the plane of P, how would you test whether q lies inside P? This is called “Point-Membership Classification” (abbreviated PMC)

Triangle-based point-in-polygon test Algorithm for testing whether point Q is inside polygon P Boolean PinPoly(Q,P) { pt O = origin or some arbitrary point; Boolean in:= false; for (each edge (A,B) of P) if (PinT(O,A,B,Q)) in := ! in; return in; } boolean PinT(A,B,C,P) {return (right(A,B,P)== right(B,C,P)) && (right(A,B,P)== right(C,A,P)) ;} Why does it work?

XOR shading of a polygon in 2D AB is the set of points that lie in A or in B, but not in both AB := {p: pA  pB } Let A, B, C … N be primitives, then ABC… N is the set of points contained in an odd number of these primitives AB := {p: (pA) XOR (pB) XOR (pC) XOR … XOR (pN) } How to shade a polygon A in 2D: Polygon P has edges Ei. Triangle Ti = convex hull of O+Ei. P = T1T2T3… Tn To fill P: fill each Ti while toggling status of visited pixel o E5 o E4 o E3 E2 o o E1 o P Assume no pixel lies on boundary of any triangle

Example of XOR polygon filling

Relation to ray-casting approach? A point Q lies in a set P if a ray from Q intersects the boundary of P an odd number of times If ray hits a vertex or edge or is tangent to a surface, pick another ray We do the same thing. Look at an example in 2D. Here: Only edges E1, E2, E3 intersect ray from Q to O Thus only triangles T1, T2, T3 contain Q Q O Ray from Q Q is in because it is contained in an odd number of triangles

Computing polygon area Two methods: Sum of signed areas of triangles, each joining an arbitrary origin o to a different edge(a,b) SUM oaR(ob) for each edge (a,b) Sum of signed areas between each oriented edge the x-axis y by b ay a x ax bx area(a,b):=(ay+by)(bx–ax)/2

Area of the symmetric difference The symmetric difference AB measures the discrepancy between the two solids A and B It is 0 when A==B Assume that A and B are bounded by consistently oriented polygonal loops. Can I compute AB by summing areas of triangles?

Boolean operation on polygons Diminishing boundary principle: The Boundary of a Boolean combination of shapes is a subset of the union of their boundaries Strategy: Generate-Split-Select Generate a sufficient set of candidates: edges of polygons Split them at their pairwise intersections Select the edge-segments on the boundary of the result How to identify a good edge segment? Must separate in from out t s

Boolean A–B (also written A \ B) A A B B

Regularization AB ? B A