SlideShare a Scribd company logo
Polygon Clipping – An Approach
to Simplified ClippingTechniques
Presented By:
AKASH GUPTA
M.Tech (Production Engg.)
ABSTRACT:
Clipping procedures are generally classified as either a Line Clipper or a
Polygon Clipper. A Line clipper determines which lines are wholly within the
window boundaries and which lines are to be totally or partially clipped. This is
known as clipping of lines by polygons. Here the Concave Polygons will be clipped
against a ConvexWindow.
INTRODUCTION
Following up on the clipping of lines by polygons the following solutions exists:
1. Clipping of each edge of the polygon by the clipping window and then joining the
points to get the resultant clipped polygon.
2. This method works only with simple convex polygons; it does not however generate
correct polygons for more complex cases like Concave Polygons.
3. It also becomes difficult rearranging the resulting polygon from disjoint clipped lines
especially when there may be more than one clipped polygons generated.
One such algorithm is Sutherland Hodgeman Polygon Clipping in which it
abandons thinking of a polygon as a set of line segments and clipping individual edges.
The algorithm works iteratively by considering a clipping boundary and clips the entire
polygon against this boundary. For a polygon to be clipped against a rectangle there
would be 4 clipping boundaries.
Thus each clip boundary is used to clip the polygon edges in turn and give a new
set of points. This procedure is repeated for each clipping boundary and the final set of
points representing the clipped polygon.
PIPELININGTHE ALGORITHM:
The SH Algorithm requires at each step to store an array of order O (n) that
contains the vertices of the intermediate polygon generated. To make the
algorithm use less memory, a modification is suggested. When a polygon edge
is clipped, it is not stored but is immediately forwarded to be clipped by the
next window boundary. This pipelining method eliminates the need for
intermediate storage of the entire polygon. Only the last generated point
needs to be stored. The new modified algorithm will have an additional
parameter ‘range’ which indicates the total number of boundaries.
DEGENERATE EDGES:
While the SH Algorithm works very well with simple polygons. In the case
of complex polygons it produces erroneous results. The algorithm tries to
generate a fresh polygon by clipping with each boundary of the clipping
window, but does not take into account the fact that the polygon might be
clipped into more than one smaller polygon. Therefore the SH algorithm will
have to be modified to take care of the Degenerated Edges between these
smaller polygons.
Degenerate Edge
Original Polygon with Clipping
Window
Clipped Polygon
Actual Clipped Polygon
MODIFIED SH ALGORITHM
This section explains a modification to the basic SH Algorithm that will not generate
degenerate edges, instead it will output a list of polygons. The modified SH Algorithm
takes as input the list of vertices and outputs a list of polygons.
The Modified Algorithm (MSH) takes as input the list of vertices output by the Basic
Algorithm (BSH). It is known as the Output List. Another list called the Orientation List is
constructed according to the following specifications.
• Step-1: Sort those points in the output list that lie on the clipping window boundary in
the same direction in which the BSH Algorithm traversed the polygon to generate the
output list.The list of sorted points is called the Orientation List.
• Step-2: Start traversing the output list one vertex at a time with the following
modification. While going from a certain node A in the output list to its successor B,
follow the same node A in the Orientation List. If node A is present in the Orientation
List and node B is not its successor, do the following.
• Step-3: If node C is node A’s successor in the Orientation List, rearrange the pointer of
node A in the output list so that its successor is also node C.
• Step-4: Repeatedly perform a similar operation on the next node in the Orientation List till node B is
reached on the Orientation List.
• Step-5: Continue this process till the entire length of the output list is traversed.
At the end of the traversal of the output list, it will contain a number of lists, each corresponding to a
separate polygon thus eliminating Degenerate Edges. The concept can also be explained with the help of
following Example:
• Orientation List- G  FTUVW
• Initially Output List- AGUDETFHIVWL
• After excluding Degenerated Edges i.e. GF
• Final Output List- AGFHIVWL
B O P C J K
X G F T U V W
Y
E D
A H I L
CONCLUSION
The above algorithm is first described in the simple case of clipping a
polygon against just one edge of the window and then extended to include
clipping over the entire window. If the output polygon contains a degenerate
edge that goes across a corner of the clipping window, pre-process the Output
and the Orientation Lists.
REFERENCES
• PolygonClipping – An Approach to SimplifiedClippingTechniques by
Prabhjyot Kaur Haryal Department of Computer Science and Application
St. Aloysius College (Autonomous) Jabalpur – India
THANKYOU

More Related Content

What's hot

Bhavesh window clipping slidshare
Bhavesh window clipping slidshareBhavesh window clipping slidshare
Bhavesh window clipping slidshare
Bhavesh Panchal
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
Laxman Puri
 
Clipping
ClippingClipping
Clipping
Udayan Gupta
 
Clipping in 2 d
Clipping in 2 dClipping in 2 d
Clipping in 2 d
Ashiv Khan
 
Curve clipping
Curve clippingCurve clipping
Curve clipping
Mohamed El-Serngawy
 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithm
Mani Kanth
 
Comparison of Various Line Clipping Algorithm for Improvement
Comparison of Various Line Clipping Algorithm for ImprovementComparison of Various Line Clipping Algorithm for Improvement
Comparison of Various Line Clipping Algorithm for Improvement
IJMER
 
Lect 5 2d clipping
Lect 5 2d clippingLect 5 2d clipping
Lect 5 2d clipping
majicyoung
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
MdAlAmin187
 
06 clipping
06 clipping06 clipping
06 clipping
Ketan Jani
 
Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )
Harshana Madusanka Jayamaha
 
Clipping
ClippingClipping
Clipping
Mohd Arif
 
Implementation
ImplementationImplementation
Implementation
Syed Zaid Irshad
 
Lecture 2d point,curve,text,line clipping
Lecture   2d point,curve,text,line clippingLecture   2d point,curve,text,line clipping
Lecture 2d point,curve,text,line clipping
avelraj
 
Clipping
ClippingClipping
Clipping
Pooja Dixit
 
Circle & curve clipping algorithm
Circle & curve clipping algorithmCircle & curve clipping algorithm
Circle & curve clipping algorithm
Mohamed El-Serngawy
 
Line clipping
Line clippingLine clipping
Line clipping
Ankit Garg
 
Clipping in Computer Graphics
Clipping in Computer Graphics Clipping in Computer Graphics
Clipping in Computer Graphics
Barani Tharan
 
Line clipping algorithm (Detailed)
Line clipping algorithm (Detailed)Line clipping algorithm (Detailed)
Line clipping algorithm (Detailed)
Aamir Sohail
 
Computer Graphic - Clipping
Computer Graphic - ClippingComputer Graphic - Clipping
Computer Graphic - Clipping
2013901097
 

What's hot (20)

Bhavesh window clipping slidshare
Bhavesh window clipping slidshareBhavesh window clipping slidshare
Bhavesh window clipping slidshare
 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
 
Clipping
ClippingClipping
Clipping
 
Clipping in 2 d
Clipping in 2 dClipping in 2 d
Clipping in 2 d
 
Curve clipping
Curve clippingCurve clipping
Curve clipping
 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithm
 
Comparison of Various Line Clipping Algorithm for Improvement
Comparison of Various Line Clipping Algorithm for ImprovementComparison of Various Line Clipping Algorithm for Improvement
Comparison of Various Line Clipping Algorithm for Improvement
 
Lect 5 2d clipping
Lect 5 2d clippingLect 5 2d clipping
Lect 5 2d clipping
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
 
06 clipping
06 clipping06 clipping
06 clipping
 
Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )
 
Clipping
ClippingClipping
Clipping
 
Implementation
ImplementationImplementation
Implementation
 
Lecture 2d point,curve,text,line clipping
Lecture   2d point,curve,text,line clippingLecture   2d point,curve,text,line clipping
Lecture 2d point,curve,text,line clipping
 
Clipping
ClippingClipping
Clipping
 
Circle & curve clipping algorithm
Circle & curve clipping algorithmCircle & curve clipping algorithm
Circle & curve clipping algorithm
 
Line clipping
Line clippingLine clipping
Line clipping
 
Clipping in Computer Graphics
Clipping in Computer Graphics Clipping in Computer Graphics
Clipping in Computer Graphics
 
Line clipping algorithm (Detailed)
Line clipping algorithm (Detailed)Line clipping algorithm (Detailed)
Line clipping algorithm (Detailed)
 
Computer Graphic - Clipping
Computer Graphic - ClippingComputer Graphic - Clipping
Computer Graphic - Clipping
 

Similar to Clipping

Sutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithmSutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithm
Tawfiq Ahmed
 
ytdty.pptx
ytdty.pptxytdty.pptx
ytdty.pptx
sandeshbhusal6
 
iuyf.pptx
iuyf.pptxiuyf.pptx
iuyf.pptx
nabingyawali5
 
kfty.pptx
kfty.pptxkfty.pptx
kfty.pptx
nabingyawali5
 
jd.pptx
jd.pptxjd.pptx
jd.pptx
nabingyawali5
 
ibuib.pptx
ibuib.pptxibuib.pptx
ibuib.pptx
nabingyawali5
 
99995327.ppt
99995327.ppt99995327.ppt
99995327.ppt
ABDULSAMADKAZI
 
yyfty.pptx
yyfty.pptxyyfty.pptx
yyfty.pptx
nabingyawali5
 
ytsju.pptx
ytsju.pptxytsju.pptx
ytsju.pptx
nabingyawali5
 
hgfcgf.pptx
hgfcgf.pptxhgfcgf.pptx
hgfcgf.pptx
nabingyawali5
 
hgfcftc.pptx
hgfcftc.pptxhgfcftc.pptx
hgfcftc.pptx
nabingyawali5
 
ufyty.pptx
ufyty.pptxufyty.pptx
ufyty.pptx
nabingyawali5
 
jfcft.pptx
jfcft.pptxjfcft.pptx
jfcft.pptx
nabingyawali5
 
yutd65.pptx
yutd65.pptxyutd65.pptx
yutd65.pptx
nabingyawali5
 
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLiang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Lahiru Danushka
 
Clipping
ClippingClipping
kgv.pptx
kgv.pptxkgv.pptx
kgv.pptx
sandeshbhusal6
 
ytt.pptx
ytt.pptxytt.pptx
ytt.pptx
nabingyawali5
 
ohu.pptx
ohu.pptxohu.pptx
ohu.pptx
nabingyawali5
 
UNIT-III
UNIT-IIIUNIT-III
UNIT-III
VarthiniRamesh
 

Similar to Clipping (20)

Sutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithmSutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithm
 
ytdty.pptx
ytdty.pptxytdty.pptx
ytdty.pptx
 
iuyf.pptx
iuyf.pptxiuyf.pptx
iuyf.pptx
 
kfty.pptx
kfty.pptxkfty.pptx
kfty.pptx
 
jd.pptx
jd.pptxjd.pptx
jd.pptx
 
ibuib.pptx
ibuib.pptxibuib.pptx
ibuib.pptx
 
99995327.ppt
99995327.ppt99995327.ppt
99995327.ppt
 
yyfty.pptx
yyfty.pptxyyfty.pptx
yyfty.pptx
 
ytsju.pptx
ytsju.pptxytsju.pptx
ytsju.pptx
 
hgfcgf.pptx
hgfcgf.pptxhgfcgf.pptx
hgfcgf.pptx
 
hgfcftc.pptx
hgfcftc.pptxhgfcftc.pptx
hgfcftc.pptx
 
ufyty.pptx
ufyty.pptxufyty.pptx
ufyty.pptx
 
jfcft.pptx
jfcft.pptxjfcft.pptx
jfcft.pptx
 
yutd65.pptx
yutd65.pptxyutd65.pptx
yutd65.pptx
 
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLiang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
 
Clipping
ClippingClipping
Clipping
 
kgv.pptx
kgv.pptxkgv.pptx
kgv.pptx
 
ytt.pptx
ytt.pptxytt.pptx
ytt.pptx
 
ohu.pptx
ohu.pptxohu.pptx
ohu.pptx
 
UNIT-III
UNIT-IIIUNIT-III
UNIT-III
 

Recently uploaded

Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
Mahmoud Morsy
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
integral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdfintegral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdf
gaafergoudaay7aga
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
IJECEIAES
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
Madan Karki
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
UReason
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Design and optimization of ion propulsion drone
Design and optimization of ion propulsion droneDesign and optimization of ion propulsion drone
Design and optimization of ion propulsion drone
bjmsejournal
 

Recently uploaded (20)

Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
integral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdfintegral complex analysis chapter 06 .pdf
integral complex analysis chapter 06 .pdf
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Design and optimization of ion propulsion drone
Design and optimization of ion propulsion droneDesign and optimization of ion propulsion drone
Design and optimization of ion propulsion drone
 

Clipping

  • 1. Polygon Clipping – An Approach to Simplified ClippingTechniques Presented By: AKASH GUPTA M.Tech (Production Engg.)
  • 2. ABSTRACT: Clipping procedures are generally classified as either a Line Clipper or a Polygon Clipper. A Line clipper determines which lines are wholly within the window boundaries and which lines are to be totally or partially clipped. This is known as clipping of lines by polygons. Here the Concave Polygons will be clipped against a ConvexWindow.
  • 3. INTRODUCTION Following up on the clipping of lines by polygons the following solutions exists: 1. Clipping of each edge of the polygon by the clipping window and then joining the points to get the resultant clipped polygon. 2. This method works only with simple convex polygons; it does not however generate correct polygons for more complex cases like Concave Polygons. 3. It also becomes difficult rearranging the resulting polygon from disjoint clipped lines especially when there may be more than one clipped polygons generated. One such algorithm is Sutherland Hodgeman Polygon Clipping in which it abandons thinking of a polygon as a set of line segments and clipping individual edges. The algorithm works iteratively by considering a clipping boundary and clips the entire polygon against this boundary. For a polygon to be clipped against a rectangle there would be 4 clipping boundaries. Thus each clip boundary is used to clip the polygon edges in turn and give a new set of points. This procedure is repeated for each clipping boundary and the final set of points representing the clipped polygon.
  • 4. PIPELININGTHE ALGORITHM: The SH Algorithm requires at each step to store an array of order O (n) that contains the vertices of the intermediate polygon generated. To make the algorithm use less memory, a modification is suggested. When a polygon edge is clipped, it is not stored but is immediately forwarded to be clipped by the next window boundary. This pipelining method eliminates the need for intermediate storage of the entire polygon. Only the last generated point needs to be stored. The new modified algorithm will have an additional parameter ‘range’ which indicates the total number of boundaries.
  • 5. DEGENERATE EDGES: While the SH Algorithm works very well with simple polygons. In the case of complex polygons it produces erroneous results. The algorithm tries to generate a fresh polygon by clipping with each boundary of the clipping window, but does not take into account the fact that the polygon might be clipped into more than one smaller polygon. Therefore the SH algorithm will have to be modified to take care of the Degenerated Edges between these smaller polygons.
  • 6. Degenerate Edge Original Polygon with Clipping Window Clipped Polygon Actual Clipped Polygon
  • 7. MODIFIED SH ALGORITHM This section explains a modification to the basic SH Algorithm that will not generate degenerate edges, instead it will output a list of polygons. The modified SH Algorithm takes as input the list of vertices and outputs a list of polygons. The Modified Algorithm (MSH) takes as input the list of vertices output by the Basic Algorithm (BSH). It is known as the Output List. Another list called the Orientation List is constructed according to the following specifications. • Step-1: Sort those points in the output list that lie on the clipping window boundary in the same direction in which the BSH Algorithm traversed the polygon to generate the output list.The list of sorted points is called the Orientation List. • Step-2: Start traversing the output list one vertex at a time with the following modification. While going from a certain node A in the output list to its successor B, follow the same node A in the Orientation List. If node A is present in the Orientation List and node B is not its successor, do the following. • Step-3: If node C is node A’s successor in the Orientation List, rearrange the pointer of node A in the output list so that its successor is also node C.
  • 8. • Step-4: Repeatedly perform a similar operation on the next node in the Orientation List till node B is reached on the Orientation List. • Step-5: Continue this process till the entire length of the output list is traversed. At the end of the traversal of the output list, it will contain a number of lists, each corresponding to a separate polygon thus eliminating Degenerate Edges. The concept can also be explained with the help of following Example: • Orientation List- G  FTUVW • Initially Output List- AGUDETFHIVWL • After excluding Degenerated Edges i.e. GF • Final Output List- AGFHIVWL B O P C J K X G F T U V W Y E D A H I L
  • 9. CONCLUSION The above algorithm is first described in the simple case of clipping a polygon against just one edge of the window and then extended to include clipping over the entire window. If the output polygon contains a degenerate edge that goes across a corner of the clipping window, pre-process the Output and the Orientation Lists.
  • 10. REFERENCES • PolygonClipping – An Approach to SimplifiedClippingTechniques by Prabhjyot Kaur Haryal Department of Computer Science and Application St. Aloysius College (Autonomous) Jabalpur – India