This document discusses different techniques for computer graphics clipping. It describes point clipping, line clipping using the Cohen-Sutherland and Liang-Barsky algorithms, area/polygon clipping using the Sutherland-Hodgman and Weiler-Atherton algorithms, curve clipping, and text clipping. Various preliminary tests and intersection calculations are used to identify and remove graphic elements that are outside the clipping region.
with today's advanced technology like photoshop, paint etc. we need to understand some basic concepts like how they are cropping the image , tilt the image etc.
In our presentation you will find basic introduction of 2D transformation.
with today's advanced technology like photoshop, paint etc. we need to understand some basic concepts like how they are cropping the image , tilt the image etc.
In our presentation you will find basic introduction of 2D transformation.
Cohen-Sutherland Line Clipping Algorithm:
When drawing a 2D line on screen, it might happen that one or both of the endpoints are outside the screen while a part of the line should still be visible. In that case, an efficient algorithm is needed to find two new endpoints that are on the edges on the screen, so that the part of the line that's visible can now be drawn. This way, all those points of the line outside the screen are clipped away and you don't need to waste any execution time on them.
A good clipping algorithm is the Cohen-Sutherland algorithm for this solution.
By,
Maruf Abdullah Rion
a spline is a flexible strip used to produce a smooth curve through a designated set of points.
Polynomial sections are fitted so that the curve passes through each control point, Resulting curve is said to interpolate the set of control points.
The Lian-Barsky algorithm is a line clipping algorithm. This algorithm is more efficient than Cohen–Sutherland line clipping algorithm and can be extended to 3-Dimensional clipping. This algorithm is considered to be the faster parametric line-clipping algorithm. The following concepts are used in this clipping:
The parametric equation of the line.
The inequalities describing the range of the clipping window which is used to determine the intersections between the line and the clip window.
Cohen-Sutherland Line Clipping Algorithm:
When drawing a 2D line on screen, it might happen that one or both of the endpoints are outside the screen while a part of the line should still be visible. In that case, an efficient algorithm is needed to find two new endpoints that are on the edges on the screen, so that the part of the line that's visible can now be drawn. This way, all those points of the line outside the screen are clipped away and you don't need to waste any execution time on them.
A good clipping algorithm is the Cohen-Sutherland algorithm for this solution.
By,
Maruf Abdullah Rion
a spline is a flexible strip used to produce a smooth curve through a designated set of points.
Polynomial sections are fitted so that the curve passes through each control point, Resulting curve is said to interpolate the set of control points.
The Lian-Barsky algorithm is a line clipping algorithm. This algorithm is more efficient than Cohen–Sutherland line clipping algorithm and can be extended to 3-Dimensional clipping. This algorithm is considered to be the faster parametric line-clipping algorithm. The following concepts are used in this clipping:
The parametric equation of the line.
The inequalities describing the range of the clipping window which is used to determine the intersections between the line and the clip window.
he capability that show some part of object internal a specify window is called windowing and a rectangular region in a world coordinate system is called window. ... Points and lines which are outside the window are "cut off" from view. This process of "cutting off" parts of the image of the world is called Clipping.
Sutherland hodgman polygon clipping algorithmTawfiq Ahmed
Sutherland Hodgman polygon clipping algorithm is a very simple clipping algorithm to understand. I hope my slide will help you guys.
-Thanks
Tawfiq Ahmed
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
2. CLIPPING
Clipping is the process of removing lines or
portions of lines outside an area of interest.
Typically, any line or part thereof which is outside
of the viewing area is removed.
Clipping Algorithm :
Identifies those portions of a picture that are
either inside or outside of a specified region of
space.
4. Point Clipping
For a point (x,y) to be inside the clip rectangle:
(xmin, ymin)
(xmax
, ymax
)
x = xmin
x = xmax
y = ymin
y = ymax
(x1
, y1
)
clip
rectangle
5. Point Clipping
Clip window: rectangle, edges of the clip window
(xwmin, xwmax, ywmin, ywmax)
If xwmin x xwmax
ywmin y ywmax
Then
The point p = (x, y) is saved
for display
Otherwise: the point is clipped (not saved for
display).
7. Line Clipping
Inside – Outside test:
Completely Inside: A line with both endpoints
inside all clipping boundaries, such as the line from
p1 to p2, is saved.
Completely Outside: A line with both endpoints
outside any one of the clip boundaries, such as the
line from p3 to p4, is not saved.
If the line is not completely inside or completely
outside, we must perform intersection calculations
with one or more clipping boundaries.
8. Cohen-Sutherland Line Clipping
This method speeds up the processing of the line
segment by performing initial tests that reduce the
number of intersections that must be calculated.
Every line endpoint in a picture is assigned a four-
digit binary code, called region code that identifies
the location of the point relative to the boundaries
of the clipping rectangle.
Bit 4 Bit 3 Bit 2 Bit 1
Above Below Right Left
10. Cohen-Sutherland Line Clipping
Region-code bit values can be determined
as follows:
Bit 1 is the sign bit of x – xwmin
Bit 2 is the sign bit of xwmax – x
Bit 3 is the sign bit of y – ywmin
Bit 4 is the sign bit of ywmax – y
If the sign is negative the bit is set to 1
otherwise is set to 0.
11. Cohen-Sutherland Line Clipping
Any lines that has a region code of 0000 for both
endpoint are completely inside, we save these
lines.
Any lines that have a 1 in the same bit position in
the region-codes for each endpoint are completely
outside and we reject these lines.
A method that can be used to test lines for total
clipping is to perform the logical AND operation
with both region codes. If the result is not 0000, the
line is completely outside the clipping region.
12. Cohen-Sutherland Line Clipping
p1 0100
p2 1001
p3 0001
p4 0100
p1 AND p2 =0000
p3 AND p4 =0000
Bit 4 Bit 3 Bit 2 Bit 1
Above Below Right Left
13. Cohen-Sutherland Line Clipping
For a line with endpoint (x1, y1) and (x2, y2)
m = (y2 – y1) / (x2 – x1)
Intersection points with the clipping boundary:
The intersection with vertical boundary (x=xwmin or
x=xwmax), the y coordinate can be calculated as:
y = y1 + m(x – x1)
The intersection with a horizontal boundary
(y=ywmin or y=ywmax.), the x coordinate can be
calculated as
x = x1 + (y – y1) / m
15. Liang-Barsky Line Clipping
Algorithm
2. Determine the value of u1 is by looking at the
rectangle edges for which the line proceeds from
outside to the inside (pk < 0). The value of u1 is
taken as the largest of the set consisting of 0 and
the various values of r.
3. Determine the value of u2 by examining the
boundaries for which the line proceeds from
inside to the outside (pk > 0). A value of rk is
calculated for each of these boundaries, and the
value of u2 is the minimum of the set consisting
of 1 and the calculated r values.
16. Liang-Barsky Line Clipping
Algorithm
4. If u1 > u2, the line is completely outside the clip
window and it can be discarded.
5.Otherwise, the endpoints of the clipped line are
calculated from the two values of parameter u.
If u2 <1 x= x1+u2 x, y = y1 +u2 y
Otherwise x = x2, y = y2
If u1 >0 x= x1+u1 x, y = y1 +u1 dy
Otherwise x = x1, y = y1
17. Area Clipping (polygon clipping)
To clip a polygon, we cannot directly apply a line-
clipping method to the individual polygon edges
because this approach would produce a series of
unconnected line segments as shown in figure .
18. Area Clipping (polygon clipping)
The clipped polygons must be a bounded area after clipping
as shown in figure.
For polygon clipping, we require an algorithm that will
generate one or more closed areas that are then scan
converted for the appreciate area fill.
The output of a polygon clipper should be a sequence of
vertices that defines the clipped polygon boundaries.
19. Sutherland-Hodgman Polygon
Clipping
Clip a polygon by processing the polygon boundary as a
whole against each window edge.
Processing all polygon vertices against each clip rectangle
boundary in turn.
Beginning with the initial set of polygon vertices, we
could first clip the polygon against the left rectangle
boundary to produce a new sequence of vertices
The new set of vertices could be successively passed to a
right boundary clipper, a bottom boundary clipper, and a
top boundary clipper, a right boundary clipper.
20. Sutherland-Hodgman Polygon
Clipping
There are four possible cases when processing
vertices in sequence around the perimeter of a
polygon.
As each pair of adjacent polygon vertices is passed
to a next window boundary clipper, we make the
following tests:
21. Sutherland-Hodgman Polygon
Clipping
1. If the first vertex is outside the window boundary
and the second vertex is inside
Then , both the intersection point of the polygon
edge with the window boundary and the second
vertex are added to the output vertex list.
23. Sutherland-Hodgman Polygon
Clipping
3. If the first vertex is inside the window boundary
and the second vertex is outside.
Then, only the edge intersection with the window
boundary is added to the output vertex list.
25. Weiler-Atherton Polygon Clipping
This algorithm was developed for identifying visible
surfaces, and can be used to clip a fill area that is either a
convex polygon or a concave polygon.
The basic idea of this algorithm is that instead of
proceeding around the polygon edges as vertices are
processed, we will follow the window boundaries.
The path we follow depends on:
• polygon-processing direction(clockwise or
counterclockwise)
• The pair of polygon vertices
• outside-to-inside or an inside-to-outside.
26. Weiler-Atherton Polygon Clipping
For clockwise processing of polygon vertices, we
use the following rules:
• For an outside-to-inside pair of vertices, follow
polygon boundaries.
• For an inside-to-outside pair of vertices, follow
window boundaries in a clockwise direction.
28. Curve Clipping
Curve clipping procedures will
involve non-linear equations.
So requires more processing
than for objects with linear
Boundaries.
29. Curve Clipping
Preliminary test (Test for overlapping)
-The bounding rectangle for a circle or other curved
object is used to test for overlap with a
rectangular clip window.
-If the bounding rectangle is completely inside (save
object), completely outside (discard the object)
-Both cases-no computation is necessary.
-If bounding rectangle test fails, use computation-
saving approaches.
30. Curve Clipping
Circle-coordinate extents of individual quadrants &
then octants are used for preliminary testing before
calculating curve-window intersections
Ellipse- coordinate extents of individual quadrants
are used.
If 2 regions overlap, solve the simultaneous line-
curve equations to obtain the clipping intersection
points.
31. Text Clipping
There are several techniques that can be used to
provide text clipping in a graphics packages.
The choice of clipping method depends on how
characters are generated and what requirements
we have for displaying character strings.
32. Text Clipping
All-or-none string-clipping
If all of the string is inside a clip window, we keep
it.
Otherwise the string is discarded.
33. Text Clipping
All-or-none character-clipping
Here we discard only those characters that are not
completely inside the window
34. Text Clipping
Clip the components of individual characters
We treat characters in much the same way that we
treated lines.
If an individual character overlaps a clip window
boundary, we clip off the parts of the character that
are outside the window