Circle & Curve Clipping AlgorithmPresented By : 			            Mohamed El-Serngawy
OutlineFast Circle Clipping  AlgorithmClipping Circle By Accept/Reject Test
Fast Circle Clipping  AlgorithmIntroduction:
Fast Circle Clipping  AlgorithmAlgorithm
Fast Circle Clipping  AlgorithmAlgorithm
Fast Circle Clipping  AlgorithmAlgorithm
Fast Circle Clipping  AlgorithmAlgorithm
Fast Circle Clipping  AlgorithmAlgorithm
Clipping Circle By Accept/Reject Test1-Scan Conversion of Circles 2-Write Points(x,y)3-Clipping Circles
	  Midpoint Circle AlgorithmChoose E as the next pixel if M lies inside the circle, and SE otherwise.d =d<0:	Select Ednew = d + (2xp+3)d>0:	Select SEdnew = d + (2xp–2yp+5)EMSExpxp+1
	  Midpoint Circle AlgorithmStart with P (x = 0, y = r). Compute d for the first midpoint at (1, r - ½): d = F(1, r - ½) = 5/4 - rWhile (x < y) {	If (d <= 0) // E is chosend = d + 2 * x + 3 	Else  // SE is choseny = y – 1d = d + 2 * x – 2 * y + 5	x = x+1; WritePixel (x, y)}
Write Points(x,y)Writes pixels to the seven other octants
Clipping CirclesAccept/Reject test   – Does bounding box of	the circle intersect with clipping box?If yes, condition pixel	write on clipping box inside/outside testAlso we can test Circle points by Point Clipping .-the point P=(x, y) is display in clipping Boundry if            xmin< x <xmaxandymin<y<ymax
Curve ClippingAreas with curved boundaries can be clipped with methods similar to those discussedin the previous .sections. Curve-clipping procedures will involve nonlinearequations, however, and this requires more processing than for objects withlinear boundaries.The bounding rectangle for a circle or other curved object can be used firstto test for overlap with a rectangular clip window. If the bounding rectangle forthe object is completely inside the window, we save the object. If the rectangle isdetermined to be completely outside the window, we discard the object. In eithercase, there is no further computation necessary. But if the bounding rectangle testfails, we can look for other computation-saving approaches. For a circle, we canuse the coordinate extents of individual quadrants and then octants for preliminarytesting before calculating curve-window intersections. For an ellipse, we cantest the coordinate extents of individual quadrants. Figure blew illustrates circleclipping against a rectangular window.
Curve ClippingSimilar procedures can be applied when clipping a curved object against a general polygon clip region. On the first pass, we can clip the bounding rectangleof the object against the bounding rectangle of the clip region. If the two regions overlap, we will need to solve the simultaneous line-curve equations to obtainthe clipping intersection points.

Circle & curve clipping algorithm

  • 1.
    Circle & CurveClipping AlgorithmPresented By : Mohamed El-Serngawy
  • 2.
    OutlineFast Circle Clipping AlgorithmClipping Circle By Accept/Reject Test
  • 3.
    Fast Circle Clipping AlgorithmIntroduction:
  • 4.
    Fast Circle Clipping AlgorithmAlgorithm
  • 5.
    Fast Circle Clipping AlgorithmAlgorithm
  • 6.
    Fast Circle Clipping AlgorithmAlgorithm
  • 7.
    Fast Circle Clipping AlgorithmAlgorithm
  • 8.
    Fast Circle Clipping AlgorithmAlgorithm
  • 9.
    Clipping Circle ByAccept/Reject Test1-Scan Conversion of Circles 2-Write Points(x,y)3-Clipping Circles
  • 10.
    MidpointCircle AlgorithmChoose E as the next pixel if M lies inside the circle, and SE otherwise.d =d<0: Select Ednew = d + (2xp+3)d>0: Select SEdnew = d + (2xp–2yp+5)EMSExpxp+1
  • 11.
    MidpointCircle AlgorithmStart with P (x = 0, y = r). Compute d for the first midpoint at (1, r - ½): d = F(1, r - ½) = 5/4 - rWhile (x < y) { If (d <= 0) // E is chosend = d + 2 * x + 3 Else // SE is choseny = y – 1d = d + 2 * x – 2 * y + 5 x = x+1; WritePixel (x, y)}
  • 12.
    Write Points(x,y)Writes pixelsto the seven other octants
  • 13.
    Clipping CirclesAccept/Reject test – Does bounding box of the circle intersect with clipping box?If yes, condition pixel write on clipping box inside/outside testAlso we can test Circle points by Point Clipping .-the point P=(x, y) is display in clipping Boundry if xmin< x <xmaxandymin<y<ymax
  • 14.
    Curve ClippingAreas withcurved boundaries can be clipped with methods similar to those discussedin the previous .sections. Curve-clipping procedures will involve nonlinearequations, however, and this requires more processing than for objects withlinear boundaries.The bounding rectangle for a circle or other curved object can be used firstto test for overlap with a rectangular clip window. If the bounding rectangle forthe object is completely inside the window, we save the object. If the rectangle isdetermined to be completely outside the window, we discard the object. In eithercase, there is no further computation necessary. But if the bounding rectangle testfails, we can look for other computation-saving approaches. For a circle, we canuse the coordinate extents of individual quadrants and then octants for preliminarytesting before calculating curve-window intersections. For an ellipse, we cantest the coordinate extents of individual quadrants. Figure blew illustrates circleclipping against a rectangular window.
  • 15.
    Curve ClippingSimilar procedurescan be applied when clipping a curved object against a general polygon clip region. On the first pass, we can clip the bounding rectangleof the object against the bounding rectangle of the clip region. If the two regions overlap, we will need to solve the simultaneous line-curve equations to obtainthe clipping intersection points.