Simple yet robust triangulation for polygons containing multiple holes for real-time 3D industrial applications
DOI:
https://doi.org/10.30973/progmat/2024.16.1/2Keywords:
Polygon triangulation, Ear clipping algorithm, Polygon with holes, Real-Time visualizationAbstract
In industrial applications such as CAD modeling, manufacture or automated systems, it is common to work with data models that are represented by polygonal shapes, or models that produce polygonal shapes out of complex geometry defined by lines and curves. However, this data has to be converted to a triangular mesh before it can be processed and/or rendered by the GPU. Existing solutions that generate triangular mesh out of polygonal shapes either do not support holes or have limitations on how many holes can be present at the same time. Most modern advanced solutions need considerable effort to implement, debug and maintain, which involves significant development costs. In this work, an alternative solution is proposed, which is relatively simple to implement yet is sufficiently robust to handle all possible input scenarios handling any number of holes, or inner polygons in an outer polygon, assuming that polygons do not intersect each other or themselves, and makes no assumptions about the winding order of polygon vertices. The proposed solution involves initial pre-processing work, merging inner polygons into an outer polygon, and then performing polygon triangulation using one of the two proposed variations of an Ear Clipping algorithm. The proposed solution is shown to handle practically an unlimited number of holes in polygon independently of its shape. Quality and performance comparison between two techniques is also provided and discussed, along with the images of a real life CAD application, which implements the proposed solution.
References
Garey, M.R., Johnson, D.S., Preparata, F.P., Tarjan, R.E. Triangulating a simple polygon. Information Processing Letters, 1978, 7(4), 175-179. https://doi.org/10.1016/0020-0190(78)90062-5.
Berg, M., Cheong, O., Kreveld, M., Overmars, M. Computational Geometry. Berlin: Springer, 2008. https://doi.org/10.1007/978-3-540-77974-2.
O'Rourke, J. Computational Geometry in C. Cambridge: Cambridge University Press, 1998. https://doi.org/10.1017/CBO9780511804120.
Meisters, G.H. Polygons Have Ears. The American Mathematical Monthly. 1975, 82(6), 648-651. https://doi.org/10.1080/00029890.1975.11993898.
ElGindy, H., Everett, H., Toussaint, G. Slicing an ear using prune-and-search. Pattern Recognition Letters. 1993, 14(9), 719-722. https://doi.org/10.1016/0167-8655(93)90141-Y.
Kong, X., Everett, H., Toussaint, G. The Graham scan triangulates simple polygons. Pattern Recognition Letters, 1990, 11(11). 713-716. https://doi.org/10.1016/0167-8655(90)90089-K.
Mei, G., Tipper, J.C., Xu, N. Ear-Clipping Based Algorithms of Generating High-Quality Polygon Triangulation. In 2012 Int. Conf. on Information Technology and Software Engineering. LNEE, 2012, 212, 979-988. https://doi.org/10.1007/978-3-642-34531-9_105.
Eberly, D. Triangulation by Ear Clipping. Geometric Tools. Nov. 18, 2002. Accessed August 4, 2023 from https://www.geometrictools.com/Documentation/Documentation.html
Preparata, F.P., Shamos, M.I. Computational Geometry: An Introduction. New York, NY: Springer, 1985. https://doi.org/10.1007/978-1-4612-1098-6.
Chew, L.P. Constrained Delaunay triangulations. Algorithmica, 1989, 4, 97-108. https://doi.org/10.1007/BF01553881.
Wijeweera, K.R., Kodituwakku. S.R. Accurate, Simple and Efficient Triangulation of a Polygon by Ear Removal. Ceylon Journal of Science, 2016, 45(3), 65-76. https://doi.org/10.4038/cjs.v45i3.7402.
McKenna, M., Toussaint, G.T. Finding the minimum vertex distance between two disjoint convex polygons in linear time. Computer & Mathematics with Applications. 1985, 11(12), 1227-1242. https://doi.org/10.1016/0898-1221(85)90109-9.
Toussaint, G.T. An optimal algorithm for computing the minimum vertex distance between two crossing convex polygons. Computing. 1984, 32, 357-364. https://doi.org/10.1007/BF02243778.
Aggarwal, A., Moran, S. Shor, P.W. Suri. S. Computing the minimum visible vertex distance between two polygons. In Workshop on Algorithms and Data Structures (WADS 1989). LNCS, 1989, 382, 115-134. https://doi.org/10.1007/3-540-51542-9_11.
Amato, N.M. An optimal algorithm for finding the separation of simple polygons. In Workshop on Algorithms and Data Structures (WADS 1993). LNCS, 1993, 709, 48-59. https://doi.org/10.1007/3-540-57155-8_235.
Wang, C., Chan, E.P.F. Finding the minimum visible vertex distance between two non-intersecting simple polygons. Second Annual Symposium on Computational Geometry. ACM, 1986, 34-42. https://doi.org/10.1145/10515.10519.
Seidel, R. A simple and fast incremental randomized algorithm for computing trapezoidal decompositions and for triangulating polygons. Computational Geometry, 1991, 1(1), 51-64. https://doi.org/10.1016/0925-7721(91)90012-4.
Published
How to Cite
Issue
Section
License
Copyright (c) 2024 Yuriy Kotsarenko
This work is licensed under a Creative Commons Attribution 4.0 International License.
Usted es libre de:
Compartir — compartir y redistribuir el material publicado en cualquier medio o formato. |
Adaptar — combinar, transformar y construir sobre el material para cualquier propósito, incluso comercialmente. |
Bajo las siguientes condiciones:
Atribución — Debe otorgar el crédito correspondiente, proporcionar un enlace a la licencia e indicar si se realizaron cambios. Puede hacerlo de cualquier manera razonable, pero de ninguna manera que sugiera que el licenciador lo respalda a usted o a su uso. |
Sin restricciones adicionales: no puede aplicar términos legales o medidas tecnológicas que restrinjan legalmente a otros a hacer cualquier cosa que permita la licencia. |