<s>
The	O
Vatti	B-Algorithm
clipping	I-Algorithm
algorithm	I-Algorithm
is	O
used	O
in	O
computer	O
graphics	O
.	O
</s>
<s>
It	O
allows	O
clipping	B-Algorithm
of	O
any	O
number	O
of	O
arbitrarily	O
shaped	O
subject	O
polygons	B-General_Concept
by	O
any	O
number	O
of	O
arbitrarily	O
shaped	O
clip	O
polygons	B-General_Concept
.	O
</s>
<s>
Unlike	O
the	O
Sutherland	B-Algorithm
–	I-Algorithm
Hodgman	I-Algorithm
and	O
Weiler	B-Algorithm
–	I-Algorithm
Atherton	I-Algorithm
polygon	B-General_Concept
clipping	B-Algorithm
algorithms	O
,	O
the	O
Vatti	O
algorithm	O
does	O
not	O
restrict	O
the	O
types	O
of	O
polygons	B-General_Concept
that	O
can	O
be	O
used	O
as	O
subjects	O
or	O
clips	O
.	O
</s>
<s>
Even	O
complex	O
(	O
self-intersecting	O
)	O
polygons	B-General_Concept
,	O
and	O
polygons	B-General_Concept
with	O
holes	O
can	O
be	O
processed	O
.	O
</s>
<s>
Clipping	B-Algorithm
is	O
defined	O
as	O
the	O
interaction	O
of	O
subject	O
and	O
clip	O
polygons	B-General_Concept
.	O
</s>
<s>
While	O
clipping	B-Algorithm
usually	O
involves	O
finding	O
the	O
intersections	O
(	O
regions	O
of	O
overlap	O
)	O
of	O
subject	O
and	O
clip	O
polygons	B-General_Concept
,	O
clipping	B-Algorithm
algorithms	O
can	O
also	O
be	O
applied	O
with	O
other	O
boolean	B-Algorithm
clipping	I-Algorithm
operations	O
:	O
difference	O
,	O
where	O
the	O
clipping	B-Algorithm
polygons	B-General_Concept
remove	O
overlapping	O
regions	O
from	O
the	O
subject	O
;	O
union	O
,	O
where	O
clipping	B-Algorithm
returns	O
the	O
regions	O
covered	O
by	O
either	O
subject	O
or	O
clip	O
polygons	B-General_Concept
,	O
and	O
;	O
xor	O
,	O
where	O
clipping	B-Algorithm
returns	O
the	O
regions	O
covered	O
by	O
either	O
subject	O
or	O
clip	O
polygons	B-General_Concept
except	O
where	O
they	O
are	O
covered	O
by	O
both	O
subject	O
and	O
clip	O
polygons	B-General_Concept
.	O
</s>
<s>
The	O
Vatti	O
algorithm	O
involves	O
processing	O
both	O
subject	O
and	O
clipping	B-Algorithm
polygon	B-General_Concept
edges	O
in	O
an	O
orderly	O
fashion	O
,	O
starting	O
with	O
the	O
lowermost	O
edges	O
and	O
working	O
towards	O
the	O
top	O
;	O
this	O
is	O
conceptually	O
similar	O
to	O
the	O
Bentley	B-Algorithm
–	I-Algorithm
Ottmann	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
This	O
sweep	B-Algorithm
line	I-Algorithm
approach	O
divides	O
the	O
problem	O
space	O
by	O
scanlines	O
,	O
imaginary	O
horizontal	O
lines	O
that	O
pass	O
through	O
every	O
vertex	O
of	O
the	O
participating	O
polygons	B-General_Concept
.	O
</s>
<s>
These	O
scanbeams	O
are	O
processed	O
in	O
turn	O
,	O
starting	O
with	O
the	O
lowest	O
scanbeam	O
,	O
with	O
the	O
algorithm	O
adding	O
points	O
of	O
intersection	O
within	O
these	O
scanbeams	O
into	O
the	O
solution	O
polygons	B-General_Concept
.	O
</s>
