Theoretical and Empirical Analysis of a Fast Algorithm for Extracting Polygons from Signed Distance Bounds
Abstract
:1. Introduction
- We describe a fast algorithm for polygonizing SDBs based on sphere tracing (ray marching).
- We theoretically show that this algorithm is asymptotically faster than the obvious approaches (e.g., marching cubes [10] over the whole grid).
- We empirically confirm this in practice for signed distance bounds encoded with deep neural networks.
2. Basic Definitions and Related Work
3. Method
Algorithm 1 Pseudocode for the gridhopping method |
// inputs : |
// ∗ ‘eval_sdb’ is the signed distance bound represeting a shape |
// ∗ ‘N’ is the grid resolution |
function apply_grid_hopping (eval_sdb, N) |
{ |
for (int i = 0; i < N; ++i) |
for (int j = 0; j < N; ++j) |
{ |
int k = 0; |
while (true) |
{ |
// set the origin of the ray |
float x = −1.0/2.0 + 1.0/(2.0∗N) + i/N; |
float x = −1.0/2.0 + 1.0/(2.0∗N) + j/N; |
float x = −1.0/2.0 + 1.0/(2.0∗N) + k/N; |
// use ray marching to determine how much to move along the ray |
float t = trace_ray ( |
[x, y, z], // origin of the ray |
[0.0, 0.0, 1.0], // direction of the ray |
eval_sdb, // signed distance bound |
1.05∗(1.0/2.0 − z), // max distance to travel |
Math . sqrt (6.0)/(2.0∗N) // distance to surface we require |
); |
// set the new value of z and its associated cell, (i, j, k) |
z = z + t; |
k = Math . floor (N∗(z + 1.0/2.0 − 1.0/(2.0∗N))); |
// are we outside the polygonization volume? |
if (k > N − 1 || z > 1.05/2.0) |
break; |
// polygonize cell (i, j, k) |
… // <- polygonizaiton code goes here, e.g., Marching cubes |
// move further along the z direction |
++k; |
} |
} |
} |
- ;
- On the ray between and , only for ;
- The iteration will never “overshoot” because is a signed distance bound.
4. Theoretical Analysis of Computational Complexity
- Provide a proof for polygonizing planes;
- Provide a proof for polygonizing axis-aligned boxes;
- Argue that any nonfractal shape can be approximated as a union of boxes.
4.1. Polygonizing Planes
4.2. Polygonizing Rectangular Boxes
4.3. Polygonizing Other Shapes
5. Experimental Analysis
5.1. Primitives and Simple Shapes
5.2. Experiments on Learned SDBs
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Hart, J.C. Sphere Tracing: A Geometric Method for the Antialiased Ray Tracing of Implicit Surfaces. Vis. Comput. 1994, 12, 527–545. [Google Scholar] [CrossRef]
- Hart, J.C.; Sandin, D.J.; Kauffman, L.H. Ray Tracing Deterministic 3-D Fractals. In ACM SIGGRAPH Computer Graphics; Association for Computing Machinery: New York, NY, USA, 1989. [Google Scholar]
- Davies, T.; Nowrouzezahrai, D.; Jacobson, A. Overfit Neural Networks as a Compact Shape Representation. arXiv 2020, arXiv:2009.09808. [Google Scholar]
- Chen, Z.; Zhang, H. Learning Implicit Fields for Generative Shape Modeling. In Proceedings of the CVPR, Long Beach, CA, USA, 15–20 June 2019. [Google Scholar]
- Park, J.J.; Florence, P.; Straub, J.; Newcombe, R.; Lovegrove, S. DeepSDF: Learning Continuous Signed Distance Functionsfor Shape Representation. In Proceedings of the CVPR, Long Beach, CA, USA, 15–20 June 2019. [Google Scholar]
- Li, L.; Sung, M.; Dubrovina, A.; Yi, L.; Guibas, L. Supervised Fitting of Geometric Primitives to 3D Point Clouds. In Proceedings of the CVPR, Long Beach, CA, USA, 15–20 June 2019. [Google Scholar]
- Duggal, S.; Wang, Z.; Ma, W.C.; Manivasagam, S.; Liang, J.; Wang, S.; Urtasun, R. Secrets of 3D Implicit Object Shape Reconstruction in the Wild. arXiv 2021, arXiv:2101.06860. [Google Scholar]
- Hao, Z.; Averbuch-Elor, H.; Snavely, N.; Belongie, S. DualSDF: Semantic Shape Manipulation using a Two-Level Representation. In Proceedings of the CVPR, Long Beach, CA, USA, 15–20 June 2020. [Google Scholar]
- Wu, Y.; Man, J.; Xie, Z. A double layer method for constructing signed distance fields from triangle meshes. Graph. Model. 2014, 76, 214–223. [Google Scholar] [CrossRef]
- Lorensen, W.E.; Cline, H.E. Marching cubes: A high resolution 3D surface construction algorithm. In ACM SIGGRAPH Computer Graphics; Association for Computing Machinery: New York, NY, USA, 1987. [Google Scholar]
- Bloomenthal, J. (Ed.) Introduction to Implicit Surfaces; Morgan-Kaufmann: Burlington, MA, USA, 1997. [Google Scholar]
- Olah, C. Manipulation of Implicit Functions with an Eye on CAD, 2011. Available online: https://christopherolah.wordpress.com/2011/11/06/manipulation-of-implicit-functions-with-an-eye-on-cad/ (accessed on 26 February 2024).
- Olah, C. ImplicitCAD, 2011. Available online: https://github.com/Haskell-Things/ImplicitCAD (accessed on 26 February 2024).
- Wilhelms, J.; Gelder, A.V. Octrees for faster isosurface generation. Trans. Graph. 1992, 11, 201–227. [Google Scholar] [CrossRef]
- Cigoni, P.; Marino, P.; Montani, C.; Puppo, E.; Scopigno, R. Speeding Up Isosurface Extraction Using Interval Trees. IEEE Trans. Vis. Comput. Graph. 1997, 3, 158–170. [Google Scholar] [CrossRef]
- Livnat, Y.; Shen, H.W.; Johnson, C.R. A Near Optimal Isosurface Extraction Algorithm Using the Span Space. IEEE Trans. Vis. Comput. Graph. 1996, 2, 73–84. [Google Scholar] [CrossRef]
- Gao, J.; Shen, T.; Wang, Z.; Chen, W.; Yin, K.; Li, D.; Litany, O.; Gojcic, Z.; Fidler, S. GET3D: A Generative Model of High Quality 3D Textured Shapes Learned from Images. In Proceedings of the Advances in Neural Information Processing Systems, New Orleans, LA, USA, 28 November–9 December 2022. [Google Scholar]
- Alliegro, A.; Siddiqui, Y.; Tommasi, T.; Nießner, M. PolyDiff: Generating 3D Polygonal Meshes with Diffusion Models. arXiv 2023, arXiv:2312.11417. [Google Scholar]
- Sohl-Dickstein, J.; Weiss, E.; Maheswaranathan, N.; Ganguli, S. Deep Unsupervised Learning using Nonequilibrium Thermodynamics. In Proceedings of the ICML, Lille, France, 6–11 July 2015. [Google Scholar]
- Ho, J.; Jain, A.; Abbeel, P. Denoising Diffusion Probabilistic Models. arXiv 2020, arXiv:2006.11239. [Google Scholar]
- Siddiqui, Y.; Alliegro, A.; Artemov, A.; Tommasi, T.; Sirigatti, D.; Rosov, V.; Dai, A.; Nießner, M. MeshGPT: Generating Triangle Meshes with Decoder-Only Transformers. arXiv 2023, arXiv:2311.15475. [Google Scholar]
- Weisstein, E.W. Point-Plane Distance. From MathWorld—A Wolfram Web Resource. Available online: https://mathworld.wolfram.com/Point-PlaneDistance.html (accessed on 26 February 2024).
- Weisstein, E.W. Harmonic Series. From MathWorld—A Wolfram Web Resource. Available online: https://mathworld.wolfram.com/HarmonicSeries.html (accessed on 26 February 2024).
- Yao, S.; Yang, F.; Cheng, Y.; Mozerov, M.G. 3D Shapes Local Geometry Codes Learning with SDF. In Proceedings of the ICCV Workshops, Montreal, BC, Canada, 11–17 October 2021. [Google Scholar]
- Yifan, W.; Rahmann, L.; Sorkine-Hornung, O. Geometry-Consistent Neural Shape Representation with Implicit Displacement Fields. arXiv 2021, arXiv:2106.05187. [Google Scholar]
- Mu, J.; Qiu, W.; Kortylewski, A.; Yuille, A.; Vasconcelos, N.; Wang, X. A-SDF: Learning Disentangled Signed Distance Functions for Articulated Shape Representation. arXiv 2021, arXiv:2104.07645. [Google Scholar]
- Takikawa, T.; Litalien, J.; Yin, K.; Kreis, K.; Loop, C.; Nowrouzezahrai, D.; Jacobson, A.; McGuire, M.; Fidler, S. Neural Geometric Level of Detail: Real-time Rendering with Implicit 3D Shapes. In Proceedings of the CVPR, Nashville, TN, USA, 20–25 June 2021. [Google Scholar]
- Zhou, Q.; Jacobson, A. Thingi10K: A Dataset of 10,000 3D-Printing Models. arXiv 2016, arXiv:1605.04797. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Markuš, N.; Sužnjević, M. Theoretical and Empirical Analysis of a Fast Algorithm for Extracting Polygons from Signed Distance Bounds. Algorithms 2024, 17, 137. https://doi.org/10.3390/a17040137
Markuš N, Sužnjević M. Theoretical and Empirical Analysis of a Fast Algorithm for Extracting Polygons from Signed Distance Bounds. Algorithms. 2024; 17(4):137. https://doi.org/10.3390/a17040137
Chicago/Turabian StyleMarkuš, Nenad, and Mirko Sužnjević. 2024. "Theoretical and Empirical Analysis of a Fast Algorithm for Extracting Polygons from Signed Distance Bounds" Algorithms 17, no. 4: 137. https://doi.org/10.3390/a17040137
APA StyleMarkuš, N., & Sužnjević, M. (2024). Theoretical and Empirical Analysis of a Fast Algorithm for Extracting Polygons from Signed Distance Bounds. Algorithms, 17(4), 137. https://doi.org/10.3390/a17040137