American Journal of Applied Sciences 6 (2): 214-218, 2009
ISSN 1546-9239
© 2009 Science Publications
Corresponding Author: Mohammad Qatawneh, Department of Computer Science, KASIT, University of Jordan,
P.O. Box 13047, Amman 11942, Jordan Tel: 00962-79-5502200 Fax: 00962-6-5681343
214
Parallel Implementation of Polygon Clipping Using Transputer
Mohammad Qatawneh, Azzam Sleit and Wesam Almobaideen
Department of Computer Science, KASIT, University of Jordan,
P.O. Box 13047, Amman 11942, Jordan
Abstract: This research describes a parallel implementation of Liang-Barsky clipping algorithm on a
pipeline network configuration. The implemented configuration uses pipeline of four transputers and
programmed under Occam2 language. In order to achieve the concurrency, to improve the performance
and to cut down the hold-ups caused by the calculation of intersection, data buffering is used.
Key words: Parallel clipping, transputer, pipeline
INTRODUCTION
Computer graphics is a field of computing which
requires intensive processor use. Algorithms in graphics
are very repetitive and operate on very large data sets.
The process of clipping can be defined as the process of
removing the portion of an image that falls outside the
visible region. In graphics, there are line and polygon
clipping algorithms
[3,4,5,7,8]
. The polygon clipping
algorithm clips a polygon against one boundary
window after another, rather than clipping against all
boundaries at once. This has certain features which is a
natural candidate for parallel implementation.
Several well-known polygon clipping algorithms
have been proposed
[1,2,4,10,12,13]
. The basic idea of these
algorithms is to clip a given polygon against each
boundary line of the window separately. Both
Sutherland-Hogman and Liang-Barsky algorithms
generate connected clipped polygons
[9,12]
. The Liang-
Barsky algorithm is optimized for rectangular windows
but is extendable to arbitrary convex windows. Results
indicate that for rectangular windows the optimized
algorithm is twice as fast as the Sutherland-Hogman.
Liang-Barsky is a parametric polygon clipping
algorithm.
The choice of parallel configuration for a particular
problem is not always straightforward. Much research
in parallel processing
[6,11]
is directed towards matching
problems to configuration. This research presents a
parallel implementation of Liang-Barsky polygon
clipping algorithm which is based on a Transputer
Development System (TDS). The INOMS T414
transputer
[7]
is a 32 bit microcomputer with 4Kbytes on-
chip RAM for high speed processing, a configurable
memory interface, and all necessary system services. It
has four ports of communication links all in single
wafer. The programming language Occam
[7,11]
is a
concurrent programming language designed for the
transputer. The implemented system uses pipeline of
four transputer and programmed under Occam2
language.
DESIGN CONSIDERATION
An arrangement of four processors in a pipeline-
configuration is an obvious method of implementing
polygon-clipping algorithms
[2,3]
against four
boundaries. Each processor runs the clipping process
for a different boundary, where polygon data passes
from processor to processor. In addition, four other
processes are required to make the pipeline work, these
are: Reading and writing data to the pipeline, create the
polygon data and to display the resulting clipped
polygon.
Figure 1 shows an example of two processes
(create and write) accessing the common area of
memory have to be synchronized to avoid unpredictable
result. The create process can terminate before the write
process starts. Also, the boundary data (bound data) and
write processes both communicate with clip.bo. Hence
synchronization is achieved through the running order
of the process. Fig. 2 shows the pseudo Occam which
presents the ordering of these processes.
A problem that can be greatly reducing the
performance of a pipeline is uneven load balance. This
problem may occur when a processor in the pipeline
takes longer to perform some process than the other
elements of the pipeline. Since all the processors, in the
research paper work, run the same code, there is
nothing that can be done to even up the load balance by
redistributing the code.