skip to main content
research-article

IMESH: A DSL for Mesh Processing

Published: 25 June 2024 Publication History

Abstract

Mesh processing algorithms are often communicated via concise mathematical notation (e.g., summation over mesh neighborhoods). However, conversion of notation into working code remains a time-consuming and error-prone process, which requires arcane knowledge of low-level data structures and libraries—impeding rapid exploration of high-level algorithms. We address this problem by introducing a domain-specific language (DSL) for mesh processing called IMESH, which resembles notation commonly used in visual and geometric computing and automates the process of converting notation into code. The centerpiece of our language is a flexible notation for specifying and manipulating neighborhoods of a cell complex, internally represented via standard operations on sparse boundary matrices. This layered design enables natural expression of algorithms while minimizing demands on a code generation backend. In particular, by integrating IMESH with the linear algebra features of the ILA DSL and adding support for automatic differentiation, we can rapidly implement a rich variety of algorithms on point clouds, surface meshes, and volume meshes.

Supplementary Material

TOG-23-0124-SUPP (tog-23-0124-supp.pdf)
Supplementary material

References

[1]
Samer Alhaddad, Jens Förstner, Stefan Groth, Daniel Grünewald, Yevgen Grynko, Frank Hannig, Tobias Kenter, Franz-Josef Pfreundt, Christian Plessl, Merlind Schotte, Thomas Steinke, Jürgen Teich, Martin Weiser, and Florian Wende. 2022. The HighPerMeshes framework for numerical algorithms on unstructured grids. Concurrency and Computation: Practice and Experience 34, 14 (2022), e6616.
[2]
Eric Allen, David Chase, Joe Hallett, Victor Luchangco, Jan-Willem Maessen, Sukyoung Ryu, Guy L. Steele Jr., Sam Tobin-Hochstadt, Joao Dias, Carl Eastlund, et al. 2005. The Fortress language specification. Sun Microsystems 139, 140 (2005), 9.
[3]
Martin S. Alnæs, Anders Logg, Kristian B. Ølgaard, Marie E. Rognes, and Garth N. Wells. 2014. Unified form language: A domain-specific language for weak formulations of partial differential equations. ACM Transactions on Mathematical Software 40, 2 (Feb.2014), 1–37. DOI:
[4]
David Baraff and Andrew Witkin. 1998. Large steps in cloth simulation. In Proceedings of the 25th Annual Conference on Computer Graphics and Interactive Techniques. 43–54.
[5]
Igor A. Baratta, Joseph P. Dean, Jørgen S. Dokken, Michal Habera, Jack S. Hale, Chris N. Richardson, Marie E. Rognes, Matthew W. Scroggs, Nathan Sime, and Garth N. Wells. 2023. DOLFINx: The Next Generation FEniCS Problem Solving Environment. preprint. DOI:
[6]
Bruce G. Baumgart. 1972. Winged Edge Polyhedron Representation. Technical Report. Stanford University Department of Computer Science.
[7]
Gilbert Louis Bernstein and Fredrik Kjolstad. 2016. Perspectives: Why new programming languages for simulation? ACM Transactions on Graphics (TOG) 35, 2 (2016), 1–3.
[8]
Gilbert Louis Bernstein, Chinmayee Shah, Crystal Lemire, Zachary Devito, Matthew Fisher, Philip Levis, and Pat Hanrahan. 2016. Ebb: A DSL for physical simulation on CPUs and GPUs. ACM Transactions on Graphics (TOG) 35, 2 (2016), 1–12.
[9]
Jeff Bezanson, Alan Edelman, Stefan Karpinski, and Viral B. Shah. 2017. Julia: A fresh approach to numerical computing. SIAM Review 59, 1 (2017), 65–98.
[10]
Botsch Steinberg Bischoff, M. Botsch, S. Steinberg, S. Bischoff, L. Kobbelt, and Rwth Aachen. 2002. OpenMesh–A generic and efficient polygon mesh data structure. In OpenSG Symposium.
[11]
Jose Luis Blanco and Pranjal Kumar Rai. 2014. nanoflann: A C++ Header-only Fork of FLANN, a Library for Nearest Neighbor (NN) with KD-trees. https://github.com/jlblancoc/nanoflann
[12]
Camille Brunel, Pierre Bénard, and Gaël Guennebaud. 2021. A time-independent deformer for elastic contacts. ACM Transactions on Graphics (TOG) 40, 4 (2021), 1–14.
[13]
Luciano A. Romero Calla, Lizeth J. Fuentes Perez, and Anselmo A. Montenegro. 2019. A minimalistic approach for fast computation of geodesic distances on triangular meshes. Computers & Graphics 84 (2019), 77–92.
[14]
Swen Campagna, Leif Kobbelt, and Hans-Peter Seidel. 1998. Directed edges–a scalable representation for triangle meshes. Journal of Graphics Tools 3, 4 (1998), 1–11.
[15]
Marcel Campen, Hanxiao Shen, Jiaran Zhou, and Denis Zorin. 2019. Seamless parametrization with arbitrary cones for arbitrary genus. ACM Transactions on Graphics (TOG) 39, 1 (2019), 1–19.
[16]
Prashanth Chandran, Loïc Ciccone, Markus Gross, and Derek Bradley. 2022. Local anatomically-constrained facial performance retargeting. ACM Transactions on Graphics (TOG) 41, 4 (2022), 1–14.
[17]
Keenan Crane, Fernando de Goes, Mathieu Desbrun, and Peter Schröder. 2013. Digital geometry processing with discrete exterior calculus. In ACM SIGGRAPH 2013 Courses (SIGGRAPH’13). ACM, New York, NY, USA, 126 pages.
[18]
Leonardo de Moura, Soonho Kong, Jeremy Avigad, Floris Van Doorn, and Jakob von Raumer. 2015. The Lean theorem prover (system description). In International Conference on Automated Deduction. Springer, 378–388.
[19]
Zachary DeVito, Niels Joubert, Francisco Palacios, Stephen Oakley, Montserrat Medina, Mike Barrientos, Erich Elsen, Frank Ham, Alex Aiken, Karthik Duraisamy, et al. 2011. Liszt: A domain specific language for building portable mesh-based PDE solvers. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis. 1–12.
[20]
Antonio DiCarlo, Alberto Paoluzzi, and Vadim Shapiro. 2014. Linear algebraic representation for topological structures. Computer-aided Design 46 (Jan.2014), 269–274. DOI:
[21]
Herbert Edelsbrunner. 1999. Simplicial Complexes. Technical Report. https://people.eecs.berkeley.edu/jrs/meshpapers/edels/L-06.pdf
[22]
Herbert Edelsbrunner and John Harer. 2008. Computational Topology: An Introduction.
[23]
Sharif Elcott and Peter Schröder. 2005. Building your own DEC at home. In ACM SIGGRAPH 2005 Courses (SIGGRAPH’05). Association for Computing Machinery, New York, NY, USA, American Mathematical Society, 8–es. DOI:
[24]
Andreas Fabri and Sylvain Pion. 2009. CGAL: The computational geometry algorithms library. In Proceedings of the 17th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems. 538–539.
[25]
Shachar Fleishman, Iddo Drori, and Daniel Cohen-Or. 2003. Bilateral mesh denoising. In ACM SIGGRAPH 2003 Papers. 950–953.
[26]
Greg Friedman. 2012. Survey article: An elementary illustrated introduction to simplicial sets. The Rocky Mountain Journal of Mathematics 42 (2012), 353–423.
[27]
Xiao-Ming Fu, Yang Liu, and Baining Guo. 2015. Computing locally injective mappings by advanced MIPS. ACM Transactions on Graphics (TOG) 34, 4 (2015), 1–12.
[28]
Brian Guenter. 2007. Efficient symbolic differentiation for graphics applications. In ACM SIGGRAPH 2007 Papers (SIGGRAPH’07). Association for Computing Machinery, New York, NY, USA, 108–es. DOI:
[29]
Leonidas Guibas and Jorge Stolfi. 1985. Primitives for the manipulation of general subdivisions and the computation of Voronoi. ACM Transactions on Graphics (TOG) 4, 2 (1985), 74–123.
[30]
Marc Habermann, Lingjie Liu, Weipeng Xu, Michael Zollhoefer, Gerard Pons-Moll, and Christian Theobalt. 2021. Real-time deep dynamic characters. ACM Transactions on Graphics (ToG) 40, 4 (2021), 1–16.
[31]
Allen Hatcher. 2002. Algebraic Topology. Cambridge University Press.
[32]
Alec Jacobson, Ladislav Kavan, and Olga Sorkine-Hornung. 2013. Robust inside-outside segmentation using generalized winding numbers. ACM Transactions on Graphics (TOG) 32, 4 (2013), 1–12.
[33]
Alec Jacobson, Daniele Panozzo, et al. 2018. libigl: A Simple C++ Geometry Processing Library. https://libigl.github.io/
[34]
Doug L. James. 2020. Phong deformation: A better C 0 interpolant for embedded deformation. ACM Transactions on Graphics (TOG) 39, 4 (2020), 56–1.
[35]
Tomasz Kaczynski, Konstantin Michael Mischaikow, and Marian Mrozek. 2004. Computational Homology. Vol. 157 in Applied Mathematical Sciences. Springer, New York, NY, USA.
[36]
Lutz Kettner. 1998. Designing a data structure for polyhedral surfaces. In Proceedings of the 14th Annual Symposium on Computational Geometry. 146–154.
[37]
Fredrik Kjolstad, Shoaib Kamil, Jonathan Ragan-Kelley, David I. W. Levin, Shinjiro Sueda, Desai Chen, Etienne Vouga, Danny M. Kaufman, Gurtej Kanwar, Wojciech Matusik, et al. 2016. Simit: A language for physical simulation. ACM Transactions on Graphics (TOG) 35, 2 (2016), 1–21.
[38]
Michael Lange, Navjot Kukreja, Mathias Louboutin, Fabio Luporini, Felippe Vieira, Vincenzo Pandolfo, Paulius Velesko, Paulius Kazakas, and Gerard Gorman. 2016. Devito: Towards a generic Finite Difference DSL using symbolic Python. In 2016 6th Workshop on Python for High-performance and Scientific Computing (PyHPC’16). IEEE, 67–75.
[39]
Soeren Laue. 2022. On the Equivalence of Automatic and Symbolic Differentiation. http://arxiv.org/abs/1904.02990arXiv:1904.02990 [cs].
[40]
Allan Leal. 2023. The Autodiff Library. https://autodiff.github.io
[41]
Christian Lengauer, Sven Apel, Matthias Bolten, Shigeru Chiba, Ulrich Rüde, Jürgen Teich, Armin Größlinger, Frank Hannig, Harald Köstler, Lisa Claus, et al. 2020. Exastencils: Advanced multigrid solver generation. In Software for Exascale Computing (SPPEXA’16-’19). Springer International Publishing, 405–452.
[42]
Yong Li, Shoaib Kamil, Alec Jacobson, and Yotam Gingold. 2021. I heart LA: Compilable markdown for linear algebra. ACM Transactions on Graphics (TOG) 40, 6 (Dec. 2021), 264:1–264:14.
[43]
Yong Li, Shoaib Kamil, Alec Jacobson, and Yotam Gingold. 2022. HeartDown: Document processor for executable linear algebra papers. In ACM SIGGRAPH Asia (Conference Papers). DOI:
[44]
Pascal Lienhardt. 1994. N-dimensional generalized combinatorial maps and cellular quasi-manifolds. International Journal of Computational Geometry & Applications 4, 3 (1994), 275–324.
[45]
Ahmed H. Mahmoud, Serban D. Porumbescu, and John D. Owens. 2021. RXMesh: A GPU mesh data structure. ACM Transactions on Graphics (TOG) 40, 4 (2021), 1–16.
[46]
Martti Mäntylä. 1989. Advanced topics in solid modeling. In Advances in Computer Graphics V. Springer, 49–74.
[47]
Nelson Max. 1999. Weights for computing vertex normals from facet normals. Journal of Graphics Tools 4, 2 (1999), 1–6.
[48]
Robert Ryan McCune, Tim Weninger, and Greg Madey. 2015. Thinking like a vertex: A survey of vertex-centric frameworks for large-scale distributed graph processing. ACM Computing Surveys (CSUR) 48, 2 (2015), 1–39.
[49]
Aaron Meurer, Christopher P. Smith, Mateusz Paprocki, Ondřej Čertík, Sergey B. Kirpichev, Matthew Rocklin, AMiT Kumar, Sergiu Ivanov, Jason K Moore, Sartaj Singh, et al. 2017. SymPy: Symbolic computing in Python. PeerJ Computer Science 3 (2017), e103.
[50]
Mark Meyer, Mathieu Desbrun, Peter Schröder, and Alan H. Barr. 2003. Discrete differential-geometry operators for triangulated 2-manifolds. In Visualization and Mathematics III. Springer, 35–57.
[51]
Niloy J. Mitra and An Nguyen. 2003. Estimating surface normals in noisy point cloud data. In Proceedings of the 19th Annual Symposium on Computational Geometry. 322–328.
[52]
J. S. Mueller-Roemer, C. Altenhofen, and A. Stork. 2017. Ternary sparse matrix representation for volumetric mesh subdivision and processing on GPUs. Computer Graphics Forum 36, 5 (Aug.2017), 59–69. DOI:
[53]
D. E. Muller and F. P. Preparata. 1978. Finding the intersection of two convex polyhedra. Theoretical Computer Science 7, 2 (Jan.1978), 217–236. DOI:
[54]
Michael Rabinovich, Roi Poranne, Daniele Panozzo, and Olga Sorkine-Hornung. 2017. Scalable locally injective mappings. ACM Transactions on Graphics 36, 2 (April2017), 16:1–16:16. DOI:
[55]
Jonathan Ragan-Kelley, Connelly Barnes, Andrew Adams, Sylvain Paris, Frédo Durand, and Saman Amarasinghe. 2013. Halide: A language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines. ACM SIGPLAN Notices 48, 6 (2013), 519–530.
[56]
Florian Rathgeber, David A. Ham, Lawrence Mitchell, Michael Lange, Fabio Luporini, Andrew T. T. McRae, Gheorghe-Teodor Bercea, Graham R. Markall, and Paul H. J. Kelly. 2016. Firedrake: Automating the finite element method by composing abstractions. ACM Transactions on Mathematical Software (TOMS) 43, 3 (2016), 1–27.
[57]
Florian Rathgeber, Graham R. Markall, Lawrence Mitchell, Nicolas Loriant, David A. Ham, Carlo Bertolli, and Paul H. J. Kelly. 2012. PyOP2: A high-level framework for performance-portable simulations on unstructured meshes. In 2012 SC Companion: High Performance Computing, Networking Storage and Analysis. IEEE, 1116–1123.
[58]
Patrick Schmidt, Janis Born, David Bommes, Marcel Campen, and Leif Kobbelt. 2022. TinyAD: Automatic differentiation in geometry processing made simple. In Computer Graphics Forum, Vol. 41. Wiley Online Library, 113–124.
[59]
John Schreiner, Arul Asirvatham, Emil Praun, and Hugues Hoppe. 2004. Inter-surface mapping. ACM Transactions on Graphics 23, 3 (Aug.2004), 870–877. DOI:
[60]
Daniel Shapero. 2023. An ergonomic approach to topological transformations of unstructured meshes. In International Meshing Roundtable (Research Note).
[61]
Nicholas Sharp and Keenan Crane. 2020. A Laplacian for nonmanifold triangle meshes. Computer Graphics Forum (SGP) 39, 5 (2020), 69–80.
[62]
Nicholas Sharp, Keenan Crane, et al. 2019a. geometry-central. www.geometry-central.net.
[63]
Nicholas Sharp, Mark Gillespie, and Keenan Crane. 2021. Geometry processing with intrinsic triangulations. ACM SIGGRAPH 2021 Courses (SIGGRAPH’21).
[64]
Nicholas Sharp, Yousuf Soliman, and Keenan Crane. 2019b. Navigating intrinsic triangulations. ACM Transactions on Graphics (TOG) 38, 4 (2019), 1–16.
[65]
Daniel Sieger and Mario Botsch. 2019. The Polygon Mesh Processing Library. http://www.pmp-library.org
[66]
Jason Smith and Scott Schaefer. 2015. Bijective parameterization with free boundaries. ACM Transactions on Graphics (TOG) 34, 4 (2015), 1–9.
[67]
Steven L. Song, Weiqi Shi, and Michael Reed. 2020. Accurate face rig approximation with deep differential subspace reconstruction. ACM Transactions on Graphics (TOG) 39, 4 (2020), 34–1.
[68]
Oded Stein, Alec Jacobson, Max Wardetzky, and Eitan Grinspun. 2020. A smoothness energy without boundary distortion for curved surfaces. ACM Transactions on Graphics (TOG) 39, 3 (2020), 1–17.
[69]
Joseph Teran, Eftychios Sifakis, Geoffrey Irving, and Ronald Fedkiw. 2005. Robust quasistatic finite elements and flesh simulation. In Proceedings of the 2005 ACM SIGGRAPH/Eurographics Symposium on Computer Animation (SCA’05). Association for Computing Machinery, New York, NY, USA, 181–190. DOI:
[70]
Fangzhi Xu, Qika Lin, Jiawei Han, Tianzhe Zhao, Jun Liu, and Erik Cambria. 2023. Are large language models really good logical reasoners? A comprehensive evaluation from deductive, inductive and abductive views. arXiv preprint arXiv:2306.09841 (2023).
[71]
Katherine Ye, Wode Ni, Max Krieger, Dor Ma’ayan, Jenna Wise, Jonathan Aldrich, Joshua Sunshine, and Keenan Crane. 2020. Penrose: From mathematical notation to beautiful diagrams. ACM Transactions on Graphics (TOG) 39, 4 (2020), 144:1–144:16.
[72]
Chang Yu, Yi Xu, Ye Kuang, Yuanming Hu, and Tiantian Liu. 2022. MeshTaichi: A compiler for efficient mesh-based operations. ACM Transactions on Graphics (TOG) 41, 6 (2022), 1–17.
[73]
Rhaleb Zayer, Markus Steinberger, and Hans-Peter Seidel. 2017. A GPU-adapted structure for unstructured grids. Computer Graphics Forum 36, 2 (May2017), 495–507. DOI:
[74]
Paul Zhang, Josh Vekhter, Edward Chien, David Bommes, Etienne Vouga, and Justin Solomon. 2020. Octahedral frames for feature-aligned cross fields. ACM Transactions on Graphics (TOG) 39, 3 (2020), 1–13.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Graphics
ACM Transactions on Graphics  Volume 43, Issue 5
October 2024
207 pages
EISSN:1557-7368
DOI:10.1145/3613708
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 25 June 2024
Online AM: 01 May 2024
Accepted: 24 March 2024
Revised: 29 February 2024
Received: 30 October 2023
Published in TOG Volume 43, Issue 5

Check for updates

Author Tags

  1. Meshes
  2. geometry processing
  3. domain-specific language

Qualifiers

  • Research-article

Funding Sources

  • Sloan Foundation and the Canada Research Chairs Program
  • NSF
  • Meta Reality Labs
  • Adobe Inc

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 1,438
    Total Downloads
  • Downloads (Last 12 months)1,438
  • Downloads (Last 6 weeks)59
Reflects downloads up to 16 Feb 2025

Other Metrics

Citations

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Full Text

View this article in Full Text.

Full Text

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media