First: look back at the classic, and see how others do it.

Source: Internet
Author: User

Many people have this habit of starting from scratch when they want to do something they have never touched, instead, I learned from various channels whether this problem has been well resolved or whether it can be enlightened. This is a good habit, but we need to maintain the mindset of a bystander when referring to other people's solutions, and always pay attention to which part is useful to me and how much is used. What are the advantages of this, what are the shortcomings in doing so? Are the problems I have dealt with exactly the same as what I have been dealing with? What are the differences between them? We should not be able to take it with us!
I have this habit. The following is an analysis of some solutions I found when I first got in touch with the problem of any plane polygon triangle partitioning. Some of them are classic ones.

I. Definition of triangle partitioning
When talking about triangle partitioning, you have to first describe its definition: [1]
1. The generated triangles do not overlap;
2. No new vertex is generated.
Such a definition does not have to be so dogma. It is good to achieve this goal. However, if you consider other factors, such as universality, complexity, and performance, you can violate the rules as appropriate, the purpose of triangle partitioning is to use a triangle to fit a polygon.
In general, the first rule should not be violated. After all, the overlapping triangle can be further divided into non-overlapping ones. But the second article is not that easy to observe. Just put out the same Article of this definition, that is, reference 1. The algorithm it provides may generate additional vertices.
In the next article of this topic, I will describe my new algorithm. You will find that the irregular Triangle network generated by using this algorithm strictly complies with article 1, but the second violation is serious! However, this algorithm has the advantage of Processing Arbitrary Polygon in a wider sense. If you have read the homepage of this topic, you will find that I have proposed a new polygon: separating polygon. A polygon is a logical entity composed of multiple non-Intersecting polygon. It is expressed as a whole. This polygon algorithm can still work well. In the algorithm's opinion, it is no different from other polygon. In fact, the algorithm does not care about the polygon category and which vertex is concave, which vertex is convex. Haha, I was a little excited about my algorithms. I went back to the topic of this article and looked back at others' algorithms.

Ii. Segmentation

Boris Dirichlet

Born on: March 15, 1890
St. Petersburg
Except: July 17, 1980
Moscow

When talking about triangle partitioning, you have to be familiar with this name, which is a classic.
In this example, the relationship between the inner and the endpoint is a one-to-one relationship.
Here is its mathematical definition: [2] (you can leave it blank)
Make P = {P1, P2 ,..., Pn} is a set of n discrete points in a plane domain (R ^ 2). A complete canvas consists of multiple KNN polygon, the Mathematical Expression Form of the I-th canvas polygon is as follows:
Vi = {x ε R ^ 2: | x-Pi | <= | x-Pj |, j = 1 ,..., N; j = I}
Type, I = ,..., N, | x-Pi | Euclidean distance between point x and node Pi in the plane domain. From the above formula, we can see that the distance from any point x to the node Pi in the Vi is closer than that of any other node in the Point Set P, therefore, Vi is composed of the intersection of the open half plane formed by the node Pi and the vertical bisector of each adjacent node. Therefore, Vi must be a convex polygon.
Have you understood this mathematical expression? If you have understood it, congratulations! You are great. If you still have some ambiguity, you have nothing to do with it, in fact, The KNN graph is a polygon set composed of vertices from each node to the adjacent node. It's still a bit confused and doesn't matter. Let's look down, here is an 8-node canvas, where the solid line is the polygon.

In general, a vertex of a canvas map belongs to three pagerps at the same time, each of which has only one node. When the three nodes corresponding to the pagerended polygon of the three common points are connected, a Cartesian triangle is formed. The set of all these triangles is the famous AdaBoost triangle. The dotted line section in is the two-step structure.
The Triangle network that consists of the following features: [3]
1. the gridded network is unique;
2. The outer boundary of the triangular network forms the convex polygon "shell" of the Point Set P ";
3. There is no point in the external circle of the triangle. Otherwise, if a tin mesh meets this condition, it is a AdaBoost tin mesh;
4. if the smallest angle of each triangle in a triangular network is sorted in ascending order, the number of the obtained values is the maximum. In this sense, the gridded network is the "closest to the regular" network.
From the above algorithms and features, we can see that this splitting algorithm is not applicable to non-simple polygon with holes and polygon, and will generate unnecessary triangles, if a circle of five vertices on the Chinese and foreign faces constitute the outer ring with a hole polygon, and the three inner vertices constitute the inner ring, an extra triangle will be split out. In order to make the algorithm more universal, many people have made great efforts, such as [2] [4.
This algorithm is difficult due to its poor universality and obscure optimization algorithms. Because I am reading a thesis, this writing method makes me very uncomfortable and may not understand the author's subtle ideas very well, I strongly urge the authors of this paper to express your thoughts in plain words after completing this paper. Do you have to study it in that way?
I ran the question ~
The Triangle network that consists of the place where the place is located has good characteristics, but these are not so important to my application. My goal is to let D3D help me render a polygon, as for what is unique and irregular, there is no major problem.
The advantage of this algorithm is not important to me, but the disadvantage is crucial to me. Therefore, the conclusion is that this method is not used.

Iii. Other triangles
For a simple polygon, a method based on the concave and convex vertices is used to determine whether each vertex of a polygon is a concave point or a Convex Point. After a concave point is found, a triangle can be formed on both sides after the concave point, if not, continue searching for Concave points. If a triangle can be formed, record the triangle and move it away. Continue searching for Concave points until the decomposition is complete or there is no concave point, A Convex Polygon without concave points can be separated by any point lead segment. This method is applicable to a limited number of cases and cannot be broken down, for example. [5]

Of course, the method based on the concave and convex vertices is not the only one, but it was found in my paper as a back example.
Other non-simple polygon splitting algorithms are basically the same, that is, they connect the inner and outer rings and convert non-Simple Polygon into simple polygon [1] [5]. then we use other methods to deal with simple polygon, such as determining Based on concave and convex vertices. The following two figures provide a general idea.

 
Iv. Summary
After talking about this, it is actually just a small tip of the iceberg in this field. I have seen algorithms that are more or less different from my needs. So I started to think about a simple concept and implement it conveniently, the splitting method with excellent performance and wide applicability is fortunate to have found such a method and is doing well in practical use. From the next article, I will elaborate on this algorithm in detail.

V. References:
1. Xu chunlei, Li sikun. A triangle partitioning algorithm applicable to any plane polygon [J]. Journal of the National University of Defense Technology. Vol. 22nd, No. 2nd
2. Ding Yongxiang, Xia Jumbo, Wang Ying, and Xiao jingrong. Cartesian division of arbitrary polygon [J]. Journal of computer science. Vol. 17th, issue 1
3. http://baike.baidu.com/view/501103.htm
4. Tu Zhihong, Sannong. Using VC language to implement the completely triangle partitioning algorithm for arbitrary polygon. Computer and digital engineering. Vol. 33rd
5. Chen xiangping, Ying daoning. Arbitrary Polygon triangle partitioning algorithm [J]. Journal of Zhejiang University. No. 6, vol. 22nd, December November 1988

 

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.