Skip to main content
Log in

Decomposing the Complement of the Union of Cubes and Boxes in Three Dimensions

  • Published:
Discrete & Computational Geometry Aims and scope Submit manuscript

Abstract

Let \(\mathcal {C}\) be a set of n axis-aligned cubes of arbitrary sizes in \({\mathbb R}^3\) in general position. Let \(\mathcal {U}:=\mathcal {U}(\mathcal {C})\) be their union, and let \(\kappa \) be the number of vertices on \(\partial \mathcal {U}\); \(\kappa \) can vary between O(1) and \(\Theta (n^2)\). We present a partition of \(\mathop {\textrm{cl}}({\mathbb R}^3\setminus \mathcal {U})\) into \(O(\kappa \log ^4 n)\) axis-aligned boxes with pairwise-disjoint interiors that can be computed in \(O(n \log ^2 n + \kappa \log ^6 n)\) time if the faces of \(\partial \mathcal {U}\) are pre-computed. We also show that a partition of size \(O(\sigma \log ^4 n + \kappa \log ^2 n)\), where \(\sigma \) is the number of input cubes that appear on \(\partial \mathcal {U}\), can be computed in \(O(n \log ^2 n + \sigma \log ^8 n + \kappa \log ^6 n)\) time if the faces of \(\partial \mathcal {U}\) are pre-computed. The complexity and runtime bounds improve to \(O(n\log n)\) if all cubes in \(\mathcal {C}\) are congruent and the faces of \(\partial \mathcal {U}\) are pre-computed. Finally, we show that if \(\mathcal {C}\) is a set of arbitrary axis-aligned boxes in \({\mathbb R}^3\), then a partition of \(\mathop {\textrm{cl}}({\mathbb R}^3\setminus \mathcal {U})\) into \(O(n^{3/2}+\kappa )\) boxes can be computed in time \(O((n^{3/2}+\kappa )\log n)\), where \(\kappa \) is, as above, the number of vertices in \(\mathcal {U}(\mathcal {C})\), which now can vary between O(1) and \(\Theta (n^3)\).

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24

Similar content being viewed by others

Notes

  1. Since vertices of \(\Pi _f\) that are not vertices of \(\Pi _\rho \) might lie on \({\varepsilon }\), we should apply Lemma 2.7 to the segment \({\varepsilon }'\) that is the slight translation of \(\mathop {\textrm{int}}({\varepsilon })\) into \(\mathop {\textrm{int}}(\rho )\); the number of edges of \(\Pi _f\) crossed by \({\varepsilon }'\) correspond to the outer vertices on \({\varepsilon }\), which is what we want to bound here.

  2. As similarly remarked earlier, to use the lemma, we choose a mast parallel and very close to \(\delta _p\).

  3. To distinguish from the face of the union \(\mathcal {U}\), we call the boundary face of an input cube a boundary square.

  4. A purple vertex of \(\Pi _S^\nabla \) lying on an edge of \(S\) is a red vertex of \(\Pi _S\) and this red vertex may be charged \(O(\log ^2 n)\) times by a later stage.

  5. The terminology comes from treating the edges as edges of \(\mathcal {K}\); it would be reversed if we were to regard them as edges of \(\mathcal {U}\).

References

  1. Agarwal, P.K., Steiger, A.: An output-sensitive algorithm for computing the union of cubes and fat boxes in 3d. 48th Inter. Colloq. on Auto., Lang., and Prog. 10, 1–20 (2021)

  2. Agarwal, P.K., Grove, E.F., Murali, T.M., Vitter, J.S.: Binary space partitions for fat rectangles. SIAM J. Comput. 29, 1422–1448 (2000)

    Article  MathSciNet  Google Scholar 

  3. Agarwal, P.K., Kaplan, H., Sharir, M.: Union of hypercubes and 3d Minkowski sums with random sizes. Discrete Comput. Geom. 65, 1136–1165 (2021)

    Article  MathSciNet  Google Scholar 

  4. Arya, S., Mount, D.M., Netanyahu, N.S., Silverman, R., Wu, A.Y.: An optimal algorithm for approximate nearest neighbor searching in fixed dimensions. J. ACM 45, 891–923 (1998)

    Article  MathSciNet  Google Scholar 

  5. Bern, M., Eppstein, D.: Mesh generation and optimal triangulation. In: Computing in Euclidean Geometry, pp. 23–90. World Scientific, Singapore (1992)

  6. Boissonnat, J.D., Sharir, M., Tagansky, B., Yvinec, M.: Voronoi diagrams in higher dimensions under certain polyhedral distance functions. Discrete Comput. Geom. 19, 485–519 (1998)

    Article  MathSciNet  Google Scholar 

  7. Chazelle, B.: Convex partitions of polyhedra: a lower bound and worst-case optimal algorithm. SIAM J. Comput. 13, 488–508 (1984)

    Article  MathSciNet  Google Scholar 

  8. Chazelle, B., Palios, L.: Triangulating a nonconvex polytope. Discrete Comput. Geom. 5, 505–526 (1990)

    Article  MathSciNet  Google Scholar 

  9. Chazelle, B., Edelsbrunner, H., Guibas, L.J., Sharir, M.: A singly-exponential stratification scheme for real semi-algebraic varieties and its applications. Theor. Comput. Sci. 84, 77–105 (1991)

    Article  Google Scholar 

  10. Cheng, S.-W., Dey, T.K., Shewchuk, J.: Delaunay Mesh Generation. Chapman & Hall/CRC, New York (2012)

    Google Scholar 

  11. Collins, G.: Quantifier elimination for real closed fields by cylindrical algebraic decomposition. In: Second GI Conference on Automata Theory and Formal Languages 33, pp. 134–183 (1975)

  12. Cormen, T., Leiserson, C., Rivest, R., Stein, C.: Introduction to Algorithms, 4th edn., pp. 331–332. MIT Press, Cambridge (2022)

    Google Scholar 

  13. Dumitrescu, A., Mitchell, J.S.B., Sharir, M.: Binary space partitions for axis-parallel segments, rectangles, and hyperrectangles. Discrete Comput. Geom. 31, 207–227 (2004)

    Article  MathSciNet  Google Scholar 

  14. Edelsbrunner, H., Mücke, E.P.: Simulation of simplicity: a technique to cope with degenerate cases in geometric algorithms. ACM Trans. Graph. 9(9), 66–104 (1990)

    Article  Google Scholar 

  15. Foley, J.D., Dam, A., Feiner, S., Hughes, J.F.: Computer Graphics—Principles and Practice, 2nd edn. Addison-Wesley, Boston (1992)

    Google Scholar 

  16. Frey, P.J., George, P.-L.: Mesh Generation: Application to Finite Elements. Wiley, Hoboken (2007)

    Google Scholar 

  17. Fuchs, H., Kedem, Z., Naylor, B.: On visible surface generation by a priori tree structures. Proc. 7th Annu. Conf. Comp. Graph. Interact. Tech., 124–133 (1980)

  18. Giora, Y., Kaplan, H.: Optimal dynamic vertical ray shooting in rectilinear planar subdivisions. ACM Trans. Algorithm (5) 3(28), 1–28 (2009)

    MathSciNet  Google Scholar 

  19. Laidla, D.H., Trumbore, W.B., Hughes, J.F.: Constructive solid geometry for polyhedral objects. Proc. 13th Annu. Conf. Comp. Graph. Interact. Tech., 161–170 (1986)

  20. LaValle, S.M.: Planning Algorithms. Cambridge University Press, Cambridge (2006)

    Book  Google Scholar 

  21. Overmars, M.H., Yap, C.-K.: New upper bounds in Klee’s measure problem. SIAM J. Comput. 20(6), 1035–1045 (1991)

    Article  MathSciNet  Google Scholar 

  22. Paterson, M.S., Yao, F.F.: Efficient binary space partitions for hidden-surface removal and solid modeling. Discrete Comput. Geom. 5, 485–503 (1990)

    Article  MathSciNet  Google Scholar 

  23. Paterson, M., Yao, F.F.: Optimal binary space partitions for orthogonal objects. J. Algorithms 13, 99–113 (1992)

    Article  MathSciNet  Google Scholar 

  24. Schwartz, J.T., Sharir, M.: On the “piano movers’’ problem ii: general techniques for computing topological properties of real algebraic manifolds. Adv. Appl. Math. 4, 298–351 (1983)

    Article  MathSciNet  Google Scholar 

  25. Sharir, M., Agarwal, P.K.: Davenport-Schinzel Sequences and Their Geometric Applications. Cambridge University Press, Cambridge (1995)

    Google Scholar 

  26. Tóth, C.D.: Binary space partitions for axis-aligned fat rectangles. SIAM J. Comput. 38, 429–447 (2008)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

We thank Boris Aronov and Mark de Berg for helpful discussions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Alex Steiger.

Additional information

Editor in Charge: Csaba D. Tóth

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Dedicated to the memory of Eli Goodman.

Appendix A: Balanced-Box Decomposition (BBD) Trees

Appendix A: Balanced-Box Decomposition (BBD) Trees

In this appendix we prove Lemma 2.1, but we first review additional properties of BBD trees that were not required to describe our algorithms but are needed for the proof here. For the full details of BBD trees and their construction, we refer the reader to [4].

For a box B, let x(B), y(B), z(B) denote its projection on the x-, y-, and z-axis, respectively, and we refer to them as its x-span, y-span, and z-span, respectively.

Consider two nested boxes \(\square ^O\) and \(\square ^I\) such that \(\square ^I\subseteq \square ^O\). For each axis \(q \in \{x,y,z\}\), let \([q_I^-,q_I^+]\) (resp., \([q_O^-,q_O^+]\)) be the q-span of \(\square ^I\) (resp., \(\square ^O\)). Using the terminology from [4], \(\square ^I\) is said to be q-sticky for \(\square ^O\) if each of \(q_I^- - q_O^-\) and \(q_O^+ - q_I^+\) is either 0 or at least \(q_I^+ - q_I^-\), and \(\square ^I\) is said to be sticky for \(\square ^O\) if \(\square ^I\) is q-sticky for all axes \(q \in \{x,y,z\}\).

Let \(P \subseteq \mathbb {R}^3\) be a set of n points, and let \(\mathcal {T}\) be a BBD tree constructed on P. The following additional properties hold for each node u of \(\mathcal {T}\): (i) \(\square ^I_u\) is sticky for \(\square ^O_u\) (if \(\square ^I_u\) exists), and (ii) \(\square ^O_u\) and \(\square ^I_u\) have aspect ratio at most three, i.e., the length of the longest span (edge length) of \(\square ^O_u\) (resp., \(\square ^I_u\)) is at most three times the length of the shortest span of \(\square ^O_u\) (resp., \(\square ^I_u\)).

Using these properties, we establish Lemma 2.1:

Lemma 2.1. Let u be a node of a BBD tree \(\mathcal {T}\) for a point set \(P \subseteq {\mathbb R}^3\). There is a set \(H_u\) of at most 24 planes that induces a subdivision of into O(1) axis-aligned boxes such that any axis-aligned cube C that intersects but none its vertices lie in the interior of contains an edge of each box that it intersects.

Proof

Let C be an axis-aligned cube that intersects the interior of and has all vertices outside . The proof is trivial if \(\square ^O_u \subseteq C\), so assume otherwise. For concreteness, we also assume \(\square ^I_u \ne \varnothing \); the proof for the other case is similar.

For each axis \(q \in \{x,y,z\}\), let \([q_I^-,q_I^+] :=q(\square ^I_u)\) be the q-span of \(\square ^I_u\), let \([q_O^-,q_O^+] :=q(\square ^O_u)\) be the q-span of \(\square ^O_u\), and let \([q_C^-,q_C^+] :=q(C)\) be the q-span of C. Let \(q_I^1 :=(q_I^+-q_I^-)/3\) and \(q_I^2 :=2(q_I^+-q_I^-)/3\) be the points that trisect \(q(\square ^I_u)\), and let \(q_O^1 :=(q_O^+-q_O^-)/3\) and \(q_O^2 :=2(q_O^+-q_O^-)/3\) be the points that trisect \(q(\square ^O_u)\). Set \(T_{I,q} :=\{q_I^-, q_I^1, q_I^2, q_I^+\}\) and \(T_{O,q} :=\{q_O^-, q_O^1, q_O^2,q_O^+\}\).

Let \(H_u\) be the set of planes of the form \(q = t\) for each \(t \in T_{I,q} \cup T_{O,q}\) and \(q \in \{x,y,z\}\). Clearly \(\mathopen | H_u \mathclose | \le 24\). Let \(\Xi _u\) be the set of boxes in the subdivision of induced by \(H_u\), and let \(B \in \Xi _u\) be a box whose interior intersects C. We prove that C contains an edge of B.

First observe that if \(q(C) \not \supseteq q(B)\) for all \(q \in \{x,y,z\}\) then a vertex of C lies inside B, which contradicts the assumption that no vertex of C lies in . Hence, assume that \(x(C) \supseteq x(B)\). To prove that an x-edge of B lies inside C, we will prove that for each \(q \in \{y,z\}\), at least one of the endpoints of the q-span \(q(B) = [q_B^-,q_B^+]\) lies in q(C), as this will imply that both endpoints of an x-edge of B lie inside C. Note that \(q_B^-,q_B^+ \in T_{I,q} \cup T_{O,q}\), by construction.

We claim that for each \(q \in \{y,z\}\), q(C) contains at least one element of \(T_{I,q} \cup T_{O,q}\). Assuming that the claim is true, let \(q_i \in (T_{I,q} \cup T_{O,q}) \cap q(C)\). If \(q_i\) is \(q_B^-\) or \(q_B^+\), we are done so assume that \(q_i \ne q_B^-,q_B^+\). On the other hand, by construction, \(q_i \notin q(B)\), so we conclude that \(q(C) \not \subseteq q(B)\). But \(q(B) \cap q(C) \ne \varnothing \). Hence, at least one of the endpoints of q(B) lies in q(C), as desired. What now remains is to prove the above claim.

The proof of the claim consists of two parts. We first consider the case where no vertex of C lies in \(\square ^I_u\). Then all of the vertices lie outside \(\square ^O_u\). If no span q(C) contains \(q(\square ^O_u)\), a vertex of C lies in \(\mathop {\textrm{int}}(\square ^O_u)\), which is a contradiction. Without loss of generality, assume that \(x(\square ^O_u) \subseteq x(C)\). By property (ii) of \(\mathcal {T}\), we have that \(3\mathopen | x(\square ^O_u) \mathclose | \ge \mathopen | y(\square ^O_u) \mathclose |,\mathopen | z(\square ^O_u) \mathclose |\). Since C is a cube, \(\mathopen | x(C) \mathclose | = \mathopen | y(C) \mathclose | = \mathopen | z(C) \mathclose |\), so \(\mathopen | y(C) \mathclose | \ge \mathopen | y(\square ^O_u) \mathclose |/3\) and \(\mathopen | z(C) \mathclose | \ge \mathopen | z(\square ^O_u) \mathclose |/3\). It follows that at least one point \(y_i \in T_{O,y}\) (resp., \(z_i \in T_{O,z}\)) lies in y(C) (resp., z(C)), thereby proving the claim in this case.

Next, suppose at least one vertex of C lies in \(\square ^I_u\). For each axis \(q \in \{x,y,z\}\), if \(q(C) \subseteq q(\square ^I_u)\) we say q(C) is enclosed, and crossing if \(q(C) \supseteq [q_O^-,q_I^-]\) or \(q(C) \supseteq [q_I^+,q_O^+]\). If all spans of C are enclosed, C is contained in \(\square ^I_u\), a contradiction. Hence, there is a crossing span of C, say, x(C). Without loss of generality, assume each crossing span q(C) contains \([q_O^-,q_I^-]\). In particular, \(\mathopen | x(C) \mathclose | \ge x_I^- - x_O^-\) and x(C) contains \(x_I^- \in T_{I,x}\) and \(x_O^- \in T_{O,x}\). By property (i) of \(\mathcal {T}\), we have \(x_I^- - x_O^- \ge \mathopen | x(\square ^I_u) \mathclose |\), and by property (ii) of \(\mathcal {T}\), we have \(3\mathopen | x(\square ^I_u) \mathclose | \ge \mathopen | y(\square ^I_u) \mathclose |,\mathopen | z(\square ^I_u) \mathclose |\). Since C is a cube, \(\mathopen | x(C) \mathclose | = \mathopen | y(C) \mathclose | = \mathopen | z(C) \mathclose |\), so \(\mathopen | y(C) \mathclose | \ge \mathopen | y(\square ^I_u) \mathclose |/3\) and \(\mathopen | z(C) \mathclose | \ge \mathopen | z(\square ^I_u) \mathclose |/3\). Hence, if y(C) is enclosed, then it contains either \(y_I^1\) or \(y_I^2\); otherwise, y(C) is crossing and contains \(y_O^-\) and \(y_I^-\). In either case, at least one point \(y_i \in T_{I,y} \cup T_{O,y}\) lies in y(C). By a symmetric argument, some point \(z_i \in T_{I,z} \cup T_{O,z}\) lies in z(C). This completes the proof of the claim and of the lemma. \(\square \)

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Agarwal, P.K., Sharir, M. & Steiger, A. Decomposing the Complement of the Union of Cubes and Boxes in Three Dimensions. Discrete Comput Geom (2024). https://doi.org/10.1007/s00454-024-00632-2

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s00454-024-00632-2

Keywords

Mathematics Subject Classification

Navigation