1 Building Blocks

Before getting to shapes and calculations with them we should examine their building blocks. That is geometric elements like points, lines, planes, and solids. We restrict the inquiry to so-called flat loci where lines are strait, planes are flat, and solids are delineated by flat planes. Such a system could be extended, in a straightforward way, to include curved lines and surfaces so that flat loci restriction should not impede the generality of what we are trying to achieve. We consider only finite geometric elements and finite sets of such elements that are confined to a finite space.

1.1 Geometric Elements

Our perceptual reality consists of three-dimensional (3D) things the abstraction of which are 3D geometric elements or solids situated in 3D space. Some of the things may have one or two dimensions much larger than the remaining ones like for example a sheet of paper with the width and depth much bigger than its thickness or a piece of string with a length overpowering its cross-section area. By abstracting these small dimensions, one gets planes and lines as two-dimensional (2D) and one-dimensional (1D) geometric element, respectively. The latter elements could be arrived at by seeing the surfaces of solids or their edges as entities separate from the solids themselves. By the same token, one gets the zero-dimensional (0D) geometric elements or points as the places where two or more noncolinear edges meet. Having less than three-dimensional elements opens possibility for the spaces these are situated in to be less than three-dimensional as well. A line can be in the space, but also on an infinite plane or an infinite line. At the minimum, a point can be situated on a point, which is a 0D space. In general, a geometric element is characterized by its dimensionality and that of the space it is defined in. Typically, a geometric element of dimension i defined in the space of dimension \(j \ge i\) is denoted by \(a_{ij}\) with all the combinations shown below

$$ \begin{array}{*{20}l} {a_{00} } \hfill & {a_{01} } \hfill & {a_{02} } \hfill & {a_{03} } \hfill \\ {} \hfill & {a_{11} } \hfill & {a_{12} } \hfill & {a_{13} } \hfill \\ {} \hfill & {} \hfill & {a_{22} } \hfill & {a_{23} } \hfill \\ {} \hfill & {} \hfill & {} \hfill & {a_{33} } \hfill \\ \end{array} $$

It is clear from the table above that the minimum space (in terms of its dimensionality) in which a single geometric element can be defined is of the same dimension as the geometric element itself. Elements defined in their minimum spaces are diagonal geometric elements as they appear on the diagonal of the table above. The minimum space for a set of geometric elements could be as small as the minimum space of one of the elements and as big as the 3D space. For example, minimum space for two colinear lines is 1D, for two parallel or two intersecting lines is 2D, while for two skew lines is 3D. If the minimum space of a nonempty set of geometric elements is the same as the minimum space of one of its elements, then it is a diagonal set and the space is diagonal space. It is easy to see that in such a set all elements have the same minimum space. For example, the set of all solids is diagonal, but so is a set of colinear lines defined in a plane.

Boundaries outline geometric elements. Each geometric element is delineated by a finite collection of geometric elements one dimension smaller than itself. Two endpoints delineate a line, a polygon delineates a plane and a closed polyhedral surface delineates a solid. Points do not have boundaries and lines have 2-point boundaries. Given that each geometric element of dimension greater than 0 has infinitely many geometric elements embedded in it, the boundary of a geometric element of dimension greater than 1 can be described by an infinite set of geometric elements. However, the fact that there are also finite descriptions qualifies it as a boundary. There are figures with finite areas and infinite boundaries i.e. boundaries that cannot be described by finite sets. For example, the infinite Koch snowflake is a finite area planar figure with an infinite fractal boundary.

1.2 Calculating with Geometric Elements

Geometric elements could be related in many ways. One could be embedded in or be coincident with another element or the two could overlap or touch. There are numerous other relations but just mentioned four play important roles when calculating with geometric elements. The most important relation is embedding. Intuitively, given two lines , the top line is embedded in the bottom one, if the result of drawing one on top of the other is the bottom line. The top line appears to be a part of the bottom one. The embedding relation is a partial order \(\le\) on a set of geometric elements of the same kind—i.e. the elements of the same dimension defined in the same space. Note that this implies that only lines could be parts of lines, planes parts of planes and solids parts of solids. A point can be coincident with a line but not its part. However, for \(a \le b\) to hold, where a and b are geometric elements, being of the same kind is not enough. There is another necessary—but not sufficient—condition. Set \(\left\{ {a,b} \right\}\) must be diagonal.

For points partial order is identity. A point is a part of another point if they are identical. That is if \(a \le b\) then \(b \le a\) and \(a = b\), where a and b are points. Note that for points all diagonal sets are singletons.

Armed with partial order we may proceed to define Boolean operations: product, sum, difference, and symmetric difference—for geometric elements of the same kind.

For points defined on a point (0D space) sum and product are always defined and equal to the only point, which is both the smallest and the greatest element. In contrast, difference and symmetric difference are never defined. Points defined in 1D, 2D, and 3D spaces have sum and product only if the points that are arguments are identical. In contrast, difference is only defined if the arguments are different points, while symmetric difference is never defined. Geometric elements of higher dimension have more elaborate behavior in calculations. Operations for lines planes and solids are defined below.

Product \(a \cdot b = c\) exists if c is the greatest common part of a and b. That is \(c \le a\) and \(c \le b\) so that set \(\left\{ {a,b,c} \right\}\) is diagonal. Given lines , the top one is the product of the middle and the bottom line. Lines belong to a diagonal set but do not have the product as there is no line that is a part of both. It is clear from the definition and examples that for \(a \cdot b\) to be defined a and b must have common parts—i.e. overlap–however, this is not sufficient for planes and solids. For example, two interlocking 2D L-s and , overlap but do not have the product. The greatest common part is missing, as we end up with two incomparable elements .

Sum \(a + b = c\) if c is the smallest geometric element with both a and b as parts (1), and there is no part of c that does not share parts with a or b (2). If sum exists then \(a \le c\) and \(b \le c\) so that set \(\left\{ {a,b,c} \right\}\) is diagonal. Given lines , the top one is the sum of the middle and the bottom line. In contrast, with lines the top one is the smallest line with the bottom two as parts, but it is not their sum. It satisfies condition (1) however the gap between the bottom lines can accommodate infinitely many lines that violate condition (2). Both conditions (1) an (2) are required only for lines. For planes and solids condition (1) is sufficient. For example, neither planes nor planes satisfy (1) and cannot be summed. In contrast, planes and planes do satisfy (1) so that and are their respective sums. The sums exist because planes overlap in the first case and touch in the second. The touch relation could now be defined.

Two geometric elements touch if their sum exists, but they do not share parts.

Difference \(a - b = c\) exists if c is the greatest part of a that does not share parts with b. Given lines the top line is the result of subtracting the middle line from the bottom one. The same result we get if the middle line is subtracted from the top one and we get the middle line if the two arguments swap their places. That is, \(a - b = a\) and \(b - a = b\) if the two do not have common parts. There is no difference defined for lines as in one case we end up with two geometric elements and none in the other case. There is another, somewhat unintuitive, requirement stemming from the Boolean nature of the operations. As there is no greatest or the smallest geometric element difference is defined using relative complements. It is the unique complement of b relative to the interval \(\left[ {b,a + b} \right]\). Thus, the difference could only be defined if \(a + b\) is defined.

Symmetric Difference \(a \oplus b = c\) exists if c is the greatest geometric element with each of its parts being either part of a or b, but not of both. For example, each of the three lines is the symmetric difference of the other two. In contrast, lines do not have the symmetric difference as two different lines satisfy the definition. Like the other operations, the symmetric difference is only defined for diagonal sets of arguments.

Although the operations above are Boolean in nature some of the standard Boolean identities do not hold. For example, the definition of difference as the unique complement of a·b relative to the interval \(\left[ {a \cdot b,a} \right]\), which is equivalent to the one given before, does not hold if a·b is not defined although the difference may be defined. Similarly, if \(a - b\) exists then \(a - b = a - \left( {a \cdot b} \right)\) should hold. For example, two overlapping L-s and yield two possible differences and . However, the identity does not hold for either of the differences because the product of the L-s is not defined. Likewise, symmetric difference of the two L-s is , which is following standard identity \(a \oplus b = \left( {a{-}b} \right) + \left( {b{-}a} \right)\). However, another standard identity \(a \oplus b = \left( {a + b} \right) - \left( {a \cdot b} \right)\) does not hold for lack of the product.

Note that the geometric elements that are results of the operations above have finite boundaries because the elements that are the arguments of the operations have finite boundaries.

Set \(I_{ij}\) of all geometric elements of dimension i defined in the space of dimension j together with operations ·, +, −, and \(\oplus\) forms partial algebra \({\varvec{I}}_{{{\varvec{ij}}}}\)–which is partial in a sense that \(I_{ij}\) is not closed under the operations.

2 Shapes

In the previous section, we were dealing with single geometric elements which are building blocks of shapes. Intuitively, shapes are collections of such elements like the collection of lines that makes rectangle . Nevertheless, shapes will be defined here without relying on these intuitions. Rather, the formal conditions under which partial algebras of geometric elements evolve into algebras of shapes will guide the definition.

2.1 Towards Shape

Calculations with geometric elements are purely spatial: one starts with two geometric elements and transforms them into one usually different than both–but occasionally equal to one of them. Such a transformation depends on a spatial relation between geometric elements and may not always be possible. In contrast, nonspatial or symbolic calculations are always possible as they typically involve just repacking of geometric elements while leaving them intact. One may take two elements from two packages and place them into one: \(\left\{ a \right\} \cup \left\{ b \right\} = \left\{ {a,\,b} \right\}\); or may take some elements out of a package and not worry if the package ends up empty: \(\left\{ {a,\,b} \right\}\backslash \left\{ {a,\,b} \right\} = \{ \} = \emptyset\). The packages are more important than the elements they contain so the latter are as good as symbols.

For operations involving geometric elements to be always defined spatial operations of \({\varvec{I}}_{{{\varvec{ij}}}}\) should be extended to include nonspatial (set) operations. Consequently, geometric elements are replaced with sets of geometric elements of the same kind, or shapes. Shapes are combinations of the spatial and nonspatial. The spatial is what matters the most while the nonspatial is there for closure i.e. to be able to calculate and always get the result.

For example, one cannot make a line out of lines so the sum from I11 fails. However, if each line is seen as one-line shape then the set union produces a two-line shape and we have the sum. Similarly, if the top line is subtracted from the bottom one no geometric element is left, and the difference fails. Not so if the two lines are shapes. The difference produces a shape with no geometric elements, just an empty set.

Geometric elements forming a shape must, be of the same kind, and occupy a finite chunk of space. Because there are infinitely many geometric elements embedded in a single geometric element–if its dimension is greater than 0–different sets, including infinite ones, of geometric elements may represent the same shape. An infinite set may represent a shape if there is at least one finite set representing the same shape. The following proposition establishes bounds for such sets.

Proposition 1: Let a and A be sets of geometric elements defined in \({\varvec{I}}_{{{\varvec{ij}}}}\) and confined to a finite chunk of space. Let a be finite with sums being defined only for pairs of identical elements (i) and let A be the set of all elements that are parts of elements of a, or \(A = \{ x \le y|y \in {\varvec{a}}\}\) (ii). The following holds:

  1. (1)

    a is the set of maximal geometric elements of A,

  2. (2)

    a represents a shape, and

  3. (3)

    A is the set of all geometric elements embedded in the shape represented by a.Footnote 1

Sets a and A are, in terms of their cardinalities, respective minimal and maximal sets representing the same shape. The former one is the ideal shape representation because it is unique and compact which leads to the following three equivalent definitions of shape.

A shape occupies a finite chunk of space and is:

  1. (1)

    A finite set of geometric elements defined in \({\varvec{I}}_{{{\varvec{ij}}}}\) such that only pairs of identical elements have sums.

  2. (2)

    A finite set of maximal geometric elements defined in \({\varvec{I}}_{{{\varvec{ij}}}}\).

  3. (3)

    A finite subalgebra of \({\varvec{I}}_{{{\varvec{ij}}}}\) with sums and products defined only for identical elements.

Note that subset X of partial algebra \({\varvec{I}}_{{{\varvec{ij}}}}\) is its subalgebra if every sum (product) of elements of X which is defined is also an element of X.

Any finite set of geometric elements from \({\varvec{I}}_{{{\varvec{ij}}}}\), occupying a finite chunk of space, may be represented as a shape.

Proposition 2: Let C be such a set and let \(cl_{ + } \left( C \right)\) be its closure under sum, where cl+ is a closure operator on \(\wp \left( C \right)\). Set a of maximal elements of \(cl_{ + } \left( C \right)\) is a shape represented by C.Footnote 2

The same is true if C is infinite provided that a exists and is finite and that for every \(x \in C\) there is \(y \in {\varvec{a}}\) such that \(x \le y\). A good example of such a set is A from Proposition 1.

2.2 Calculating with Shapes

Calculations with shapes are combinations of spatial ones, which alter geometric elements, and the nonspatial ones, which just group them. Unlike spatial calculations with geometric elements, which may not always be defined, calculations with shapes always result in shapes.

As with geometric elements operations for shapes are Boolean and depend on the partial order among shapes. The latter is defined as follows.

The Subshape (or a part) a of shape b, or \({\varvec{a}} \le {\varvec{b}}\), is a shape where for every \(x \in {\varvec{a}}\) there is \(y \in {\varvec{b}}\) such that \(x \le y\).

The smallest shape is an empty shape which is an empty set of geometric elements denoted by 0. An empty shape is a part of every shape.Footnote 3

The subshape relation is pivotal in defining operations on shapes, but for calculating with them we also rely on operations for geometric elements.

It is important to note that the operations below are defined for shapes occupying the same finite chunk of space.Footnote 4

Sum \({\varvec{a}} + {\varvec{b}}\) is the smallest shape which has both a and b as parts. It is the set of maximal elements of \(cl_{ + } ({\varvec{a}} \cup {\varvec{b}})\).Footnote 5 The sum could be calculated recursively with the aid of the sum operation from \({\varvec{I}}_{{{\varvec{ij}}}}\).Footnote 6,Footnote 7

$$ \begin{array}{*{20}l} {{\text{Initial}}\,{\text{values:}}} \hfill & {A_{0} = {\varvec{a}},B_{0} = {\varvec{b}},i = 1, \, 2, \ldots card\left( {\varvec{b}} \right)} \hfill \\ {{\text{Recursive}}\,{\text{step:}}} \hfill & {B_{i} = B_{i - 1} \backslash \left\{ b \right\},\,{\text{where}}\,b \in B_{i - 1} ,} \hfill \\ {} \hfill & {C = \, \{ x\,{\text{if}}\,x + b\,{\text{is}}\,{\text{not}}\,{\text{defined}}|x \in A_{i - 1} \} ,} \hfill \\ {} \hfill & {D = \left\{ {x + b|x \in A_{i - 1} \backslash C} \right\},} \hfill \\ {} \hfill & c = \sum {\left( {D \cup \left\{ b \right\}} \right),} \hfill \\ {} \hfill & A_{i} = C \cup \left\{ c \right\} \hfill \\ {\text{Result:}} \hfill & {{\varvec{a}} + {\varvec{b}} = A_{card(b)} } \hfill \\ \end{array} $$

The set \(U_{ij}\) of i-dimensional shapes defined in the j-dimensional space closed under + and · is a relatively complemented distributive lattice ordered by the subshape relation. It features an empty shape as the smallest element while lacking the greatest one. Being distributive makes its relative complements unique, enabling the definition of the difference operation.

Difference ab is the relative complement of b with respect to interval [0, a + b], or dually the relative complement of a·b with respect to interval [0, a]. It is the greatest shape made only of parts of a which have no parts that are parts of b. It could be calculated recursively as follows.

$$ \begin{array}{*{20}l} {{\text{Initial}}\,{\text{values:}}} \hfill & {A_{0} = {\varvec{a}},B_{0} = {\varvec{b}},i = \, 1, \, 2, \ldots card\left( {\varvec{b}} \right)} \hfill \\ {{\text{Recursive}}\,{\text{step:}}} \hfill & {B_{i} = B_{i - 1} \backslash \left\{ b \right\},\,{\text{where}}\,b \in B_{i - 1} ,} \hfill \\ {} \hfill & {C = \{ x\,{\text{if}}\,x{-}b\,{\text{is}}\,{\text{not}}\,{\text{defined}}|x \in A_{i - 1} \} ,} \hfill \\ {} \hfill & {D = \left\{ {x - b|x \in A_{i - 1} \backslash C} \right\},} \hfill \\ {} \hfill & {A_{i} = C \cup D} \hfill \\ {\text{Result:}} \hfill & {{\varvec{a}}{-}{\varvec{b}} = A_{card(b)} } \hfill \\ \end{array} $$

Product a·b is the greatest shape embedded in both a and b. To calculate it we rely on the difference for shapes which is related to the product via \({\varvec{a}} \cdot {\varvec{b}} = {\varvec{a}}{-}\left( {{\varvec{a}}{-}{\varvec{b}}} \right)\).

Symmetric Difference \({\varvec{a}} \oplus {\varvec{b}}\) is the greatest shape having only parts of a that have no parts that are parts of b and parts of b that have no parts that are parts of a. To calculate it one may use – and + with formula \({\varvec{a}} \oplus {\varvec{b}} = \left( {{\varvec{a}}{-}{\varvec{b}}} \right) + \left( {{\varvec{b}}{-}{\varvec{a}}} \right)\) or equivalently by using –, +, and ⋅ with \({\varvec{a}} \oplus {\varvec{b}} = \left( {{\varvec{a}} + {\varvec{b}}} \right){-}({\varvec{a}} \cdot {\varvec{b}})\).

For example, shapes and have product , sum , difference , another difference , and symmetric difference .

2.3 Boundaries of Shapes

We established earlier that the boundary of a geometric element may be represented by a finite sets of geometric elements one dimension lower than the original element. However, proposition 2 allows for a more precise characterization of the boundary.

Boundaries of geometric elements are shapes one dimension lower than the elements.Footnote 8

This allows for a unique and compact representation of boundaries and introduction of boundary operator \(b_{e} {: }\,I_{ij} \to U_{i - 1j}\), where \(U_{i - 1j}\) is the set of (i − 1)-dimensional shapes defined in the j-dimensional space. Boundary operator takes a geometric element from \(I_{ij}\) to its boundary which is a shape in \(U_{i - 1j}\), or \({\varvec{y}} = b_{e} \left( x \right),x \in I_{ij} ,{\varvec{y}} \in U_{i - 1j}\). For example, be( ) = i.e. a quadrilateral planar element is turned into a set of four maximal lines or a linear shape which is a boundary of the planar element. Because shapes are sets of maximal geometric elements boundaries are sums of the boundaries of the elements. Consequently, the boundary operator for shapes \(b{: }\,U_{ij} \to U_{i - 1j}\) is defined as \(b\left( {\varvec{a}} \right) = \sum\nolimits_{{x \in {\varvec{a}}}} {b_{e} \left( x \right)}\) where \(b\left( {\varvec{a}} \right) \in U_{i - 1j}\), \({\varvec{a}} \in U_{ij}\) and \(x \in I_{ij}\). For example, b( ) = be( ) + be( ) = + = .

Boundaries of shapes are shapes one dimension lower than the original shapes. They are sums of the boundaries of maximal elements representing shapes.

For example, sequence of shapes , , , and has a 3D solid cube, its boundary which is a 2D shape consisting of 6 planar squares, with 1D boundary consisting of 12 lines, and its boundary a 0D shape having 8 points, respectively.

Calculations with shapes do not mirror calculations with their boundaries i.e. the two are not isomorphic. For example, for two singleton shapes the boundary of their sum is different than the sum of their boundaries . The only exception is the operation of symmetric difference when applied to shapes sharing the same diagonal space.

Proposition 3: The boundary of symmetric difference of two shapes sharing the same diagonal space is the symmetric difference of their boundaries, or \(b({\varvec{a}} \oplus {\varvec{b}}) = b\left( {\varvec{a}} \right) \oplus b\left( {\varvec{b}} \right)\) where \({\varvec{a}},{\varvec{b}} \in U_{ii}\).Footnote 9

For example, shapes and with the respective boundaries and have symmetric difference with boundary . The latter is also the symmetric difference of boundaries of the original shapes. Restriction to diagonal shapes is necessary to avoid situations where the products of boundaries are parts of new boundaries like, for example, the surface of cube with boundary which has products of boundaries of the adjacent faces. Because products are never parts of symmetric differences proposition 3 does not hold.

3 Algebras of Shapes

Algebras of shapes provide the framework for calculations with shapes. They are formalizing the design practice by modelling what designers do when they design. The process of drawing, outlining, or erasing shapes is handled well with the Boolean operations above. Designers also move, scale and otherwise transform shapes in order to achieve different spatial relations. This cannot be modeled with Boolean operations. For that \(U_{ij}\) must be closed under similarity transformations.Footnote 10 The latter form an algebra of their own: a group. An algebra for shapes must include both a Boolean lattice and a group.

3.1 Two-Sorted Algebras

An algebra of shapes should have a Boolean part to handle the structures of shapes and a group part to deal with their symmetries.

The Boolean part has set \(U_{ij}\) of shapes, occupying a finite chunk of space, which together with Boolean operations forms a relatively complemented distributive lattice with the least element, but without the greatest one. Such a structure is due to its Boolean properties also known as Generalized Boolean Algebra (GBA).

The group part has set Tij of similarity transformations that can act on i-dimensional shapes defined in a j-dimensional space. Set \(T_{ij}\) is closed under group operations of composition °, inverse −1, and identity , to form a group. This structure allows for calculating with transformations. For example, simple transformations could be combined to create more complex ones, or an inverse of a transformation could be created to undo an erroneous move.

Boolean and group parts are connected via the operation of group action (): \(T_{ij} \times U_{ij} \to U_{ij}\) where a shape a is acted upon by a transformation t to produce the transformed shape t(a).

The two parts are combined in a two-sorted algebra \({\varvec{U}}_{{{\varvec{ij}}}}\) with carrier \(\left\{ {U_{ij} ,T_{ij} } \right\}\) having elements of two different sorts—shapes and transformations—and signature {·, +, -, \(\oplus\), °, −1, , ()} with Boolean and group operations as well as the group action. Based on the geometric elements of their shapes (i) and the space in which they are defined (j) \({\varvec{U}}_{{{\varvec{ij}}}}\) algebras are enumerated in the following table.

$$ \begin{array}{*{20}l} {{\varvec{U}}_{{{\varvec{00}}}} } \hfill & {{\varvec{U}}_{{{\varvec{01}}}} } \hfill & {{\varvec{U}}_{{{\varvec{02}}}} } \hfill & {{\varvec{U}}_{{{\varvec{03}}}} } \hfill \\ {} \hfill & {{\varvec{U}}_{{{\varvec{11}}}} } \hfill & {{\varvec{U}}_{{{\varvec{12}}}} } \hfill & {{\varvec{U}}_{{{\varvec{13}}}} } \hfill \\ {} \hfill & {} \hfill & {{\varvec{U}}_{{{\varvec{22}}}} } \hfill & {{\varvec{U}}_{{{\varvec{23}}}} } \hfill \\ {} \hfill & {} \hfill & {} \hfill & {{\varvec{U}}_{{{\varvec{33}}}} } \hfill \\ \end{array} $$

The table resembles that of geometric elements. For example, algebras with shapes defined in the minimum space of their geometric elements appear on the diagonal of the table above, the same way the elements appeared in the previous table. The geometric elements were diagonal, and the algebras are diagonal operating on diagonal shapes in diagonal spaces.

3.2 Combining Algebras

Shapes in practice often come as compound, having geometric elements of different kinds like , which has four lines and a planar segment. The lines belong to \({\varvec{U}}_{12}\) while the planar segment belongs to \({\varvec{U}}_{22}\) so that the shape must belong to a combination of the two algebras. A standard algebraic combination is the direct product of component algebras which have the same signatures. Direct product \({\varvec{U}}_{12} \times {\varvec{U}}_{22}\) of \({\varvec{U}}_{12}\) and \({\varvec{U}}_{22}\) is a two-sorted algebra of compound shapes with carrier \(\{ U_{12} \times U_{22} ,\,T_{12} \times T_{22} \}\) which is the Cartesian product of the component carriers and operations defined componentwise. Shape is represented by ordered the pair ( , ) where U12 and U22. The componentwise symmetric difference of two compound shapes \(\left( {{\varvec{a}},\,{\varvec{u}}} \right),\,\left( {{\varvec{b}},\,{\varvec{v}}} \right) \in U_{12} \times U_{22}\) is \(\left( {{\varvec{a}},\,{\varvec{u}}} \right) \oplus \left( {{\varvec{b}},\,{\varvec{v}}} \right) = ({\varvec{a}} \oplus {\varvec{b}},\,{\varvec{u}} \oplus {\varvec{v}})\). For example, = , where , U12 × U22. Likewise, action of compound transformation \(\left( {{\varvec{t}}_{1} ,{\varvec{t}}_{2} } \right) \in T_{12} \times T_{22}\) on compound shape \(\left( {{\varvec{a}},\,{\varvec{b}}} \right) \in U_{12} \times U_{22}\) is \(\left( {{\varvec{t}}_{1} ,{\varvec{t}}_{2} } \right)\left( {\left( {{\varvec{a}},\,{\varvec{b}}} \right)} \right) = \left( {{\varvec{t}}_{1} \left( {\varvec{a}} \right),\,{\varvec{t}}_{2} \left( {\varvec{b}} \right)} \right) \in U_{12} \times U_{22}\). For example, clockface showing 9:00 shows (9:15) after the action of transformation \((rot( - 90^\circ ),rot( - 90/12 = - 7.5^\circ )) \in T_{12} \times T_{22}\), where , U12 × U22 and rot(x) is the rotation of x degrees around the origin.

Another combination of algebras is their sum. Unlike direct product, which is in the domain of universal algebra, sum is particular to algebras of shapes. It is based on a subdirect product i.e. a subalgebra of a direct product which enumerates all elements of the component algebras, but not all their combinations. The sum of two shape algebras is a subdirect product which enumerates all shapes of the component algebras as well as all their combinations but allows only combinations of equal transformations. Sum does not restrict the Boolean part but requires for all components of compound shapes to be transformed in the same way. This preserves the integrity of compound shapes in calculations. For example, compound shape could be rotated in the direct product algebra so that its boundary is off however, this cannot happen with the sum of algebras where both the shape and its boundary are rotated in the same way .

3.3 Decomposing Algebras

As previously shown the necessary condition for two geometric elements to be able to spatially interact is that they are both occupying the same diagonal space. However, they must overlap or at least touch for their interaction to result in new geometric elements, that is, to be spatial. All shapes in a diagonal algebra share the same diagonal space as for example, two lines which are singleton shapes from U11. The sum of two lines is a spatial calculation as it results in a longer line . In contrast, two singleton shapes and defined in U12 have sum which is their set union. This is a nonspatial calculation yielding no new geometric elements. Calculations are usually combinations of spatial and nonspatial as for example, with sum of shapes and defined in U12. This operation has a spatial part and a nonspatial one = = . Note that + from U12 acts as + from U11 in the spatial part of the calculation and as set union in the nonspatial part. This means that instead of calculating with shapes in U12 we may calculate with their parts in diagonal algebras and take the union of the results of these calculations. To take this further we need to utilize shape decompositions.

A shape could be decomposed into shapes that are its parts. For shape a set A of its parts is a decomposition of a if it is finite and sums up to a, or \(\Sigma A = {\varvec{a}}\). Set A is a discrete decomposition of a if for each \({\varvec{x}},\,{\varvec{y}} \in A\) and \({\varvec{x}} \ne {\varvec{y}},\,{\varvec{x}} \cdot {\varvec{y}} = 0\). There is a unique discrete decomposition of each shape that stems from the shape definition.

The natural decomposition of shape \({\varvec{a}} \in {\varvec{U}}_{{{\varvec{ij}}}}\) is set \({\mathbf{n}}_{a} = \{ \left\{ x \right\}|x \in {\varvec{a}}\}\).

Set na is a decomposition of a with elements that are singleton shapes of maximal geometric elements which define a.For example, shape has natural decomposition { , , , }. Each shape has its unique natural decomposition. Because shapes which are elements of the decomposition are incomparable their sum and union are equal, or \(\Sigma {\mathbf{n}}_{{\varvec{a}}} = \cup {\mathbf{n}}_{{\varvec{a}}} = {\varvec{a}}\), so that ∪ { , , , } = = .

Each element of a natural decomposition is singleton shape, so its minimum space is a diagonal one. Two shapes belonging to the same algebra may have natural decompositions such that an element of one decomposition shares diagonal space with an element belonging to the different one. There could be several such elements. If the two shapes are arguments of some calculation, then calculations with elements sharing the same diagonal space could take place in a related diagonal algebra. This opens interesting possibilities, however, not without a problem. There is no guarantee for the two elements of the same natural decomposition to be in the different diagonal spaces. Fortunately, there is another discrete decomposition related to the natural one, which overcomes this problem.

The diagonal decomposition of a shape is a discrete decomposition in which each element is a diagonal shape and no two elements share the same diagonal space. The decomposition above is both natural and diagonal. In contrast, has decompositions { , , , , } and { , , , }Footnote 11 as natural and diagonal, respectively. Note that the last two shapes in the natural decomposition share the same diagonal space so they are replaced with their sum in the diagonal one. Going the other way, each non singleton shape of a diagonal decomposition should be replaced with its natural decomposition to get the natural decomposition of the original shape. Like natural decompositions diagonal ones are unique. Let \({\mathbf{n}}_{{\varvec{a}}}\) and \({\mathbf{d}}_{{\varvec{a}}}\) be the respective natural and diagonal decompositions of shape a, then \({\mathbf{n}}_{{\varvec{a}}} \le {\mathbf{d}}_{{\varvec{a}}}\) and \(card\left( {{\mathbf{d}}_{{\varvec{a}}} } \right) \le card\left( {{\mathbf{n}}_{{\varvec{a}}} } \right)\).Footnote 12 The same property of natural decompositions holds with the diagonal ones: \(\Sigma {\mathbf{d}}_{{\varvec{a}}} = \cup {\mathbf{d}}_{{\varvec{a}}} = {\varvec{a}}\).

Each element \({\varvec{x}} \in {\mathbf{d}}_{{\varvec{a}}}\) is a diagonal shape occupying a diagonal space. Let another element \({\varvec{y}} \in {\mathbf{d}}_{{\varvec{b}}}\), where \({\mathbf{d}}_{{\varvec{b}}}\) is the diagonal decomposition of shape \({\varvec{b}} \in {\varvec{U}}_{{{\varvec{ij}}}}\), share the diagonal space with x. To calculate say \({\varvec{a}} + {\varvec{b}}\) the partial calculation \({\varvec{x}} + {\varvec{y}}\) may take place instead of in \({\varvec{U}}_{{{\varvec{ij}}}}\) in an appropriate diagonal algebra \({\varvec{U}}_{{{\varvec{ii}}}}\) related to the diagonal space of x and y. Different such pairs of elements could be summed in different diagonal algebras and the union of the results will be \({\varvec{a}} + {\varvec{b}}\). Elements of one decomposition with no corresponding elements in another one are paired with appropriate empty shapes. The other operations of \({\varvec{U}}_{{{\varvec{ij}}}}\) could be calculated in the same fashion. In this approach algebra \({\varvec{U}}_{{{\varvec{ij}}}}\) is de facto decomposed into a set of different diagonal algebras \({\varvec{U}}_{{{\varvec{ii}}}}\) each of which is tasked with a partial calculation. The union of the partial results is the final one. Each diagonal decomposition of a shape induces the diagonal decomposition of algebra \({\varvec{U}}_{{{\varvec{ij}}}}\) into a set of diagonal algebras \({\varvec{U}}_{{{\varvec{ii}}}}\).

The table below shows calculation = defined in U12 as done in 6 diagonal algebras of a diagonal decomposition of U12.

figure dn

Arguments of the calculation, shapes and , as well as their diagonal decompositions are shown in rows 3 and 4 of the table, respectively. Each shape’s diagonal decomposition spans 4 diagonal algebras and both decompositions span 6 algebras. The result of the calculation appears in the bottom row together with its decomposition which has nonzero elements in all 6 diagonal algebras. Diagonal decompositions of algebra U12 induced by the diagonal decompositions of shapes and are \(\left\{ {\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{1} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{2} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{3} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{4} } \right\}\) and \(\left\{ {\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{2} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{4} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{5} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{6} } \right\}\), respectively. Calculations in \(\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{2} \,{\text{and}}\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{4}\) where decompositions of both argument shapes have nonzero elements are spatial resulting in new shapes. The calculations in the rest of the algebras were nonspatial just showing the nonzero element as the result.

Note that the decomposition of shape is also diagonal and so is the decomposition of U12 related to this shape \(\left\{ {\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{1} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{2} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{3} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{4} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{5} ,\,\left( {{\varvec{U}}_{{{\mathbf{11}}}} } \right)_{6} } \right\}\).

Because diagonal decompositions are unique, we may introduce an operator \(d:U_{ij} \to \wp \left( {U_{ij} } \right)\) that takes a shape to its diagonal decomposition, or \(d\left( {\varvec{a}} \right) = {\mathbf{d}}_{{\varvec{a}}}\). The calculation above exposed an interesting property of diagonal decompositions, \(d\left( {{\varvec{a}} + {\varvec{b}}} \right) = d\left( {\varvec{a}} \right) + d\left( {\varvec{b}} \right)\). This remains true for other Boolean operators (·, −, \(\oplus\)), which gives a rise to an algebra of diagonal decompositions.

3.4 Algebras of Diagonal Decompositions

Given the uniqueness of diagonal decompositions—i.e. their 1-1 relation to shapes–as well as the expressions like the one above, an algebra of diagonal decompositions should be isomorphic to an appropriate algebra of shapes. This is expressed with commutative diagram , where \({\varvec{X}}_{{{\varvec{ij}}}}\) is an algebra of diagonal decompositions of shapes from \({\varvec{U}}_{{{\varvec{ij}}}}\).

The table above may provide some guidance on how to do Boolean operations in Xij.

Let two shapes a and b defined in \({\varvec{U}}_{{{\varvec{ij}}}}\) be arguments of calculation \({\varvec{a}}*{\varvec{b}} = {\varvec{c}}\), where * stands for ·, +, −, or \(\oplus\). To do the calculation with diagonal decompositions in place of shapes we may use the following procedure:

  1. 1.

    Define diagonal decompositions of \({\varvec{U}}_{{{\varvec{ij}}}}\) implied by d(a) and d(b), i.e. \(A = \{ {\varvec{U}}_{{{\varvec{ii}}}} |{\varvec{x}} \in d\left( {\varvec{a}} \right),{\varvec{x}} \in {\varvec{U}}_{{{\varvec{ii}}}} \}\) and \(B = \{ {\varvec{U}}_{{{\varvec{ii}}}} |{\varvec{x}} \in d\left( {\varvec{b}} \right),{\varvec{x}} \in {\varvec{U}}_{{{\varvec{ii}}}} \}\).

  2. 2.

    Calculate sets of diagonal algebras which are in B but not in A or in A but not in B, i.e. \(A^{^{\prime}} = B\backslash A\) and \(B^{^{\prime}} = A\backslash B\).

  3. 3.

    Augment decompositions d(a) and d(b) with empty shapes of algebras from sets \(A^{^{\prime}}\) and \(B^{^{\prime}}\), i.e. \(d\left( {\varvec{a}} \right)^{^{\prime}} = d\left( {\varvec{a}} \right) \cup \{ 0 \in {\varvec{U}}_{{{\varvec{ii}}}} |{\varvec{U}}_{{{\varvec{ii}}}} \in A^{^{\prime}} \}\) and \(d\left( {\varvec{b}} \right)^{^{\prime}} = d\left( {\varvec{b}} \right) \cup \{ 0 \in {\varvec{U}}_{{{\varvec{ii}}}} |{\varvec{U}}_{{{\varvec{ii}}}} \in B^{^{\prime}} \}\) so that \(card\left( {d\left( {\varvec{a}} \right)^{^{\prime}} } \right) = card\left( {d\left( {\varvec{b}} \right)^{^{\prime}} } \right)\).

  4. 4.

    Calculate \(d\left( {\varvec{c}} \right)^{^{\prime}} = \{ {\varvec{x}}* {\varvec{y}}|{\varvec{x}} \in d\left( a \right)^{^{\prime}} ,{\varvec{y}} \in d\left( b \right)^{^{\prime}} ,{\varvec{x}},{\varvec{y}} \in {\varvec{U}}_{{{\varvec{ii}}}} ,{\varvec{U}}_{{{\varvec{ii}}}} \in A \cup B\}\).

  5. 5.

    Finally calculate \(d\left( c \right) = \{ x \in d\left( c \right)^{^{\prime}} |x \ne 0\}\).

Because an \({\varvec{U}}_{{{\varvec{ij}}}}\) algebra includes transformations one would expect that a related algebra of diagonal decompositions includes them as well. However, it only handles the Boolean part while leaving the transformations to \({\varvec{U}}_{{{\varvec{ij}}}}\). It is possible to include transformations in the algebra of diagonal decompositions, but that is beyond the scope of this work.Footnote 13

Diagonal decompositions and their algebras may be good candidates for storing shapes and calculating with shapes in computer applications. They simplify spatial calculations with shapes by breaking them down into simpler calculations with parts of the shapes. The latter calculations may then be done in parallel. A diagonal decomposition could easily be turned into the related natural decomposition which is a version of the maximal representations of a shape. The latter is instrumental in determining the partial order among shapes.

3.5 Calculating with Shapes and their Boundaries

Proposition 3—i.e. \(b({\varvec{a}} \oplus {\varvec{b}}) = b\left( {\varvec{a}} \right) \oplus b\left( {\varvec{b}} \right)\) where \({\varvec{a}},\,{\varvec{b}} \in {\varvec{U}}_{{{\varvec{ii}}}}\) and \(b\left( {\varvec{a}} \right),b\left( {\varvec{b}} \right) \in {\varvec{U}}_{{{\varvec{i}} - 1{\varvec{i}}}}\)–opens possibility for calculating with both shapes and their boundaries in parallel. This could be done in the framework of direct product algebra \({\varvec{U}}_{{{\varvec{ii}}}} \times {\varvec{U}}_{{{\varvec{i}} - 1{\varvec{i}}}}\), however, some smaller algebras may provide a better fit. First, both shapes and their boundaries should be transformed in the same way so that \(\left( {{\varvec{t}},\,{\varvec{t}}} \right)\) are the only ordered pairs of transformations allowed. Second, not all the shapes from \({\varvec{U}}_{{{\varvec{i}} - 1{\varvec{i}}}}\) are boundaries of the shapes from \({\varvec{U}}_{{{\varvec{ii}}}}\). A line in U12 is not the boundary of any plane in U22. Consequently, the set of boundaries of shapes from \({\varvec{U}}_{{{\varvec{ii}}}}\) is a proper subset of \(U_{i - 1i}\) or \(b\left( {U_{ii} } \right) \subset U_{i - 1i}\). According to proposition 3 set \(b\left( {U_{ii} } \right)\) is closed under symmetric difference and could be elevated to an algebra \({\varvec{B}}_{{\varvec{i}}}\) of boundaries of shapes from \({\varvec{U}}_{{{\varvec{ii}}}}\). Now a subdirect product \({\varvec{UB}}_{{\varvec{i}}} \subset {\varvec{U}}_{{{\varvec{ii}}}} \times {\varvec{B}}_{{\varvec{i}}}\) operating on compound shapes where shapes from \({\varvec{U}}_{{{\varvec{ii}}}}\) are matched with their boundaries from \({\varvec{B}}_{{\varvec{i}}}\), or \({\varvec{UB}}_{{\varvec{i}}} = \{ \left( {{\varvec{x}}, \,{\varvec{b}}\left( {\varvec{x}} \right)} \right)|{\varvec{x}} \in {\varvec{U}}_{{{\varvec{ii}}}} ,\,b\left( {\varvec{x}} \right) \in {\varvec{B}}_{{\varvec{i}}} \}\), i = 1, 2 or 3, provides an economical framework for parallel calculations with shapes and their boundaries. For example, calculation = , carried on in UB2 accounts for both planar shapes and their linear boundaries. The new algebra is weaker than the standard algebras of shapes. It has only one operation—symmetric difference—and works with only one kind of shapes–diagonal shapes. Symmetric difference is not that limited as it may act as sum or as difference depending on the context. For example, \({\varvec{a}} \oplus {\varvec{b}} = {\varvec{a}} + {\varvec{b}}\) if \({\varvec{a}} \cdot {\varvec{b}} = 0,\,{\varvec{a}} \oplus {\varvec{b}} = {\varvec{a}} - {\varvec{b}}\) if \({\varvec{a}} \le {\varvec{b}}\), and \({\varvec{a}} \oplus {\varvec{b}} = {\varvec{b}} - {\varvec{a}}\) if \({\varvec{b}} \le {\varvec{a}}\). Calculations defining a shape grammar rule application–which are carried out in the framework of an algebra of shapes– depend on both sum and difference. Certain types of grammars like subtractive and collision-protecting ones provide the right context for symmetric difference to play both roles. Algebras \({\varvec{UB}}_{{\varvec{i}}}\) are therefore the right framework for such grammars to simultaneously generate shapes and their boundaries.

Alleviating the other limitation of \({\varvec{UB}}_{{\varvec{i}}}\)—i.e. the restriction to diagonal shapes—may be achieved via diagonal decompositions. Unlike \(B_{i}\) set \(B_{ij} \subset U_{i - 1j}\) of boundaries of shapes from \({\varvec{U}}_{{{\varvec{ij}}}}\) cannot be elevated to an algebra. Instead we approximate shapes from \({\varvec{U}}_{{{\varvec{ij}}}}\) with their boundary paired or b-paired diagonal decompositions in which every element of a diagonal decomposition is paired with its boundary. Because both the diagonal decomposition and boundary are unique for a shape so is its b-paired diagonal decomposition. Thus, we may introduce operator d’: Uij → ℘(Uij × Ui-1j) which takes a shape from \({\varvec{U}}_{{{\varvec{ij}}}}\) to its b-paired diagonal decomposition. Operator d’ is defined as \(d^{^{\prime}} \left( {\varvec{a}} \right) = \{ \left( {{\varvec{x}}, b\left( {\varvec{x}} \right)} \right)|{\varvec{x}} \in d\left( {\varvec{a}} \right)\} ,\,{\varvec{x}} \in {\varvec{U}}_{{{\varvec{ij}}}}\). To go the other way, from b-paired diagonal decompositions to shapes and their boundaries, we make use of projection operators \(pr_{u} \left( {d^{\prime}\left( {\varvec{a}} \right)} \right) = \{ {\varvec{x}}|\left( {{\varvec{x}},\,{\varvec{y}}} \right) \in d^{\prime}\left( {\varvec{a}} \right)\}\) and \(pr_{b} \left( {d^{\prime}\left( {\varvec{a}} \right)} \right) = \{ {\varvec{y}}|\left( {{\varvec{x}},\,{\varvec{y}}} \right) \in d^{\prime}\left( {\varvec{a}} \right)\}\) so that \({\varvec{a}} = \cup \left[ {pr_{u} \left( {d^{^{\prime}} \left( {\varvec{a}} \right)} \right)} \right]\) and \(b\left( {\varvec{a}} \right) =\Sigma \left[ {pr_{b} \left( {d^{\prime}\left( {\varvec{a}} \right)} \right)} \right]\), where \({\varvec{a}} \in {\varvec{U}}_{{{\varvec{ij}}}}\) and \(b\left( {\varvec{a}} \right) \in {\varvec{U}}_{{{\varvec{i}} - 1{\varvec{j}}}}\). Like diagonal decompositions the b-paired ones form an algebra \({\varvec{X}}^{^{\prime}}_{{{\varvec{ij}}}}\), however, this one has only one operation: symmetric difference \(\oplus\). Like algebra for diagonal decompositions, \({\varvec{X}}^{^{\prime}}_{{{\varvec{ij}}}}\) handles only the Boolean part while leaving the transformations to \({\varvec{U}}_{{{\varvec{ij}}}}\).

Proposition 4: Let \(d^{^{\prime}} \left( {\varvec{a}} \right)\) and \(d^{^{\prime}} \left( {\varvec{b}} \right)\) be b-paired diagonal decompositions of shapes \({\varvec{a}},\,{\varvec{b}} \in {\varvec{U}}_{{{\varvec{ij}}}}\). The following holds:

  1. (1)

    Each element \(\left( {{\varvec{x}}, b\left( {\varvec{x}} \right)} \right) \in d^{^{\prime}} \left( {\varvec{a}} \right)\) is an element of some \({\varvec{UB}}_{{\varvec{i}}}\) algebra.

  2. (2)

    B-paired diagonal decompositions are closed under symmetric difference, or \(d^{^{\prime}} ({\varvec{a}} \oplus {\varvec{b}}) = d^{^{\prime}} \left( {\varvec{a}} \right) \oplus d^{^{\prime}} \left( {\varvec{b}} \right)\), and form algebra \({\varvec{X}}^{^{\prime}}_{{{\varvec{ij}}}}\).Footnote 14

It follows from (1) that \(d^{^{\prime}} \left( {\varvec{a}} \right)\) implicitly defines a set A of \({\varvec{UB}}_{{\varvec{i}}}\) algebras to which its elements belong, or \(A = \{ {\varvec{UB}}_{{\varvec{i}}} |{\varvec{x}} \in {\varvec{d}}^{^{\prime}} \left( {\varvec{a}} \right),\,{\varvec{x}} \in {\varvec{UB}}_{{\varvec{i}}} \}\). Consequently, calculation \(d^{^{\prime}} \left( {\varvec{c}} \right) = d^{^{\prime}} \left( {\varvec{a}} \right) \oplus d^{^{\prime}} \left( {\varvec{b}} \right)\) can be compartmentalized and carried on in parallel via a procedure not unlike the one for diagonal decompositions:

  1. 1.

    Define sets A and B of \({\varvec{UB}}_{{\varvec{i}}}\) algebras to which elements of \(d^{^{\prime}} \left( {\varvec{a}} \right)\) and \(d^{^{\prime}} \left( {\varvec{b}} \right)\) respectively belong, as well as their relative complements \(A^{^{\prime}} = B\backslash A\) and \(B^{^{\prime}} = A\backslash B\).

  2. 2.

    Augment decompositions \(d^{^{\prime}} \left( {\varvec{a}} \right)\) and \(d^{^{\prime}} \left( {\varvec{b}} \right)\) with empty shapes of algebras from sets \(A^{^{\prime}}\) and \(B^{^{\prime}}\), i.e. \(d^{^{\prime}} \left( {\varvec{a}} \right)^{^{\prime}} = d^{^{\prime}} \left( {\varvec{a}} \right) \cup \{ \left( {0, \, 0} \right) \in {\varvec{UB}}_{i} |{\varvec{UB}}_{i} \in A^{^{\prime}} \}\) and \(d^{^{\prime}} \left( {\varvec{b}} \right)^{^{\prime}} = d^{^{\prime}} \left( {\varvec{b}} \right) \cup \{ \left( {0,\,0} \right) \in {\varvec{UB}}_{i} |{\varvec{UB}}_{i} \in B^{^{\prime}} \}\).

  3. 3.

    Calculate \(d^{^{\prime}} \left( c \right)^{^{\prime}} = \{ ({\varvec{x}} \oplus u,{\varvec{y}} \oplus v)|\left( {{\varvec{x}},\,{\varvec{y}}} \right) \in d^{^{\prime}} \left( a \right)^{^{\prime}} ,\,\left( {{\varvec{u}},{\varvec{v}}} \right) \in d^{^{\prime}} \left( b \right)^{^{\prime}} ,\,\left( {{\varvec{x}},\,{\varvec{y}}} \right),\,\left( {{\varvec{u}},{\varvec{v}}} \right) \in {\varvec{UB}}_{i} ,{\varvec{UB}}_{i} \in A \cup B\}\).

  4. 4.

    Finally calculate \({\varvec{d}}^{^{\prime}} \left( {\varvec{c}} \right) = \{ \left( {{\varvec{x}},{\varvec{y}}} \right) \in {\varvec{d}}^{^{\prime}} \left( {\varvec{c}} \right)^{^{\prime}} |{\varvec{x}} \ne 0,\,{\varvec{y}} \ne 0\}\).

The table below shows how calculation = carried on in U23–where a combination of a “smaller-than” and “greater-than” shapes produces an “X” shape–looks when done with b-paired diagonal decompositions in place of the shapes.

figure dz

Argument shapes, their boundaries, and their b-paired diagonal decompositions are in the third and fourth rows of the table while resulting shape, its boundary, and its b-paired diagonal decomposition occupy the fifth row.

The resulting “X” shape is obtained from its decomposition via nonspatial calculation = . In contrast, spatial calculation + = produces the boundary of “X”. Note that the original calculation carried on in an U13 with the boundaries of shapes, i.e. = , results in an incomplete boundary of “X”.

4 Background and Conclusion

Through the paper we dealt with mathematics arising in the context of shape grammars theory. The latter started in the early nineteen seventies [1] with the introduction of shape grammars, as production systems capable of generating shapes, and evolved over the years into a formal design theory [2]. We focused on algebras of shapes [3, 4] in particular on their two-sorted version [5, 6]. In going from geometric elements and their partial algebras to shapes and their algebras we followed [5] while introducing some improvements along the way–like the two procedures for shape operations + and – based on partial operations for geometric elements.

In accordance with the title of the paper we examined spatial and nonspatial calculations with shapes with an eye towards separating them. However, only geometric elements are combined in the purely spatial fashion. The closest the shapes get to this is when they belong to diagonal algebras. Diagonal decompositions are introduced to partition shapes so that each element of a decomposition belongs to a different diagonal algebra. This way all spatial calculations take place in diagonal algebras and may be done in parallel. The latter is an important feature for computer applications. The resulting diagonal decompositions are turned into shapes via simple nonspatial operations.

Boundaries of shapes [7] are investigated and proposition 3, originally from [7], got a formal proof.Footnote 15 Calculating with boundaries of shapes in place of shapes or in parallel with shapes which was restricted to diagonal shapes only [8] is extended to (all) shapes. This required the introduction of b-paired diagonal decompositions of shapes and their algebras. George Stiny does similar calculations with shape boundaries [2, pp 202–4] by partitioning shapes via coembeddedness equivalence relation into parts for which proposition 3 holds. He also notes there that such partitioning “is a nice way to store maximal elements in a computer”. Because only one operation is available when calculating with shape boundaries, special kinds of shape grammars are needed. Two such grammars were mentioned here, and more are given in [8] and [9].

Throughout the paper we used flat loci shapes stipulating no loss of generality under assumption that moving to the curved shapes is a straightforward exercise. Whether this is right may be assessed from [10] where calculating with curvilinear shapes is examined in detail.