Curve clipping involves using polygon clipping to test if a curved object's bounding rectangle overlaps a clipping window. If there is no overlap, the object is discarded. If there is overlap, the simultaneous curve and boundary equations are solved to find intersection points. Special cases like circles are considered, such as discarding a circle if its center is outside the clipping window plus/minus the radius. Bezier and spline curves can also be clipped by approximating them as polylines or using their convex hull properties.
2. 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) XMAX , Y MAX XMIN , Y MAX XMIN , Y MIN XMAX , Y MIN Object
3. Case 1 If the bounding rectangle for the object is completely inside the window, we save the object. Clipping window Bounding rectangle
4. Case 2 If the rectangle is determined to be completely outside the window, we discard the object Object
5. Case 3 If the two regions overlap, we will need to solve the simultaneous line-curve equations to obtain the clipping intersection points.
6.
7.
8. Circle clipping cont.. If XC - R > Xright Then the circle is discarded R X right Xc -R XC
9. Circle clipping cont.. If YC - R >Ytop Then the circle is discarded Yc -R Y top Clipping window
12. 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
13. Circle clipping cont.. Getting intersection points : Example : The intersection with the right edge 1- Simply Cos α = Xright-Xc /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 First intersection angle=α α Start (angle=0) α Second intersection X right Xc
14. 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
15. Spline curve : definition A Spline Curve : Any Composite curve formed with polynomial sections satisfying specified continuity conditions at the boundary of the pieces.
19. Bézier Clipping Problem Given polynomial p withdegree n Find all roots within an interval Algorithm Bézier representation Intersect the convex hull with t-axis Obtain a new interval
25. 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).
26. Convergence Rates A sequence of intervals that converge to the root: How fast does the sequence converge?
32. Quadratic Clipping The same type of algorithm as Bézier clipping Convex hull Quadratic bounds Find the best quadratic approximant q of p in L2 norm Compute error bound of p and q Construct quadratic functions: upper bound M, lower bound m Compute roots of M and m
41. The Approximated Root 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).