Im trying to triangulate a polygon for use in a 3d model. When I try to use the ear method on the polygon with the points indicated below, I get triangles where the red lines are. Since there are no other points in these triangles, this is probably correct. But I want him to triangulate the area inside the black lines. Does anyone know any algorithms that will do this?
There are many algorithms for triangulating a polygon that does not need to be split into monotone polygons. One of them is described in my textbook Computational Geometry in C , which has code associated with it that can be freely downloaded from this link (in C or Java). You must first have the points in the order corresponding to the border bypass. My code assumes counterclockwise, but of course it is easy to change. See Also Wikipedia article. Perhaps it is your problem that you do not have agreed border points?
The usual approach would be to split your simple polygon into a monotone polygon using trapezoidal decomposition, and then triangulate the monotone polygons. The first part can be achieved using the sweep line algorithm. And accelerations are possible with the correct data structure (for example, a doubly linked list of edges). The best description of this that I know can be found in Computational Geometry . This and this also seems useful.
Wikipedia suggests that you split a polygon into monotonous polygons. You check that the polygon is not concave, just checking that all angles are less than 180 degrees - any angles with an angle greater than 180 are concave, and you need to break it in this corner.
If you can use C ++, you can use CGAL and, in particular, the example below, which can triangulate a lot of disjoint polygons. This example only works if you already know the black segments.
You need to use the EarClipping algorithm, not Delaunay. See the following white paper: http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf
Source: https://habr.com/ru/post/906154/More articles:Java Behavior ScheduledExecutorService.scheduleAtFixedRate () - javahttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/906150/setting-project-specific-maven-repository&usg=ALkJrhgVCo2LnFA6YNK2Y_JsYOX5xJqOPgPython freeze function - pythonHow to restrict Prism 4 to download only special signed modules? - c #What is the story + before the hash file that disambiguates the code block? - syntaxHow heavy is .NET exception handling? - c #NSDistributedNotificationCenter not working for dylib - objective-chttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/906157/prevent-jenkins-from-installing-artifact-to-local-maven-repository&usg=ALkJrhiPOh_zMILX4wSF5k8yol6aSL82wQWhy aren't newlines printed in this Perl code? - perlCan I force my own short circuit in a method call? - c #All Articles