You are on page 1of 10

What are Polygon

surfaces
Name- Afshan Taskil
Std Code-BWU/BCA/22/340
Course Code-BCAC402

1
Contents
 Polygon(Definition)
 Types of Polygon
 Convex
 Concave
 Complex
 Polygon Representation
 Flood fill Vs Boundary fill Vs Edge fill
Vs Fence fill Vs Scan line fill

2
Polygon (Definition)

Polygon is a figure having many slides. It may be represented as a number of line segments end to end to form a
closed figure.
The line segments which form the boundary of polygon are called as edges or slides of polygon.
The end of the side are called the polygon vertices.

Triangle is the most simple form of polygon having three side and three vertices.
The polygon may be of any shape.

3
Types of Polygon

1. Convex

2. Concave

3. Complex

4
Convex

Convex polygon is a polygon in which if we take any points which are


surely inside the polygon and if we draw a joining these two points and
if all the points on that line lies into the polygon, then such a polygon is
called as convex polygon.

5
Concave

Concave polygon is a polygon in which if we take any two points which are
surely inside the polygon and if we draw a line joining these two points and
if all the points on that line are not lying inside the polygon, then such a
polygon is called as concave polygon.

6
Complex

In a computer graphics, a polygon which is neither convex nor concave is


referred as complex polygons.

The complex polygon includes any polygon which intersects itself of the
polygon which overlaps itself.
The complex polygon has a boundary.

7
Polygon Representation

OP X Y

6 5 5

2 7 5
A(5,5) B(7,5)
2 9 3

2 7 1 F(3,3) C(9,3)

2 5 1

2 3 3 E(5,1) D(7,1)

2 5 5

8
Flood fill Vs Boundary fill Vs Edge fill Vs Fence fill Vs Scan line fill
Flood fill Boundary Fill Edge fill Fence Fill Scan line fill

Need Seed point to Need Seed point to Based on Based on Based on line
start. start. complimenting the complimenting the drawing, polygon is
pixels. pixels. filled.

Current pixels color Current pixels color Pixels which are on Pixels which are on Intersection of
is compared with is compared with right side of an edge right side of an edge polygon edges are
new pixel color. new pixel color and are getting and to the left of found with the scan
boundary color. complemented. fence as well as left line and then the
side of edge and solid lines are drawn
right side of fence between two such
are getting intersection points.
complemented.

Useful for polygons Useful for polygons More number of Less number of Need separate
having single color having multi color pixels are pixels are accessed attention to handle
boundary. boundary. unnecessarily as compared to concave polygons.
accessed. edge fill.

9
10

You might also like