# An Efficient Geometric Algorithm for Clipping and Capping Solid Triangle Meshes

### Aaron Scherzinger, Tobias Brix, Klaus H. Hinrichs

#### Abstract

Clipping three-dimensional geometry by arbitrarily oriented planes is a common operation in computer graphics and visualization applications. In most cases, the geometry used in those applications is provided as surface models consisting of triangles which are called meshes. Clipping such surface models by a plane cuts them open, destroying the illusion of a solid object. Often this is not desirable, and the resulting mesh should again be a closed surface model, e.g., when generating cross-sections in technical visualization applications. We propose an algorithm which performs the clipping operation geometrically for a given input mesh on the GPU. The intersection edges of the mesh and the clipping plane are then transferred to the CPU, where a cap geometry closing the mesh is computed and eventually added to the clipped mesh. Our algorithm can process solid (i.e., closed two-manifold) triangle meshes, or sets of non-intersecting solids, and has a worst-case runtime of O(N + n log n) where N is the number of triangles in the input geometry, and n is the number of input triangles intersecting the clipping plane.

#### References

- Bajaj, C. L. and Dey, T. K. (1990). Polygon nesting and robustness. Inf. Proc. Lett., 35(1):23-32.
- Burns, M. and Finkelstein, A. (2008). Adaptive cutaways for comprehensible rendering of polygonal scenes. ACM Transactions on Graphics, 27(5):154:1-154:7.
- Chazelle, B. (1991). Triangulating a simple polygon in linear time. Discrete & Comput. Geom., 6(5):485-524.
- de Berg, M., Cheong, O., van Kreveld, M., and Overmars, M. (2008). Computational Geometry: Algorithms and Applications. Springer, 3rd edition.
- Erleben, K. and Henriksen, K. (2006). A simple plane patcher algorithm. Technical Report DIKU-TR06/09, Department of Computer Science, University of Copenhagen.
- Foley, J. D., van Dam, A., Feiner, S. K., and Hughes, J. F. (1996). Computer Graphics: Principles and Practice, 2nd ed. in C. Addison-Wesley.
- Garey, M. R., Johnson, D. S., Preparata, F. P., and Tarjan, R. E. (1978). Triangulating a simple polygon. Inf. Proc. Let., 7(4):175-179.
- Huang, J., Yagel, R., Filippov, V., and Kurzion, Y. (1998). An accurate method for voxelizing polygon meshes. In Proceedings of the 1998 IEEE Symposium on Volume Visualization, VVS 7898, pages 119-126. ACM.
- Lee, D. T. and Preparata, F. P. (1977). Location of a point in a planar subdivision and its applications. SIAM J. on Computing, 6(3):594-606.
- Lewiner, T., Lopes, H., Vieira, A. W., and Tavares, G. (2003). Efficient implementation of marching cubes' cases with topological guarantees. J. of Graphics Tools, 8:2003.
- McGuire, M. (2011). Efficient triangle and quadrilateral clipping within shaders. J. of Graphics, GPU, and Game Tools, 15(4):216-224.
- McReynolds, T. and Blythe, D. (2005). Advanced Graphics Programming Using OpenGL. Morgan Kaufmann.
- Schwarz, M. and Seidel, H.-P. (2010). Fast parallel surface and solid voxelization on gpus. ACM Transactions on Graphics, 29(6):179:1-179:10.
- Sutherland, I. E. and Hodgman, G. W. (1974). Reentrant polygon clipping. Comm. of the ACM, 17(1):32-42.
- Trapp, M. and Döllner, J. (2013). 2.5d clip-surfaces for technical visualization. J. of WSCG, 21(1):89-96.
- Weiskopf, D., Engel, K., and Ertl, T. (2003). Interactive clipping techniques for texture-based volume visualization and volume shading. IEEE Transactions on Visualization and Computer Graphics, 9(3):298-312.

#### Paper Citation

#### in Harvard Style

Scherzinger A., Brix T. and H. Hinrichs K. (2017). **An Efficient Geometric Algorithm for Clipping and Capping Solid Triangle Meshes** . In *Proceedings of the 12th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 1: GRAPP, (VISIGRAPP 2017)* ISBN 978-989-758-224-0, pages 187-194. DOI: 10.5220/0006097201870194

#### in Bibtex Style

@conference{grapp17,

author={Aaron Scherzinger and Tobias Brix and Klaus H. Hinrichs},

title={An Efficient Geometric Algorithm for Clipping and Capping Solid Triangle Meshes},

booktitle={Proceedings of the 12th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 1: GRAPP, (VISIGRAPP 2017)},

year={2017},

pages={187-194},

publisher={SciTePress},

organization={INSTICC},

doi={10.5220/0006097201870194},

isbn={978-989-758-224-0},

}

#### in EndNote Style

TY - CONF

JO - Proceedings of the 12th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 1: GRAPP, (VISIGRAPP 2017)

TI - An Efficient Geometric Algorithm for Clipping and Capping Solid Triangle Meshes

SN - 978-989-758-224-0

AU - Scherzinger A.

AU - Brix T.

AU - H. Hinrichs K.

PY - 2017

SP - 187

EP - 194

DO - 10.5220/0006097201870194