Curve clipping

21,298 views 39 slides May 05, 2010
Slide 1
Slide 1 of 39
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39

About This Presentation

No description available for this slideshow.


Slide Content

Curve clipping

The bounding rectangle for a curved object can be used first to test for overlap with a rectangular clip window (we can use polygon clipping) X MAX , Y MAX X MIN , Y MAX X MAX , Y MIN X MIN , Y MIN Object

Case 1 If the bounding rectangle for the object is completely inside the window, we save the object. Clipping window Bounding rectangle

Case 2 If the rectangle is determined to be completely outside the window, we discard the object Object

Case 3 If the two regions overlap, we will need to solve the simultaneous line-curve equations to obtain the clipping intersection points.

finding intersection points by solving the curve and boundary equations simultaneously sometimes takes a long time. We have to consider special curves as circles and ellipses before solving the equations simultaneously.

Circle clipping Xc+R X LEFT -If X C + R < X LEFT Then the circle is discarded . -No need for bounding triangle x c Clipping window

Circle clipping cont.. If X C - R > X right Then the circle is discarded X right Xc -R X C R

Circle clipping cont.. Y top Yc -R If Y C - R >Y top Then the circle is discarded Clipping window

Circle clipping cont.. Y bottom Yc + R If Y C +R <Y bottom Then the circle is discarded

Circle clipping cont.. If all the four previous conditions are false then the circle is saved

Circle clipping cont.. Intersection conditions: With right edge: Xc+R> Xright With left edge: Xc-R< Xleft With top edge : Yc+R>Ytop With bottom edge: Yc -R<Ybottom

Circle clipping cont.. Getting intersection points : Example : The intersection with the right edge α Start (angle=0) First intersection angle= α Second intersection α X right X c 1- Simply Cos α = X right -X c /R 2- Get α 3- y=R sin α 4- the segment from angle 0 to angle α is discarded 5- the segment from angle α to angle 360- α is considered 6- the segment from angle 360- α to angle 360 is considered

Other techniques Clip individual point : for point plotted curves , may consume time if number of points is great. Curves approximated to poly lines: clip individual line segments , if segment is not small enough no accurate result , if it is small more than enough , it will be time consuming for linear segments

A Spline Curve : Any Composite curve formed with polynomial sections satisfying specified continuity conditions at the boundary of the pieces. Spline curve : definition

Specifying Splines

Example : Third order spline In order to assure C1 continuity  at two extremities, our functions must be of at least degree 3

18 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Convex Hull Property Bezier curves lie in the convex hull of their control points Hence, even though we do not interpolate all the data, we cannot be too far away p p 1 p 2 p 3 convex hull Bezier curve

B é zier Clipping Problem Given polynomial p with degree n Find all roots within an interval Algorithm B é zier representation Intersect the convex hull with t -axis Obtain a new interval

B é zier Clipping

B é zier Clipping

B é zier Clipping

B é zier Clipping

B é zier Clipping

The Approximated Roots A sequence of intervals that bound the root of p If the width of interval is smaller than the given tolerance, return the root (interval).

Convergence Rates A sequence of intervals that converge to the root: How fast does the sequence converge?

2. Quadratic Clipping

Quadratic Clipping Idea Use quadratic bounds Motivation To improve the convergence rate

Quadratic Bounds Upper bound Lower bound

Quadratic Bounds But, how to compute the quadratic bounds efficiently?

Quadratic Bounds Approximated quadratic bounds Upper bound Lower bound Best quadratic approximant

Quadratic Clipping The same type of algorithm as B é zier clipping Convex hull  Quadratic bounds Find the best quadratic approximant q of p in L 2 norm Compute error bound of p and q Construct quadratic functions: upper bound M , lower bound m Compute roots of M and m

Quadratic Clipping

Quadratic Clipping

Quadratic Clipping

Quadratic Clipping

Quadratic Clipping

Quadratic Clipping

Quadratic Clipping
Tags