1 Introduction

This paper reveals a number of analytic properties of the visible-volume function (formally defined below). For an adjustable camera system in a room with movable obstacles, this function assigns to each parameter combination the volume that can be supervised by the cameras. A natural goal is to maximize the visible-volume function over all adjustable parameters. This paper restricts attention to the analytic properties of the visible-volume function in an environment modeled by a simplicial complex with an adjustable embedding in some bounded convex room. The analytic properties are of interest, since they are important for the convergence guarantees for various numerical global optimization approaches.

The famous art-gallery problem (AGP) is closely related to the maximization of the visible volume. In the AGP one seeks for the minimal number of cameras with 360\(^{\circ }\) view and their positions so that they together see the complete volume inside a simple two-dimensional polygon with n vertices. The famous simple proof in [10] of an earlier result in [6] shows—via a 3-coloring of a triangulation—that \(\lfloor n/3\rfloor \) cameras suffice. However, the recent result in [1] shows that the AGP is as difficult as to decide whether an outer-description of a semi-algebraic set contains a real point. This implies that the analysis in this paper can probably not be simplified.

Optimizing coverage induced by camera placement has been investigated using various modeling techniques for a very long time, see [14] for a survey and [13] for a more recent thesis. The geometric computation of shadows on a surface (in the sense of day-to-day language) produced in three dimensions by a light at a certain position and some occluding 3D-objects dates back to at least 1977 [7]. That paper was motivated by the correct graphical display of the illumination of architectural designs and similar issues in computer graphics. I mention this since the geometric description of a shadow of a simplex is a core component of this paper. In most applications today, the actual function to be optimized is usually called the relevance function and need not coincide with the visible volume. For example, points can have a weight according to their importance or distance to the camera. Still, common to most approaches is that the dependence of the visible volume on the camera system parameters must be captured in one way or another. This paper focuses on the visible-volume function and suggests a framework for its analysis in arbitrary dimensions.

In many practical instances like the one in [13], the visible-volume function must be considered as a black-box function, i.e., a closed-form formula is not available, the computation of a single function value is costly, and (sub)gradients—if they exist—cannot simply be calculated from formulas. For the global optimization of black-box functions, various methods have been proposed, see [4] for a more recent one. Although it is possible to apply such methods and hope for good results even if a convergence proof is not available, I find it mathematically desirable to know a priori analytic properties of the function to be optimized that guarantee convergence. The criterion in [4] is, e.g., that the function is continuous, smooth on a dense subset of the domain, and locally Lipschitz or semi-algebraic.

In [12], the visible-volume function is analyzed for the case of an environment modeled by non-convex polygons in dimension two. In that paper, the independent variable of the visible-volume function is just the position of the camera, since it is assumed that it has a 360-degree view. The result is that the visible-volume function is continuous as well as smooth and locally Lipschitz in the camera position on a dense subset of the domain. Newer developments also consider environments in dimension three containing obstacles and more camera parameters like field of view and orientation of multiple cameras [13]. The visible-volume function is again continuous and smooth almost everywhere.

The only work I have found for general dimensions uses a different set-up based on the level-set method [15]: Inside a compact domain there are opaque solid obstacles implicitly given via a Lipschitz-continuous level-set function, a function that is negative in the interior and positive on the exterior of the obstacles [5]. A possible level-set function is the signed-distance function that assigns to each point the shortest distance to the boundary of some obstacle; it receives a negative sign if the point is inside the obstacle and a positive sign if it is outside. In that paper, the independent variables of the visible-volume function are again restricted to the positions of one or more cameras, i.e., the cameras possess omni-directional vision. Visibility of one point from another can be decided by checking whether the infimum of the level-set function on the connecting straight line (the visibility function) is positive. The visible-volume function then takes the form of an integral of the Heaviside function of the visibility function over the domain. It is shown that, under certain additional conditions on the visibility function (which the authors call “no fattening [of the visibility level sets]” [5, p. 5]), that the visible-volume function inherits Lipschitz-continuity from the level-set function. One may see a problem in the fact that the additional condition in that paper is a condition on the visibility function, which is not part of the input data.

Why bother at all about higher dimensions or a non-static environment? First, in dimension four the visible volume covered over time can be used to model video surveillance with time being the fourth dimension. Concerning the non-static environment the idea is that natural, usually adjustable camera parameters like field of view or direction can be modeled by obstacles inside the camera system (aperture blades). However, for this paper the true motivation was clearly curiosity: Is the dimension or a static environment relevant at all for some interesting analytic properties of the visible-volume function to hold, or is there a general mathematical principle that guarantees an interesting result in all dimensions by a unified argument? What is the most explicit representation of the visible-volume function? Does it belong to a special class of functions?

How about generalizing the techniques from [12, 13]? In [12] so-called inflection segments are the basic building blocks of the analysis. Inflection segments are used to partition the interior of the non-convex polygon into regions in which the visible-volume function depends smoothly on the camera position. Generalizing their approach to higher dimensions would require to consider inflection hypersurfaces generating possibly non-convex polytopes as regions. This has in principle been carried out in a different language in [13, Tables 2.3–2.5] for dimension three by an extensive classification of so-called vertex-incidence surfaces. Following those lines, the number of cases that would have to be considered in a similar table would be enormous even in dimension four. For general dimension this seems intractable. To replicate the full result in this paper with the level-set method in [5] one would have to construct an explicit parametrized level-set function for movable obstacles that are described explicitly via parametrized embeddings of simplicial complexes. At least for me it is not obvious how to proceed along those lines. Yet, it would be interesting to see the result of this purely analytical approach.

This paper focuses on finite, discrete, explicit descriptions of the environment. It is shown by a unified method in a fairly general setting with obstacles, explicitly defined as parametrized pure simplicial complexes of codimension-one, that the visible-volume function, depending on the positions of the cameras and the environment is indeed continuous, smooth almost everywhere, locally Lipschitz and semi-algebraic in all dimensions. The methodology belongs to the wide field of discrete geometry—a combination of the basic theory of oriented matroids [3, 16], the basic theory of triangulations of point configurations [9], and the basic theory of semi-algebraic sets [2]. The actual result is even more specific: The domain of the visible-volume function can be stratified into open cubical cells so that the visible-volume function is a smooth rational function on each cell with degree at most cubical in the dimension. All structural results follow from this explicit representation, which goes beyond the results in [5]. Even in dimension two and three this is, to the best of my knowledge, the most concrete description of the visible-volume function.

An important remark is in place here: the analytic properties of the visible-volume function in the main result cannot be derived via splitting it into the composition of the “visible-subset function” (with the Hausdorff metric on the set of subsets) and the “volume-of-subsets function”. This is simply because the “visible-subset function” is not even continuous. See Fig. 1 for visual evidence in dimension two. The same figure shows that if one considers an arbitrary positive amount of diffraction, then the visible-volume function itself becomes discontinuous: Indeed, while moving the camera position, in the first moment one can look through the obstacles at all, a cone will be visible with interior angle of at least the diffraction angle. Hence, in order to prove the main result straight-line geometric optics has to be assumed and exploited.

Fig. 1
figure 1

The “visible-subset function” is not even continuous: an arbitrarily small left-movement of \(\textbf{p}\) (which is located on the line from 7 to 9) to \(\textbf{p}'\) makes points visible that are “far away” from the points visible from \(\textbf{p}\); the increase of the visible-volume, however, will be arbitrarily small for a sufficiently small movement; the continuity of the visible volume is lost as soon as there is a constant-degree diffraction at corners

Moreover, this shows that the results in this paper are in sharp contrast to the discontinuous dependence of image features on the view point, as is investigated in Computer Vision (see, e.g., [8]). Thus, the combination of methods in this paper is tailor-made specifically for the straight-line-optics visible-volume function.

2 Preliminaries

This paper uses elementary notions and facts from the theories of semi-algebraic sets, oriented matroids, and triangulations. This section gives a brief overview over these tools in a phrasing adapted to the purposes of this paper. In order to distinguish the known from the novel, the terms “notion” and “fact” are used instead of “definition” and “theorem”.

Semi-algebraic sets (over the reals) arise as solution sets of polynomial equations and inequalities and enjoy a number of convenient closure and decomposition properties.

Notion 2.1

(semi-algebraic sets and functions)    A subset \(S\subseteq {\mathbb {R}}^d\) is a basic semi-algebraic set (over the reals), if there are finitely many polynomials

$$\begin{aligned}(p_i)_{i\in I},(q_j)_{j\in J}:{\mathbb {R}}^d\rightarrow {\mathbb {R}}\end{aligned}$$

with coefficients in \({\mathbb {R}}\) such that

$$\begin{aligned}S\hspace{0.83328pt}=\hspace{0.83328pt}\{x\in {\mathbb {R}}^d:p_i(x)=0\ \forall \,i\in I,\ q_j(x)>0\ \forall \,j\in J \}.\end{aligned}$$

A semi-algebraic set (over \({\mathbb {R}}\)) is a finite union of basic semi-algebraic sets [2, Sect. 2.3]. For semi-algebraic sets \(S\subseteq {\mathbb {R}}^d\) and \(T \subseteq \mathbb R^k\) a function \(f:S\rightarrow T\) is a semi-algebraic function if its graph

$$\begin{aligned}{\text {Graph}}\hspace{0.27771pt}(f):=\{(x,y)\in S\times T:f(x)=y\}\end{aligned}$$

is a semi-algebraic set [2, Sect. 2.5.2]. The class of semi-algebraic functions that are k times continuously differentiable is denoted by \(S^k\) for \(k=0,1,\dots ,\infty \).

Fact 2.2

(basic properties of semi-algebraic sets)    Semi-algebraic sets are closed under finite union, finite intersection, and set complement [2, Sect. 2.3]. Moreover, projections of semi-algebraic are semi-algebraic [2, Sect. 2.4] as well as the closure and the interior [2, Proposition 3.1]. The composition of semi-algebraic functions is semi-algebraic. Moreover, the pointwise addition and multiplication are semi-algebraic [2, Propositions 2.102 and 2.103]. In particular, polynomials and rational functions defined on semi-algebraic sets are semi-algebraic.

The following, specialized version of the stratification theorem for semi-algebraic sets provides the basis for the piecewise description of the visible-volume function.

Fact 2.3

(stratification theorem for semi-algebraic sets and functions)    Every semi-algebraic set can be stratified into finitely many strata such that each stratum is \(S^{\infty }\)-homeomorphic to an open cube, and the boundary of each stratum is a finite union of strata of lower dimensions [2, Theorem 5.38 (rephrased)].

Oriented matroids encode the combinatorics of finite geometric structures like finite point or vector configurations or finite arrangements of affine or linear hyperplanes. An oriented matroid may be defined in various ways all of which can be transformed into one another. In this paper, only realizable oriented matroids are used so that it is enough to define them via the geometric properties of point configurations or arrangements of hyperplanes (see [3] for a more general treatment). In the following, the rank is defined as \(r:=d+1\).

Notion 2.4

(oriented matroid of a hyperplane arrangement)    Let \({{\mathscr {H}}}=({\text {{{\textbf {H}}}}}_{{i}})_{{i}\in I}\) be a finite linear hyperplane arrangement in \({\mathbb {R}}^r\) with at least one basis, i.e., a \(r\)-subset of hyperplanes with linearly independent normals labeled by a label set \(I\) (multiple hyperplanes are allowed, i.e., distinct labels may label identical hyperplanes). The arrangement is oriented if for each hyperplane \({\text {{{\textbf {H}}}}}\) we have fixed the open positive halfspace \({\text {{{\textbf {H}}}}}^+\) and the open negative halfspace \({\text {{{\textbf {H}}}}}^-\). We denote by the zero-set \({\text {{{\textbf {H}}}}}^0\) the hyperplane itself. A signature \(\sigma :I\rightarrow \{-,0,+\}\) is a function that assigns to each label a sign from \(\{-,0,+\}\), where “\(+\)” and “−” are interpreted as “\(+1\)” and “\(-1\)”. Each such signature induces a region \({{{\textbf {R}}}}_{\sigma }\) of the arrangement via

$$\begin{aligned}{{{\textbf {R}}}}_{\sigma }:=\bigcap _{{i}\in I}\,{\text {{{\textbf {H}}}}}_{{i}}^{\sigma ({i})},\end{aligned}$$

which may be empty. A covector of \({{\mathscr {H}}}\) is a signature \(\sigma \) whose region \({{{\textbf {R}}}}_{\sigma }\) is non-empty. A covector with an inclusion maximal number of zero-components is called a cocircuit of \({{\mathscr {H}}}\).

Two hyperplane arrangements with label set \(I\) are combinatorially equivalent if they have identical sets of covectors (or equivalently, identical sets of cocircuits). The combinatorial equivalence class of \({{\mathscr {H}}}\) is called the oriented matroid of \({{\mathscr {H}}}\). Any choice of a hyperplane at infinity yields an affine oriented matroid where only the covectors are considered that are on the positive side of the hyperplane at infinity. The intersection of all hyperplanes not at infinity with the positive hemisphere defined by the hyperplane at infinity followed by a stereographic projection yields an affine hyperplane arrangement in dimension \(d=r-1\). For a matrix \(W=({{\textbf {a}}}^{\top }_{{i}}\hspace{0.83328pt}|\hspace{0.83328pt}{-}b_{{i}})_{{i}\in I}\in \mathbb R^{I\times r}\) the oriented affine hyperplane arrangement induced by \(H^{\sigma }_i=\{{{\textbf {x}}}\in \mathbb R^{d}:{\text {sign}}\hspace{1.111pt}({{\textbf {a}}}^{\top }_{{i}}{{\textbf {x}}}-b_{{i}})=\sigma \}\) for all \(\sigma \in \{-,0,+\}\) and \({i}\in I\) is denoted by \({{\mathscr {H}}}(W)\). The oriented matroid of it is denoted by \(\text {M}_{{{\mathscr {H}}}}(W)\) [16, Sect. 7.1.3 (rephrased)].

Notion 2.5

(oriented matroid of a point configuration)    Let \({{{\textbf {A}}}}=(\textbf{v}_{{j}})_{{j}\in J}\) be a finite point configuration in \({\mathbb {R}}^{d}\) with at least one basis, i.e., a \(r\)-subset of points forming a \(d\)-dimensional simplex, labeled by a label set \(J\) (multiple points are allowed, i.e., distinct labels can label identical points). Each signature \(\sigma :J\rightarrow \{-,0,+\}\) on \(J\) defines a set of hyperplanes \({{\mathscr {H}}}_{\sigma }\) consisting of all affine hyperplanes \({\text {{{\textbf {H}}}}}\) in \({\mathbb {R}}^d\) with \(\textbf{v}_{{j}}\in {\text {{{\textbf {H}}}}}^{\sigma ({j})}\) for all \({j}\in J\). A covector of \({{{\textbf {A}}}}\) is a signature \(\sigma \) for which \({{\mathscr {H}}}_{\sigma }\) is non-empty. A covector with an inclusion-maximal number of zero components is called a cocircuit of \({{{\textbf {A}}}}\).

Two point configurations with label set \(J\) are combinatorially equivalent if they have identical sets of covectors (or equivalently, identical sets of cocircuits). The combinatorial equivalence class of \({{{\textbf {A}}}}\) is called the oriented matroid of \({{{\textbf {A}}}}\). For a matrix \(V=\genfrac(){0.0pt}1{\textbf{v}_{{j}}}{1}_{{j}\in J}\in \mathbb R^{r\times J}\) the point configuration with points \((\textbf{v}_{{j}})_{{j}\in J}\), is denoted by \({{{\textbf {A}}}}(V)\). The oriented matroid of it is denoted by \(\text {M}_{{{{\textbf {A}}}}}(V)\) [16, Sect. 7.1.2 (rephrased)].

Remark 2.6

In this paper, oriented matroids are identified with their realization spaces in the space of matrices, which is no problem for realizable oriented matroids.

The following is immediate from the definition:

Fact 2.7

(finiteness property of oriented matroids)    For finite label sets \(I\) and \(J\) there exists only a finite number of distinct oriented matroids of hyperplane arrangements and distinct oriented matroids of point configurations labeled by \(I\) and \(J\), respectively.

In the theory of oriented matroids, it does not make a difference whether one considers the oriented matroid of a hyperplane arrangement or the oriented matroid of a point configuration. Moreover, in addition to covectors and cocircuits, there are other structures that specify an oriented matroid. For example, prescribing the set of covectors of a hyperplane arrangement or a point configuration is equivalent to prescribing all determinants of \(r\)-many rows of \(W\) or \(r\)-many columns of \(V\) (the chirotope of the oriented matroid) [16, Sect. 7.2.3]. This imposes polynomial equations and inequalities of degree \(r\) among the entries of the matrices. Therefore, each set of matrices inducing mutually combinatorially equivalent affine hyperplane arrangements or point configurations, respectively, is a semi-algebraic set [16, Sect. 7.3.2].

Fact 2.8

(realization spaces of oriented matroids are semi-algebraic)    Each combinatorial equivalence class in \(\mathbb R^{I\times r}\) of all matrices \(W\) with mutually combinatorially equivalent hyperplane arrangements \({{\mathscr {H}}}(W)\) is a semi-algebraic set. Each combinatorial equivalence class in \(\mathbb R^{r\times J}\) of all matrices \(V\) with mutually combinatorially equivalent point configurations A(V) is a semi-algebraic set.

Triangulations of finite point configurations are dissections of the convex hull of the point configuration into simplices all of whose vertices are contained in the point configuration so that any two simplices intersect properly. More formally:

Notion 2.9

(triangulations of point configurations)    Let \({{{\textbf {A}}}}\) be a finite point configuration in \(\mathbb R^{d}\) of affine dimension \(d\) labeled by a label set \(J\) (multiple points are allowed, i.e., distinct labels may label identical points). For an \(r\)-subset \({S}\) of \(J\) the subconfiguration \({{{\textbf {{S}}}}}\) is the subconfiguration of points in \({{{\textbf {A}}}}\) with labels in \({S}\). If \({{{\textbf {{S}}}}}\) has affine dimension \(d\), it is spanning. In this case, \({S}\) is called an (abstract) \(d\)-simplex, and \({{{\textbf {{S}}}}}\) is called a (geometric) \(d\)-simplex. Two \(d\)-simplices (abstract or geometric) intersect properly in \({{{\textbf {A}}}}\) if the relative interiors of any two geometric faces have empty intersection. A triangulation of \({{{\textbf {A}}}}\) is a family \({{\mathscr {T}}}\) of properly intersecting abstract \(d\)-simplices in \(J\) so that the union of all corresponding geometric simplices equals \({\text {conv}}{{{{\textbf {A}}}}}\) [9, Definition 2.3.1 (rephrased)].

The main connection of triangulations to oriented matroids is the following: whether or not a family of \(r\)-subsets of \(J\) forms a triangulation of \({{{\textbf {A}}}}\) only depends on the oriented matroid of \({{{\textbf {A}}}}\), not on the exact coordinates.

Fact 2.10

(triangulations depend only on oriented matroids)    Combinatorially equivalent point configurations have identical sets of triangulations [9, Corollary 4.1.44 (specialized to triangulations)]. In particular, the set of all point configurations on the same label set having identical sets of triangulations is, as the union of (realization spaces of) oriented matroids of point configurations, a semi-algebraic set.

3 Problem Statement and Main Result

In this section, the main objects of study are introduced, the notation is fixed, and the main problem is formalized.

Fig. 2
figure 2

The room and an intersection-free embedding of an environment in the room

Let \(d\) be the ambient dimension, and let \({{\textbf {P}}}\subset {\mathbb {R}}^{d}\) be a \(d\)-polytope, which is called the room (see Fig. 2, left). Let \(J\) be a set, and let \({{\mathscr {F}}}\) be an abstract simplicial complex on \(J\) of pure codimension one, the abstract environment complex. Moreover, let \(\textbf{e}:J\rightarrow {{\textbf {P}}}\) be an embedding of the vertices of \({{\mathscr {F}}}\) into the room. Given such an embedding \(\textbf{e}\), we call the point configuration \({{{\textbf {A}}}}(\textbf{e}):=\textbf{e}(J)\) the vertices of the geometric environment complex. For a \((k-1)\)-simplex \({F}=\{{j}_1,{j}_2,\dots ,{j}_k\}\in {{\mathscr {F}}}\) in the abstract environment complex we obtain its geometric embedding \({{{\textbf {{F}}}}}(\textbf{e}):={\text {conv}}{\{\textbf{e}({j}_1),\textbf{e}({j}_2),\dots ,\textbf{e}({j}_k)\}}\). The geometric environment complex in the room is then \({{\mathscr {F}}}(\textbf{e}):=\{{{{\textbf {{F}}}}}(\textbf{e}):{F}\in {{\mathscr {F}}}\}\). Its geometric realization \(\left| {{\mathscr {F}}}(\textbf{e}) \right| :=\bigcup _{{F}\in {{\mathscr {F}}}}{{{\textbf {{F}}}}}(\textbf{e})\) is the union of all geometric embeddings of its simplices. We call an embedding \(\textbf{e}\) intersection-free if any two geometric embeddings of open simplices of any dimension have empty intersection (see Fig. 2 right for an example). In particular, for intersection-free embeddings all geometric simplices \({{{\textbf {{F}}}}}(\textbf{e})\) have dimension \({\text {card}}({F})-1\), where \({\text {card}}({F})\) is the cardinality of the abstract simplex \({F}\).

Let \({{\textbf {E}}}\subset ({{\textbf {P}}})^{J}\) be any semi-algebraic subset of all intersection-free embeddings, equipped with the standard subspace topology on \(({\mathbb {R}}^{d})^{J}\).

Remark 3.1

The subset of intersection-free embeddings is a semi-algebraic set: Each intersection point \(\textbf{x}\) of two open geometric simplices \({{{\textbf {{F}}}}}(\textbf{e})\) and \({{{\textbf {{F}}}}}'(\textbf{e})\) has two representations in terms of the strictly positive barycentric coordinates of the simplices. More specifically, the geometric simplices \({{{\textbf {{F}}}}}(\textbf{e})={\text {conv}}{\{\textbf{e}({j}_1),\textbf{e}({j}_2),\dots ,\textbf{e}({j}_k)\}}\) and \({{{\textbf {{F}}}}}'(\textbf{e})={\text {conv}}{\{\textbf{e}({j}'_1),\textbf{e}({j}'_2),\dots ,\textbf{e}({j}'_{\ell })\}}\) have an interior intersection point if and only if the following holds:

$$\begin{aligned}&\exists \;\lambda _1,\lambda _2,\ldots ,\lambda _k,\mu _1,\mu _2,\ldots ,\mu _\ell \in {\mathbb {R}}:\\&\lambda _1,\lambda _2,\ldots ,\lambda _k,\mu _1,\mu _2,\ldots ,\mu _\ell >0,\\&\lambda _1,\lambda _2,\ldots ,\lambda _k,\mu _1,\mu _2,\ldots ,\mu _\ell <1,\\&\lambda _1+\lambda _2+\cdots +\lambda _k=1,\\&\mu _1+\mu _2+\cdots +\mu _\ell =1,\\&\lambda _1\textbf{e}({j}_1)+\lambda _2\textbf{e}(j_2)+\cdots +\lambda _k\textbf{e}({j}_k)=\mu _1\textbf{e}({j}'_1)+\mu _2\textbf{e}(j_2')+\cdots +\mu _\ell \textbf{e}({j}'_\ell ). \end{aligned}$$

The set of all \(\textbf{e}\) for which this condition is true for a given pair of geometric simplices is consequently the projection of a semi-algebraic set, which is a semi-algebraic set. Moreover, the set of all not intersection-free \(\textbf{e}\) is the union of the semi-algebraic sets over all pairs of simplices, thus a semi-algebraic set. The set of all intersection-free embeddings \(\textbf{e}\) is, as the complement of this semi-algebraic set, again a semi-algebraic set. Note that all further considerations do not depend on the fact that we only consider intersection-free embeddings.

Remark 3.2

We do not model the usual camera parameters “field of view” or “orientation” separately because they can be simulated by movable “aperture blades” in the geometric environment complex.

Fig. 3
figure 3

A camera configuration formed by position and aperture blades in the room

Definition 3.3

(feasible camera configuration)    The set

$$\begin{aligned}{{\textbf {D}}}:=\{(\textbf{p},\textbf{e})\in {\mathbb {R}}^{d}\times ({\mathbb {R}}^{d})^{J}:\textbf{e}\in {{\textbf {E}}},\,\textbf{p}\in {{\textbf {P}}}\setminus \left| {{\mathscr {F}}}(\textbf{e}) \right| \}\end{aligned}$$

is the set of feasible camera configurations.

Remark 3.4

By Fact 2.2, \({{\textbf {D}}}\) is a semi-algebraic set.

The affine hull of a geometric simplex \({{{\textbf {{S}}}}}\) is the smallest affine subspace containing \({{{\textbf {{S}}}}}\). For a geometric facet \({{{\textbf {{F}}}}}\in {{\mathscr {F}}}(\textbf{e})\) and a point \(\textbf{x}\in {{\textbf {{{\textbf {P}}}}}}\setminus {\text {aff}}{{{\textbf {{F}}}}}(\textbf{e})\), the polyhedron \({\text {cone}}_{{{{\textbf {{F}}}}}}(\textbf{x})\) is defined as the cone and \({\text {pyram}}_{{{{\textbf {{F}}}}}}(\textbf{x})\) is defined as the pyramid over \({{{\textbf {{F}}}}}\) with apex \(\textbf{x}\). For a subset \({{\textbf {X}}}\subset {{\textbf {P}}}\), the notation \(\overline{{{\textbf {X}}}}\) is used for the topological closure and \({{\textbf {X}}}^{\circ }\) for the topological interior.

Definition 3.5

(shadow)    For \((\textbf{p},\textbf{e})\in {{\textbf {D}}}\) and \({F}\in {{\mathscr {F}}}\) let

$$\begin{aligned}{{\textbf {S}}}_{{F}}(\textbf{p},\textbf{e}):={\left\{ \begin{array}{ll} \overline{{\text {cone}}_{{{{\textbf {{F}}}}}(\textbf{e})}(\textbf{p})\setminus {\text {pyram}}_{{{{\textbf {{F}}}}}(\textbf{e})}(\textbf{p})}&{}\hbox { if}\ \textbf{p}\in {{\textbf {P}}}\setminus {\text {aff}}{{{{\textbf {{F}}}}}(\textbf{e})},\\ \emptyset &{}\text { otherwise}, \end{array}\right. }\end{aligned}$$

be the shadow of \({F}\) with respect to the feasible camera configuration \((\textbf{p},\textbf{e})\). The total shadow of the environment with respect to the feasible camera configuration \((\textbf{p},\textbf{e})\in {{\textbf {D}}}\) is defined as

$$\begin{aligned}{{\textbf {S}}}(\textbf{p}, \textbf{e}):=\bigcup _{{F}\in {{\mathscr {F}}}}{{\textbf {S}}}_{{F}}(\textbf{p},\textbf{e}).\end{aligned}$$

The intersection of the face or total shadow with the room is called the cut-off (face or total) shadow.

Figures   4 and 5 illustrate the cut-off shadows. Parts of the room may be in the shadow of more than one face. The face shadow is a polyhedron, and its supporting hyperplanes are spanned by the face and the facets of the face together with the camera position. Note that if there is diffraction, then even in dimension two the invisible points are not anymore just the union of all face-shadows: adjacent segments in the environment would formally have a cone behind their intersection point that is not in the union of their shadows. However, that cone is clearly invisible in reality. Thus, even for arbitrarily small positive diffraction (for which the main theorem is false) the construction of this paper fails at this point.

Fig. 4
figure 4

Two cut-off face shadows: one for a face of the aperture blades and one for a face of the environment; some points in the room are in both shadows (darker)

Fig. 5
figure 5

The cut-off total shadows induced by two different camera configurations

Definition 3.6

(visible volume)    The visible-volume function in room \({{\textbf {P}}}\) on the set of feasible camera configurations \({{\textbf {D}}}\) is defined as the function

$$\begin{aligned}{V}(\,{\cdot }\,,\,{\cdot }\,):{\left\{ \begin{array}{ll} {{\textbf {D}}}\rightarrow {\mathbb {R}}_{\ge 0},\\ (\textbf{p},\textbf{e})\mapsto {\text {vol}}_{d}({{\textbf {P}}}\setminus {{\textbf {S}}}(\textbf{p}, \textbf{e}))={\text {vol}}_{d}({{\textbf {P}}})-{\text {vol}}_{d}({{\textbf {S}}}(\textbf{p}, \textbf{e})\cap {{\textbf {P}}}). \end{array}\right. }\end{aligned}$$

The goal is to find analytic properties of the visible-volume function. In particular, for randomized local-search maximization methods it is of interest whether or not the visible-volume function is continuous and \(C^{\infty }\) almost everywhere.

Theorem 3.7

(main theorem)    The visible-volume function \({V}(\,{\cdot }\,,\,{\cdot }\,):{{\textbf {D}}}\rightarrow {\mathbb {R}}_{\ge 0}\) is continuous. Moreover, there is a stratification of \({{\textbf {D}}}\) into strata \(S^{\infty }\)-diffeomorphic to open cubes with the following property: Restricted to the closure of each stratum the visible-volume function \({V}(\,{\cdot }\,,\,{\cdot }\,)\) is a rational function of degree at most \(d^3\).

Since the graph of \({V}(\,{\cdot }\,,\,{\cdot }\,):{{\textbf {D}}}\rightarrow {\mathbb {R}}_{\ge 0}\) is the union of the graphs of \({V}(\,{\cdot }\,,\,{\cdot }\,)\) restricted to the strata and \({V}(\,{\cdot }\,,\,{\cdot }\,)\) is rational on each stratum, \({V}(\,{\cdot }\,,\,{\cdot }\,)\) is semi-algebraic. Additionally, the only possibly non-smooth parts of the feasible domain are the boundaries between different strata. Since \({V}(\,{\cdot }\,,\,{\cdot }\,)\) is bounded and continuous, each rational function extends to the boundary of each stratum, where it is equal to \({V}(\,{\cdot }\,,\,{\cdot }\,)\). Since rational functions are continuously differentiable on their complete domain, the one-sided directional derivatives of \({V}(\,{\cdot }\,,\,{\cdot }\,)\) restricted to the closure of each stratum are bounded for all directions into the stratum. Now, each stratum is in the boundary of only finitely many strata, so that the one-sided directional derivatives are bounded everywhere uniformly for each direction into the feasible domain. This implies that \({V}(\,{\cdot }\,,\,{\cdot }\,)\) is locally Lipschitz. Therefore, we have:

Corollary 3.8

The visible-volume function \({V}(\,{\cdot }\,,\,{\cdot }\,)\) is piecewise smooth, in particular \(C^{\infty }\) almost everywhere. Moreover, it is semi-algebraic and locally Lipschitz.

In the next section, we will prove this theorem in eight steps by an explicit construction that generates a concrete formula for \({V}(\,{\cdot }\,,\,{\cdot }\,)\) via a (fairly fine) triangulation of the room. Note that the whole (convex!) room will be subdivided into convex regions and then triangulated. Thus, it will never be necessary to triangulate non-convex objects (which may fail starting in dimension three [9, Sect. 3.6]).

4 Proof of the Main Theorem

This section is devoted to the proof of the main theorem. Recall that \(r:=d+1\) is the rank of the room \({{\textbf {P}}}\). The proof idea is as follows: The set of feasible camera configurations can be partitioned into finitely many equivalence classes given by combinatorial equivalence of the induced hyperplane arrangement of all “visibility boundaries” and their intersection points (derived from oriented-matroid theory). Inside each of these finitely many equivalence classes the visible subset can be triangulated by the same (combinatorial) triangulation. Thus, in such an equivalence class the visible-volume function varies like the sum of the positive simplex-volumes over all visible simplices in the triangulation, which is essentially a determinant in the coordinates of the vertices of the simplices (derived from triangulation theory). Tracing back the data of these coordinates to the set of feasible camera configurations yields a rational function. Each equivalence class is a semi-algebraic set (derived from oriented-matroid theory and semi-algebraic-set theory) that can be further stratified into cubical cells (derived from semi-algebraic-set theory). Note that the final stratification is necessary, since a complete equivalence class can be complicated, e.g., not connected [16, Sect. 7.3.2]. The formal proof is structured into eight steps.

Step 1 The first part shows that the visible-volume function is continuous, which follows immediately from the definition via the face shadows.

Lemma 4.1

The visible-volume function is continuous.

Recall Fig. 1 shows that the visible-subset function is not continuous, so that this result specifically holds for the volume, not for the visible subset of the room.

Proof of Lemma 4.1

It is enough to show that the cut-off total shadow is continuous. Each face shadow intersected with the room, the cut-off face-shadow, is a polytope whose outer description is continuous in the camera configuration. Thus, its volume function is bounded and continuous. By the inclusion–exclusion formula for the volume measure, the volume of the total shadow equals the sum of all cut-off face-shadow volumes minus the sum of all volumes of intersections of two cut-off face shadows plus the sum of all volumes of intersections of three cut-off face shadows ... plus/minus the volume of the intersection of all cut-off face shadows. All appearing intersections are intersections of polytopes. Thus, all volumes in the inclusion–exclusion formula are continuous. Thus, the visible-volume function as a finite sum of continuous functions is continuous. \(\square \)

Step 2 For any feasible camera configuration \((\textbf{p},\textbf{e})\in {{\textbf {D}}}\) and a \((d-1)\)-face \({F}\) of the environment complex \({{\mathscr {F}}}\), consider the affine hyperplane \({\text {{{\textbf {H}}}}}({{{\textbf {{F}}}}}(\textbf{e}))\) spanned by the corresponding geometric face \({{{\textbf {{F}}}}}(\textbf{e})\). It is called the transversal visibility plane of \({F}\) with respect to \((\textbf{p},\textbf{e})\). Moreover, for any feasible camera configuration \((\textbf{p},\textbf{e})\in {{\textbf {D}}}\) and a \((d-2)\)-face \({F}'\) of the environment complex \({{\mathscr {F}}}\) with \(\textbf{p}\notin {\text {aff}}{{{{\textbf {{F}}}}}'(\textbf{e})}\) (only these bound a \((d-1)\)-face producing a shadow), consider the affine hyperplane \({\text {{{\textbf {H}}}}}({{{\textbf {{F}}}}}'(\textbf{e}),\textbf{p})\) spanned by the corresponding geometric face \({{{\textbf {{F}}}}}'(\textbf{e})\) and the camera position \(\textbf{p}\). It is called the longitudinal visibility plane of \({F}'\) with respect to \((\textbf{p},\textbf{e})\). Since the environment complex has pure dimension \({d-1}\), all \((d-2)\)-faces of the environment complex bound some \((d-1)\)-face of the environment complex.

Now let \({{\mathscr {H}}}(\textbf{p}, \textbf{e})\) be the affine hyperplane arrangement of all transversal and longitudinal visibility planes together with all facet-supporting hyperplanes of the room. They form the “visibility boundaries” mentioned in the proof idea. We consider this arrangement labeled by a label set \(I\). This way, hyperplanes spanned by distinct simplices are distinguished, even if they are identical as subsets of \(\mathbb R^{d}\). The label set is independent of \((\textbf{p},\textbf{e})\), since the environment complex \({{\mathscr {F}}}\) is independent of \((\textbf{p},\textbf{e})\) by assumption. See Fig. 6 for an illustration of the resulting hyperplane arrangement.

Fig. 6
figure 6

The hyperplane arrangement of a camera configuration; the longitudinal visibility planes are those that meet in the camera position

Since there are only finitely many \((d-1)\)-faces and \((d-2)\)-faces in \({{\mathscr {F}}}\), the arrangement \({{\mathscr {H}}}(\textbf{p},\textbf{e})\) is finite. More specifically, the number of hyperplanes in \({{\mathscr {H}}}(\textbf{p},\textbf{e})\) is bounded by \(r\) times the number of \((d-1)\)-faces in \({{\mathscr {F}}}\) in the extreme case where no two \((d-1)\)-faces of \({{\mathscr {F}}}\) are adjacent and where no geometric \((d-2)\)-face of \({{\mathscr {F}}}\) contains \(\textbf{p}\) in its affine hull.

The hyperplane data is a polynomial function in the data of the camera configuration.

Lemma 4.2

A hyperplane H in \({{\mathscr {H}}}(\textbf{p},\textbf{e})\) can be represented by equations where the coordinates of and are multilinear polynomial functions of degree at most \(d\) in \((\textbf{p},\textbf{e})\).

Proof of Lemma 4.2

Recall that \((\textbf{p},\textbf{e})\) represents the coordinates of the camera position and all vertices of the geometric environment complex. Let \(\textbf{v}_1,\textbf{v}_2,\dots ,\textbf{v}_d\in {{{\textbf {A}}}}(\textbf{e})\cup \{\textbf{p}\}\) span a hyperplane in \({{\mathscr {H}}}(\textbf{p},\textbf{e})\). Then, a point \(\textbf{x}\) lies in the hyperplane if and only if it satisfies the following equation:

$$\begin{aligned}\det {\begin{pmatrix}\textbf{v}_1&{}\textbf{v}_2&{}\dots &{}\textbf{v}_d&{}\textbf{x}\\ 1&{}1&{}\dots &{}1&{}1\end{pmatrix}}=0\end{aligned}$$

The coefficients of the coordinates of \(\textbf{x}\) as well as the absolute term are, using development of the determinant by the last column, determinants of \(d\times d\) matrices whose entries are coordinates of points in \({{{\textbf {A}}}}(\textbf{e})\cup \{\textbf{p}\}\). Thus, they are multilinear polynomials of degree at most \(d\) in the camera configuration. \(\square \)

For the following, fix such equations \(\textbf{a}_{{i}}^{\top }(\textbf{p},\textbf{e})\hspace{0.49988pt}\textbf{x}-b_{{i}}(\textbf{p},\textbf{e})=0\) for all hyperplanes \({\text {{{\textbf {H}}}}}_{{i}}\) with \({i}\in I\) and denote the matrix with rows \(({{\textbf {a}}}^{\top }_{{i}}(\textbf{p},\textbf{e})\hspace{0.83328pt}|\hspace{0.83328pt}{-}b_{{i}}(\textbf{p},\textbf{e}))_{{i}\in I}\) by \(W(\textbf{p},\textbf{e})\).

Step 3 An open region \({{{\textbf {R}}}}(\textbf{p},\textbf{e})\) of \({{\mathscr {H}}}(\textbf{p},\textbf{e})\) is a connected component of the complement \({{\textbf {P}}}\setminus \bigcup _{{i}\in I}{\text {{{\textbf {H}}}}}_{{i}}\) of the arrangement in the room. The closures \(\overline{{{{\textbf {R}}}}(\textbf{p},\textbf{e})}\) of the open regions are intersections of closed halfspaces with the polytope \({{\textbf {P}}}\) and, therefore, convex polytopes. All open faces of these polytopes are also called regions. Denote by \({{\mathscr {R}}}(\textbf{p},\textbf{e})\) the set of (open) regions of \({{\mathscr {H}}}(\textbf{p},\textbf{e})\). See Fig. 7 on the left for the regions in the running example.

Fig. 7
figure 7

Each region of the hyperplane arrangement is either completely visible or completely invisible from the camera position

Note that, by construction, each open region of the hyperplane arrangement is either completely contained in the total shadow (invisible from \(\textbf{p}\)) or completely in the complement of the total shadow (visible from \(\textbf{p}\)). This is because all supporting hyperplanes of facets of these shadows have been added to \({{\mathscr {H}}}(\textbf{p},\textbf{e})\). Thus, the visible volume is the sum of volumes of all \(d\)-dimensional regions that are inside the room and outside the total shadow, which is the statement of the following lemma.

Lemma 4.3

For a fixed feasible camera configuration \((\textbf{p},\textbf{e})\in \)  D, the visible volume can be computed as follows:

Figure 7 on the right shows the visible volume, subdivided into visible regions.

Step 4 Associated with \({{\mathscr {H}}}(\textbf{p},\textbf{e})\) is its oriented matroid (see Notion 2.4), determined by its finite set of signed covectors. Recall that this is a set of signatures \(\sigma _{{{{\textbf {R}}}}(\textbf{p},\textbf{e})}:I\rightarrow \{-,0,+\}\). Each signature in this set corresponds to an open region \({{{\textbf {R}}}}(\textbf{p},\textbf{e})\) in \({{\mathscr {R}}}(\textbf{p},\textbf{e})\) of \({{\mathscr {H}}}(\textbf{p},\textbf{e})\) so that

$$\begin{aligned}{{{\textbf {R}}}}(\textbf{p},\textbf{e}):=\{\textbf{x}\in {{\textbf {P}}}:{\text {sign}}{(\textbf{a}_{{i}}^{\top }(\textbf{p},\textbf{e})\hspace{0.49988pt}\textbf{x}-b_{{i}}(\textbf{p},\textbf{e}))}=\sigma _{{{{\textbf {R}}}}(\textbf{p},\textbf{e})}({i}),\;{i}\in I\}.\end{aligned}$$

Figure 8 illustrates the covectors of two full-dimensional regions. Each covector is indicated as a string of signs. Each position in the string corresponds to a hyperplane. The sign in that position is the signature value of that hyperplane.

Fig. 8
figure 8

Two regions and their covectors

We define an equivalence relation “\(\sim _{{{\mathscr {H}}}}\)” on \({{\textbf {D}}}\) where \((\textbf{p},\textbf{e})\sim _{{{\mathscr {H}}}}(\textbf{p}', \textbf{e}')\) if and only if \({{\mathscr {H}}}(\textbf{p},\textbf{e})\) and \({{\mathscr {H}}}(\textbf{p}', \textbf{e}')\) are combinatorially equivalent (Notion 2.4). The equivalence class of \((\textbf{p},\textbf{e})\) with respect to “\(\sim _{{{\mathscr {H}}}}\)” is denoted by \(\text {M}_{{{\mathscr {H}}}}(\textbf{p},\textbf{e})\).

Let \(\mathscr {M}_{{{\mathscr {H}}}}\) be the set (see Fact 2.7) of such equivalence classes in \({{\textbf {D}}}\). This set is finite by Fact 2.7. Whether or not a region is totally visible or totally not visible only depends on \(\text {M}_{{{\mathscr {H}}}}(\textbf{p},\textbf{e})\), as the following crucial lemma establishes.

Lemma 4.4

A region R\((\textbf{p},\textbf{e})\) is in the face shadow of a \((d-1)\)-simplex \({F}\in {{\mathscr {F}}}\) with respect to a feasible camera configuration \((\textbf{p},\textbf{e})\) if and only if the following three conditions hold for \(\sigma _{\textbf{R}(\textbf{p},\textbf{e})}\):

  1. (i)

    The vertices of \({{{\textbf {{F}}}}}(\textbf{e})\) and the camera position \(\textbf{p}\) are cocircuits of \({{\mathscr {H}}}(\textbf{p},\textbf{e})\).

  2. (ii)

    Let \({i}\in I\) be the label of the transversal visibility plane spanned by \({F}\). Then

  3. (iii)

    Let \({i}\in I\) be the label of any longitudinal visibility plane spanned by \(\textbf{p}\) and a \((d-2)\)-face \({F}'\in {{\mathscr {F}}}\) of \({F}\) and let \(\textbf{v}_{{F}\setminus {F}'}\) be the geometric vertex of \({{{\textbf {{F}}}}}(\textbf{p},\textbf{e})\) missing in \({{{\textbf {{F}}}}}'(\textbf{p},\textbf{e})\). Then

Moreover, R\((\textbf{p}, \textbf{e})\) is in the total shadow S\(({\textbf{p}}, {\textbf{e}})\) if and only if the above conditions are satisfied for at least one \((d-1)\)-face of \({{\mathscr {F}}}\).

Proof of Lemma 4.4

Assume first that \({{{\textbf {R}}}}(\textbf{p}, \textbf{e})\) is contained in the face shadow of \({F}\). In particular, \({F}\) has a non-empty face shadow. In particular, the camera position is affinely independent of the vertices of \({{{\textbf {{F}}}}}(\textbf{e})\) with which it spans a \(d\)-dimensional simplex. The facet-supporting hyperplane of this simplex are, by construction, exactly the transversal and the longitudinal visibility hyperplanes associated to \({F}\), which are members of \({{\mathscr {H}}}(\textbf{p},\textbf{e})\). This implies condition (i), and, hence, that conditions (ii) and (iii) are well defined. In this case, since \({{{\textbf {R}}}}(\textbf{p},\textbf{e})\) is contained in the face shadow of \({F}\), it satisfies all facet defining inequalities of it. This implies conditions (ii) and (iii), which are a reformulation of the same fact in terms of cocircuit/covector signatures.

Assume now that all three conditions are satisfied. In particular, (ii) and (iii) are well defined. By these conditions, \({{{\textbf {R}}}}(\textbf{p},\textbf{e})\) satisfies all facet defining inequalities of the face shadow of \({F}\). Thus, it is contained in that face shadow. The assertion about the total shadow follows from its definition as the finite union of face shadows. \(\square \)

Corollary 4.5

Whether or not a region is in the total shadow does not change inside each \(\textrm{M}_{{{\mathscr {H}}}}(\textbf{p},\textbf{e})\).

Regions inside the total shadow are called invisible from \(\textbf{p}\), not invisible regions are called visible from \(\textbf{p}\).

Step 5 Recall that the set \(\mathscr {M}_{{{\mathscr {H}}}}\) is finite (Fact 2.7). Recall further that the set \(\mathscr {M}_{{{\mathscr {H}}}}\) is the set of all equivalence classes of elements in \({{\textbf {D}}}\), where the members of each equivalence class induce combinatorially equivalent hyperplane arrangements. The following lemma states that all equivalence classes are semi-algebraic sets.

Lemma 4.6

For each \(({\bar{\textbf{p}}},{\bar{\textbf{e}}})\in \)  D, the equivalence class \(\textrm{M}_{{{\mathscr {H}}}}({\bar{\textbf{p}}},{\bar{\textbf{e}}})\) is a semi-algebraic set. Moreover, there are only finitely many equivalence classes in D.

Proof of Lemma 4.6

The equivalence class \(\text {M}_{{{\mathscr {H}}}}({\bar{\textbf{p}}},{\bar{\textbf{e}}})\) of \(({\bar{\textbf{p}}},{\bar{\textbf{e}}})\) in \({{\textbf {D}}}\) can be written as follows:

$$\begin{aligned} \text {M}_{{{\mathscr {H}}}}({\bar{\textbf{p}}},{\bar{\textbf{e}}})={{\textbf {D}}}\cap {\text {proj}}_{(\textbf{p},\textbf{e})}{\bigl \{(\textbf{p},\textbf{e},W,{\bar{W}})\in {\mathbb {R}}^{d}\times ({\mathbb {R}}^{d})^{J}\times {\mathbb {R}}^{I\times r}\times {\mathbb {R}}^{I\times r}\,{:}\,}\\ W=W(\textbf{p},\textbf{e}),\,{\bar{W}}=W({\bar{\textbf{p}}},{\bar{\textbf{e}}}),\,\text {M}_{{{\mathscr {H}}}}(W)=\text {M}_{{{\mathscr {H}}}}({\bar{W}})\bigr \}. \end{aligned}$$

Here \({{\textbf {D}}}\) is a semi-algebraic set by assumption. The projected set is semi-algebraic by Fact 2.8 and Lemma 4.2. The projection of it to the \((\textbf{p},\textbf{e})\)-coordinates is a semi-algebraic set by Fact 2.2. The intersection with \({{\textbf {D}}}\) is semi-algebraic by Fact 2.2. Therefore, the equivalence class \(\text {M}_{{{\mathscr {H}}}}({\bar{\textbf{p}}},{\bar{\textbf{e}}})\) is a semi-algebraic set. Since there are only finitely many oriented matroids on a finite set of hyperplanes (Fact 2.7), there are only finitely many equivalence classes. \(\square \)

Step 6 The plan is now to compute the volumes of the regions not in the total shadow more explicitly. To this end, each region is triangulated. In order to keep control of the dependence on the camera configuration \((\textbf{p},\textbf{e})\), the same combinatorial type of triangulation should be kept for as many camera configurations as possible. A sufficient condition for a triangulation to stay feasible for the same point configuration with tweaked coordinates is that the oriented matroid of the point configuration does not change.

Note that the oriented matroid of a hyperplane arrangement does not uniquely determine the oriented matroid of its vertices as a point configuration, not even for each region separately. To by-pass this problem, each equivalence class of the previous step is further subdivided. Denote by \({{{\textbf {C}}}}(\textbf{p},\textbf{e})\) the set of vertices of the polyhedral complex of regions of \({{\mathscr {H}}}(\textbf{p},\textbf{e})\cap {{\textbf {P}}}\) and let \(K(\textbf{p},\textbf{e})\) be its label set. In order to guarantee a consistent labeling, we label each point by the subset of labels of those hyperplanes it lies in, where intersection points outside the room are ignored. Note that intersection points inside and outside the room lie on opposite sides of at least one facet-supporting hyperplane of the room, leading to a different oriented matroid of the hyperplane arrangement. Thus, in each equivalence class \(\text {M}_{{{\mathscr {H}}}}(\textbf{p},\textbf{e})\) the subset of intersection points inside the room is constant. Figure   9 shows the point configuration of all intersections points inside the room.

Fig. 9
figure 9

The intersection points of the hyperplane arrangement are the vertices of the regions

We define an equivalence relation “\(\sim _{{{{\textbf {C}}}}}\)” on \({{\textbf {D}}}\) where \((\textbf{p},\textbf{e})\sim _{{{{\textbf {C}}}}}(\textbf{p}',\textbf{e}')\) if and only if \({{{\textbf {C}}}}(\textbf{p},\textbf{e})\) and \({{{\textbf {C}}}}(\textbf{p}',\textbf{e}')\) are combinatorially equivalent (Notion 2.5). The equivalence class of \((\textbf{p},\textbf{e})\) with respect to “\(\sim _{{{{\textbf {C}}}}}\)” is denoted by \(\text {M}_{{{{\textbf {C}}}}}(\textbf{p},\textbf{e})\).

Lemma 4.7

The coordinates of the points in C\((\textbf{p},\textbf{e})\) are rational functions of degree \(d\) in the coordinates of the coefficient vectors and the right-hand sides of the hyperplanes in \({{\mathscr {H}}}(\textbf{p},\textbf{e})\). Consequently, they are rational functions of degree at most \(d^2\) in \((\textbf{p},\textbf{e})\).

Proof of Lemma 4.7

Each point in \({{{\textbf {C}}}}(\textbf{p},\textbf{e})\) is the unique intersection of \(d\) hyperplanes in \({{\mathscr {H}}}(\textbf{p},\textbf{e})\). Thus, each coordinate of such a point is, by Cramer’s rule, a quotient of \(d\times d\) determinants in the coefficients and right-hand sides of the hyperplanes. This is a rational function of degree at most \(d\) in the data of \({{\mathscr {H}}}(\textbf{p},\textbf{e})\). Moreover, by composing this function with the polynomial function from Lemma 4.2, we obtain a rational function of degree at most \(d^2\), as claimed. \(\square \)

Define an equivalence relation on the set of all feasible camera configurations \((\textbf{p},\textbf{e})\in {{\textbf {D}}}\) as follows: \((\textbf{p},\textbf{e})\) and \((\textbf{p}',\textbf{e}')\in {{\textbf {D}}}\) are equivalent, \((\textbf{p},\textbf{e})\sim (\textbf{p}',\textbf{e}')\), if and only if \((\textbf{p},\textbf{e})\sim _{{{\mathscr {H}}}}(\textbf{p}',\textbf{e}')\) and, additionally, \((\textbf{p},\textbf{e}) \sim _{{{{\textbf {C}}}}}(\textbf{p}',\textbf{e}')\). The set of all equivalence classes is denoted by \(\mathscr {M}_{\sim }\). Thus, by Fact 2.10, equivalent camera configurations induce identical sets of (combinatorial types of) triangulations of \({{{\textbf {C}}}}(\textbf{p}, \textbf{e})\) and identical sets of (combinatorial types of) regions. This, finally, is the partitioning of \({{\textbf {D}}}\) into equivalence classes mentioned in the proof idea.

Each equivalence class \(\text {M}_{\sim }({\bar{\textbf{p}}}, {\bar{\textbf{e}}})\in \mathscr {M}_{\sim }\) of some \(({\bar{\textbf{p}}}, {\bar{\textbf{e}}}) \in {{\textbf {D}}}\) is the intersection of \({{\textbf {D}}}\) with \(\text {M}_{{{\mathscr {H}}}}({\bar{\textbf{p}}}, {\bar{\textbf{e}}})\) and \(\text {M}_{{{{\textbf {C}}}}}({\bar{\textbf{p}}},{\bar{\textbf{e}}})\). Analogously to the proof of Lemma 4.6 it can be seen that all three are semi-algebraic sets (by Fact 2.8 and Lemmas 4.2 and 4.7), and so is their intersection (Fact 2.2). Consequently, by Fact 2.3, each such equivalence class in \({{\textbf {D}}}\) and, hence, the semi-algebraic set of feasible camera configurations \({{\textbf {D}}}\) itself can be stratified into strata \(S^{\infty }\)-diffeomorphic to open cubes of certain dimensions so that the boundary of each stratum is a finite union of smaller-dimensional strata and so that inside each stratum all camera configurations are equivalent. Moreover, the volumes of the finitely many max-dimensional strata add up to the volume of \({{\textbf {D}}}\), and the not-max-dimensional strata form a set of measure zero.

Step 7 For each \(\text {M}_{\sim }(\textbf{p},\textbf{e})\in \mathscr {M}_{\sim }\) refine the polyhedral complex of regions in \({{\mathscr {R}}}(\textbf{p},\textbf{e})\) that are inside \({{\textbf {P}}}\) to a fixed triangulation of \({{{\textbf {C}}}}(\textbf{p},\textbf{e})\), e.g., by some generic regular refinement [9, Corollary 2.3.18]. Any such triangulation (seen as an abstract simplicial complex on \(K(\textbf{p},\textbf{e})\), see Notion 2.9) defines via the embedding \(\textbf{e}\) and the position \(\textbf{p}\) a valid triangulation for all feasible camera configurations equivalent to \((\textbf{p},\textbf{e})\), since the validity of a triangulation depends only on the oriented matroid of the point configuration to be triangulated (Fact 2.10). Call this triangulation \({{\mathscr {T}}}(\text {M}_{\sim }(\textbf{p},\textbf{e}))\). Because \({{\mathscr {T}}}(\text {M}_{\sim }(\textbf{p},\textbf{e}))\) refines \({{\mathscr {R}}}(\textbf{p},\textbf{e})\) inside \({{\textbf {P}}}\), the open geometric embedding of each simplex in \({{\mathscr {T}}}(\text {M}_{\sim }(\textbf{p},\textbf{e}))\) is either completely visible or completely invisible from \(\textbf{p}\), and the visibility does not change inside an equivalence class. Figure 10 shows a possible triangulation for the visible region and the resulting visible volume.

Fig. 10
figure 10

The volumes of the visible regions can be computed by a triangulation of the intersection points refining the polyhedral subdivision by regions; the camera configuration on the right is better than the one on the left

Step 8 Consider some feasible camera configuration \(({\bar{\textbf{p}}},{\bar{\textbf{e}}})\in {{\textbf {D}}}\). Then the visible volume can be computed for all \((\textbf{p},\textbf{e})\) in the equivalence class \(\text {M}_{\sim }({\bar{\textbf{p}}},{\bar{\textbf{e}}})\) as follows:

$$\begin{aligned} \begin{aligned} {V}(\textbf{p},\textbf{e})&\,=\!\sum _{\begin{array}{c} {F}\in {{\mathscr {T}}}(\text {M}_{\sim }({\bar{\textbf{p}}},{\bar{\textbf{e}}})):\\ {{{\textbf {{F}}}}}^{\circ }(\textbf{p},\textbf{e})\subseteq {{\textbf {P}}}\setminus {{\textbf {S}}}(\textbf{p}, \textbf{e}) \end{array}}\!\!\!{\text {vol}}_{d}({{{\textbf {{F}}}}}(\textbf{p},\textbf{e}))\\&\,=\,\frac{1}{d!}\,\sum _{\begin{array}{c} {F}=\{{k}_1,\dots ,{k}_{r}\}\in {{\mathscr {T}}}(\text {M}_{\sim }({\bar{\textbf{p}}},{\bar{\textbf{e}}})):\\ {{{\textbf {{F}}}}}^{\circ }(\textbf{p},\textbf{e})\subseteq {{\textbf {P}}}\setminus {{\textbf {S}}}(\textbf{p}, \textbf{e}) \end{array}}\,\left| \det {\begin{pmatrix}\textbf{v}_{{k}_1}&{}\dots &{}\textbf{v}_{{k}_{r}}\\ 1&{}\dots &{}1\end{pmatrix}} \right| . \end{aligned} \end{aligned}$$
(1)

This is the sum of positive simplex volumes mentioned in the proof idea. Thus, the visible-volume function restricted to an equivalence class is a sum of determinants of \(r\times r\) matrices with a row of ones whose columns are given by the homogeneous coordinates of points in \({{{\textbf {C}}}}(\textbf{p},\textbf{e})\), thus a multilinear polynomial function of degree at most \(d\) in the coordinates of the points in \({{{\textbf {C}}}}(\textbf{p},\textbf{e})\). By composition with earlier results, this is a rational function of degree at most \(d^3\) in the camera configuration data. By continuity and boundedness of the visible-volume function everywhere in \({{\textbf {D}}}\), the visible-volume function formula (1) extends to the boundary of each stratum. (Intuitively, some of the simplex volumes contained in the triangulation corresponding to the interior of the stratum degenerate to zero on some boundary stratum; these simplices are exactly those missing in the triangulation corresponding to the boundary stratum, which leads to the same volume.) Thus, the visible-volume function is a rational function of degree at most \(d^3\) on the closure of each stratum.

Remark 4.8

Although all illustrations are two-dimensional, all constructions are correct in arbitrary spacial dimensions \(d\). Note, though, that in dimension two the result can be achieved in an easier way, exploiting structures of dimension two that cannot be generalized to higher dimensions.

The construction allows for the following generalization: If there is more than one camera to be configured, we can construct the open regions visible and invisible from each camera separately. Each open region in the combined hyperplane arrangement is then a subset of a unique open region in each separate arrangement and, hence, for each camera either completely visible or invisible. We can, therefore, decide the exact subset of cameras from which it is visible completely. Therefore, the result extends to the volume covered by a given collection of subsets of cameras. In particular, this applies to the volume covered by at least/exactly/at most k cameras. Call the function that assigns to each feasible configuration of multiple cameras the volume visible by at least/exactly/at most k cameras the at-least/exactly/at-most-k-fold-visible-volume function, respectively. With this definition, the following corollary holds true.

Corollary 4.9

For all \(k\in {\mathbb {N}}\) the at-least/exactly/at-most-k-fold-visible-volume functions are continuous, piecewise rational, locally Lipschitz, and semi-algebraic in all dimensions.

Remark 4.10

A short note on complexity estimates: If K is the number of facets of the environment complex and the room, then there are K transversal and at least \(K\hspace{0.33325pt}(r-1)\) longitudinal visibility hyperplanes. With this, in general, one must consider roughly \(\sum _{i=1}^{r}\genfrac(){0.0pt}1{K}{i}\genfrac(){0.0pt}1{K(r-1)}{r-i}\) regions contributing to potentially different summands over all strata. The number of strata is even more discouraging: even if each equivalence class constitutes a single stratum without further decomposition, then a-priori there can be roughly as many strata as there are different oriented matroids on arrangements of \(Kr\) hyperplanes, where \(K(r-1)\) of them all intersect in a point. For example, in physical space, i.e., in rank 4, there are already 10, 559, 305 realizable simple acyclic oriented matroids on eight elements (= hyperplanes) [11]. Even if all but \(r=4\) many longitudinal hyperplanes are ignored because of their forced common intersection, this number of strata would be reached already by the at least \(K=4\) facets of the room without any obstacles.

5 Conclusions

In this paper, the visible-volume function was shown to be continuous, piecewise rational, locally Lipschitz, and semi-algebraic in all dimensions. The set-up was chosen more general than in earlier work: the visible-volume function may depend on the positions of a set of cameras and the embedding of an environment in a convex room. It returns the volume that the cameras can supervise given the cameras’ positions and the embedding of the environment. The environment can be an arbitrary abstract simplicial complex of pure codimension one. The embedding and the camera positions can be restricted to an arbitrary semi-algebraic set. The actual result provides a piecewise smooth formula with a rational function on each piece. Given this knowledge, we can be sure that certain global blackbox optimization methods applied to the visible-volume function will converge (at least if the restrictions of the embedding and the camera positions are chosen to be tractable). Moreover, from the explicit piecewise formula, gradient information of the visible-volume formula can easily be obtained at each feasible camera configuration.

One contribution of this paper is to formalize the problem and construct suitable objects of discrete geometry in such a way that a novel combination of the basic theories of oriented matroids, triangulations, and semi-algebraic sets implies the result. This can be seen as a show-case how those theories play together, which may be interesting in its own right.

At first glance, it seems that the exploitation of the explicit piecewise formula in this paper for optimization is out of reach for sufficiently realistic environments. However, it is conceivable that large-scale methods from mixed integer linear programming, e.g., with dynamically generated selection variables for oriented matroids, might constitute a viable approach to find an exact global extremum of the visible volume function. Whether such methods can be implemented to show a satisfactory performance for practical problems or at least for medium-sized academic benchmark examples is an open question.