Computer Graphics (ii) OUTPUT element _10_ polygon filling Area _1_ polygon classification and recognition

Source: Internet
Author: User
Tags polyline

Polygon Fill Area
a polygon (polygon) is mathematically defined as a planar shape described by three or more coordinate positions called vertices, which are connected sequentially by edges (edge or side) called a multilateral nature . further , geometrically requires that the edges of polygons have no common points other than the endpoints . Thus, by definition, a polygon must have all its vertices on its single plane and no cross between edges. Examples of polygons are triangles, rectangles, eight-sided shapes, and ten hexagons. Sometimes a planar shape with a closed polyline boundary refers to a polygon, and if it has no intersecting edges it is called a standard polygon (polygon) or simple polygon. To avoid the confusion of object references, we limit the term "polygon" to planar graphics with closed polyline boundaries and no intersecting edges.
In the application of computer graphics, a set of vertices used to specify a polygon is not strictly on a plane . This may be caused by numerical rounding errors, incorrect selection of coordinate positions, or more generally due to the approximation of a surface using a set of polygon patches. One way to correct the problem is to simply split the specified surface mesh into triangles. However, it is sometimes necessary to preserve the original shape of the network patches in order to develop a method for approximating non-planar polygons with planar graphs. We will discuss how to calculate these approximation planes in the relevant content of the plane equation.
10.1 Multi-Edge classification
all inner angles (infterior angle) of an internal angle shape of a polygon are the corners within the polygon boundaries formed by two adjacent edges. if all the inner angles of a polygon are less than 180 degrees, the polygon is a convex (convex) polygon . An equivalent definition of a convex polygon is its internalThe part is entirely on either side of it and its extension. Similarly, if any two points are located inside the convex polygon, the connection isInternal. Polygons that are not convex polygons are called concave (concave) polygons . Figure 3.42 shows an example of convex and concave polygons.

the term degenerate polygon (degenerate polygon) is commonly used to describe the set of vertices of a collinear or overlapping coordinate position . Co-line vertex birthinto a line segment. Overlapping vertex positions can produce polygons with extra segments, overlapping edges, or 0-length edges. Sometimes the terminology is much degradedThe Edge shape is also used for vertex queues that are less than three coordinate positions. for software robustness, graphics packages can reject degraded or non-planar vertex sets. But this requires additional identification of the problem, so the graphics system often leaves this consideration to the programmer.
concave polygons can also have some related problems. The filling algorithm for concave polygons and the implementation of other subroutines are more complex, so concave polygons are often segmented into a set of convex faces before processing to improve efficiency. As with other polygon preprocessing algorithms, concave- The segmentation of edges is generally not included in the Graph function library. graphics packages such as OpenGL require that all filled polygons be convex and multilateralshape. Some systems accept only triangular fill areas, which greatly simplifies many display functions.

10.2 Identifying concave polygons

at least one inner angle in a concave polygon is greater than 180 degrees. The extension lines of some edges of a concave polygon intersect with other edges and sometimes an internal Point lines intersect the polygon boundaries . Therefore, we can use any one of these features of the concave polygon as the base design not the algorithm . If you create a vector for each side, you can use the cross product of adjacent edges to test the convexity. All vector cross product of convex polygonare the same number. Therefore, if some of the cross-product take positive values and others are negative, you can determine that they are concave polygons. Figure 3.43 shows the identification of the concave edge vector, cross product method for polygons.

Another way to identify concave polygons is to observe the relationship of the polygon vertex position to each edge extension line. If some vertices are on one side of the extension lines and some other vertices are on the other side, the polygon is a concave polygon.


Computer Graphics (ii) OUTPUT element _10_ polygon filling Area _1_ polygon classification and recognition

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.