Algorithm for Approximating Piecewise Smooth Curves.

Slides:



Advertisements
Similar presentations
1 Programming Interest Group Tutorial Eight Computational Geometry.
Advertisements

Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Approximations of points and polygonal chains
CSE 373: Data Structures and Algorithms Lecture 5: Math Review/Asymptotic Analysis III 1.
Brute-Force Triangulation
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
1 Voronoi Diagrams. 2 Voronoi Diagram Input: A set of points locations (sites) in the plane.Input: A set of points locations (sites) in the plane. Output:
By Groysman Maxim. Let S be a set of sites in the plane. Each point in the plane is influenced by each point of S. We would like to decompose the plane.
© University of Wisconsin, CS559 Spring 2004
Bezier Curves and Splines David Eno MAT 499 Fall ‘06.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 11: Curves Problems
17. Computational Geometry Chapter 7 Voronoi Diagrams.
Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses in a matrix chain multiplication (A.
2-dimensional indexing structure
Offset of curves. Alina Shaikhet (CS, Technion)
09/09/02 Dinesh Manocha, COMP258 Properties of Bezier Curves Invariance under affine parameter transformation P i B i,n (u) = P i B i,n ((u –a)/(b-a))
Mark Waitser Computational Geometry Seminar December Iterated Snap Rounding.
Computer Graphics (Fall 2008) COMS 4160, Lectures 8,9: Curves Problems
Modelling: Curves Week 11, Wed Mar 23
R-Trees 2-dimensional indexing structure. R-trees 2-dimensional version of the B-tree: B-tree of maximum degree 8; degree between 3 and 8 Internal nodes.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
September 12, 2006IEEE PIMRC 2006, Helsinki, Finland1 On the Packet Header Size and Network State Tradeoff for Trajectory-Based Routing in Wireless Networks.
1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided.
CS Subdivision I: The Univariate Setting Peter Schröder.
Brute-Force Triangulation
Splines III – Bézier Curves
1st Meeting Industrial Geometry Approximation Theory and Computational Geometry 1st IG-Meeting New Allies Joint research with project S09202 "Coupling.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
Introduction Geometric figures can be graphed in the coordinate plane, as well as manipulated. However, before sliding and reflecting figures, the definitions.
Planning Near-Optimal Corridors amidst Obstacles Ron Wein Jur P. van den Berg (U. Utrecht) Dan Halperin Athens May 2006.
V. Space Curves Types of curves Explicit Implicit Parametric.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 19: Searching and Sorting Algorithms.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
1 CS 430/536 Computer Graphics I Curve Drawing Algorithms Week 4, Lecture 8 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing.
Introduction to Integration
Splines IV – B-spline Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
Subdivision Curve (and its relations to wavelets) Jyun-Ming Chen Spring 2001.
Geometric Constructions
Duy & Piotr. How to reconstruct a high quality image with the least amount of samples per pixel the least amount of resources And preserving the image.
Course 8 Contours. Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent.
Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments.
11/26/02(C) University of Wisconsin Last Time BSplines.
Parametric Curves CS 318 Interactive Computer Graphics John C. Hart.
(c) 2002 University of Wisconsin
Geometric Data and Representation Pattern Recognition 2015/2016 Marc van Kreveld.
Ship Computer Aided Design
Review. Problem 1 What is the output of the following piece of code void increment(int x) { x++; } int main() { int y = 10; increment(y); cout
Rendering Bezier Curves (1) Evaluate the curve at a fixed set of parameter values and join the points with straight lines Advantage: Very simple Disadvantages:
Essential Geometry. Equations Implicit – F(x,y) = 0 Parametric – P(t) = x – Q(t) = y – 0
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Learn how to make your drawings come alive…  COURSE: SKETCH RECOGNITION Analysis, implementation, and comparison of sketch recognition algorithms, including.
Radius chord diameter secant tangent center. --the set of points in a plane equidistant from a given point known as the center.
© University of Wisconsin, CS559 Spring 2004
Chapter 10 Image Segmentation
Advanced Algorithms Analysis and Design
CSE 167 [Win 17], Lecture 11: Curves Problems Ravi Ramamoorthi
Function and class templates
~Adapted from Walch Education
Efficient Methods for Roots of Univariate Scalar Beziers
Geometric Constructions
Chapter 7 Voronoi Diagrams
CSE 373 Data Structures and Algorithms
Searching CLRS, Sections 9.1 – 9.3.
CHAPTER 2: Geometric Constructions
PPT5: Fundamental Geometric Algorithms
Geometry Unit 1: Foundations
Last Time B-splines Project 3 was made available
Presentation transcript:

Algorithm for Approximating Piecewise Smooth Curves

Polygonal approximation There are two types of methods associated with the polygon approximation problem: bounded-# : An upper bound for the number of vertices of the output polygonal line is demanded. bounded-  : An upper bound for the approximation error is given. Depending on the accuracy of their solution polygonal approximation algorithms can by divided in optimal and sub- optimal methods. For approximating piecewise smooth curves we used a modification of the Douglas–Peucker algorithm, a sub-optimal bounded-  method.

Douglas-Peucker algorithm Basic idea: recursive split Input: Set of successive points {P 1,...,P N } defining the input curve Algorithm: Approximate the current curve portion with the segment linking its end points. Compute the approximation error between the current curve and its approximating segment. Find the splitpoint. If the approximation error is greater then the threshold, split the curve portion at the splitpoint in two subcurves. Repeat steps 1-2 for the subcurves. Output: Set of successive points {P 1,...,P M } defining the output curve, with M ≤ N. P1P1 PNPN splitpoint

Recursive split for piecewise smooth curves Basic idea: same as before Input: Set of successive smooth curve pieces defining the input curve Algorithm: Approximate the current curve portion with the segment linking its end points. Compute the approximation error between each piece of the current curve and the approximating line (find_farthest). Find the splitpoint by determining the piece of the curve with the farthest point regarding the approximating line. If the approximation error is greater then the threshold, split the curve portion at the splitpoint in two subcurves. Repeat steps 1-2 for the subcurves. Output: Set of successive points defining the output curve. splitpoint

Operation Find Farthest The operation find_farthest is a member function of each object- class of the curve. It determines for every object the point with the overall maximum distance to a given line L. template typename R::FT find_farthest ( Object &object, const Line_2 &line, Point_2 &point) { return object.find_farthest(object,line,point); }

Find Farthest – Circular Arcs I For circular arcs are up to four candidate points for the farthest point: the two endpoints of the arc: source and target the two intersection points of the circle C and a perpendicular line to L through the center of C. 2. intersection point line L arc A source target 1. intersection point circle C

Find Farthest – Circular Arcs II To determine the farthest point you need to look at three distinct cases: 1. The intersection points are both not on the arc: source or target must be the farthest point. line L arc A source target 1. intersection point 2. intersection point

Find Farthest – Circular Arcs III 2. One intersection point is on the arc: this intersection point or source or target is farthest point. 1. intersection point line L arc A source target 2. intersection point

Find Farthest – Circular Arcs IV 3. Both intersection points are on the arc: one of them is farthest point. line L arc A source target 1. intersection point 2. intersection point

Find Farthest – Bézier Curves I For a Bézier curve of degree d with d+1 control points we used the following heuristic to approximate the farthest point: 1.Compute the distance of the control points to the approximating line L. 2.If the first or last control point has the overall maximum distance to L, the farthest point is found. 3.If the overall maximum is found at the i-th control point, 0<i<d, the curve is subdivided. 4.Proceed recursively with the subcurve which includes the control point with overall maximum distance to L.

Find Farthest – Bézier Curves II For the subdivision of a Bézier curve b(t), t [a,b], of degree d, we analyze two approaches: 1. The curve b(t) is always subdivided in the middle: t s =(a+b)/2. 2. The curve b(t) is subdivided at t s =a+((b-a)*i/d), with i the index of the control point with the maximum distance to the approximating line.

Split For piecewise smooth curves there are two possibilities for each split: The splitpoint is an endpoint of one of the current pieces. The list of pieces is split at the splitpoint. The splitpoint is a point in the interior of one of the pieces. The piece itself is split. A new piece has to be inserted in the list of pieces. line L arc A arc B line L source arc A target splitpoint

Operation Split The operation split is a member function of each object-class of the curve. It splits the piece of the curve containing the splitpoint into two pieces. template void split(Object &object,const Point_2 &splitpoint,const Iterator p, List &list) { Object* nobject; nobject = object.split(object,splitpoint); //Call split function of the object list.insert(p,nobject); //insert the pointer of the new object in the list }

Self-approximation If there is just one curve piece to approximate check if this curve object has an own approximation operation if so use this operation (selfapprox ) to approximate if not keep up with the pattern The operation selfapprox is a member function of each object- class of the curve. int d = distance(first,last); if (d==1) { if ((**first).has_self_approx()) (**first).selfapprox(); }

Example Error bound: 1

Example Error bound :

Example Error bound: 10

Work in progress A traits class for distance measurements: Which distance measurements make sense and can be implemented efficiently? Integrate Bézier curves and B-Splines : Computing the farthest point for Bézier curves, how many recursive steps are necessary? How to compute efficiently the farthest point for B-Splines? Can we use geometric filtering, e.g., bounding boxes, upper and lower envelopes?