1 Introduction and motivation

Heterogeneous objects are composed of different materials whose proportion throughout the solid is variable. These objects benefit from the best features due to the mix of materials they are made from. The mixture of materials that compose heterogeneous solids, is called heterogeneous material or functionally graded material. Heterogeneous materials are used to manufacture many types of real objects, e.g., medical implants, engine parts or competition tires.

Designing heterogeneous objects is not an easy task. It is necessary to have a computer application, based on a well stated framework, to address all the complex aspects of the design process.

In this paper, we describe a comprehensive framework that allows representing heterogeneous objects in a simple and efficient way. The framework is based on Béziér hyperpatches, further developed and extended to solve the main problems of this well-known formulation. A hyperpatch is a continuous, three-parameter, single-valued function that defines the coordinates of the set of points comprising the object exterior as well as its interior. The shape of the object is defined by geometric coefficients also called control points.

Our framework is able to maintain continuity between parametric cells, and also allows representing discontinuities if necessary, both in the geometry and the gradation of the used materials. It also keeps the validity of the represented object.

We also developed a simplified mesh of geometric coefficients, that allows a human operator to stay focused on the main structure of the object and adjust the fine details in a very simple and intuitive manner. The editing is performed by moving geometric coefficients in a process assisted by the framework, allowing to automatically maintain first-order continuity in those regions that need it. It is also possible to interactively create new object models with the aid of techniques such as extrusion, sweeping, or revolution of existing cells.

All this is done while keeping a relatively low number of parametric cells, which simplifies its recording, processing, and transmission through a network.

We developed a computer application to test whether the framework can accurately represent real objects (see Fig. 1). Using our application, we modeled a real motorcycle tire from scratch, following precisely the blueprints included in the patent [11]. The whole process only took 6 h.

Fig. 1
figure 1

Real heterogeneous motorcycle tire precisely modeled with our computer application

The remainder of this paper is organized as follows. In Sect. 2, some of the research works already carried out in this field are briefly described. Our comprehensive framework is described in Sect. 3; Sect. 3.1 defines precisely what a heterogeneous object is and a valid material distribution, Sect. 3.2 describes heterogeneous regular objects (hr-objects) which are the mathematical model inside our framework, Sect. 3.3 describes heterogeneous composite Béziér hyperpatches that are the computational representation we use, and Sects. 3.4 and 3.5 describe how our framework keeps two fundamental properties: validity and continuity. Next, in Sect. 4 we explain how heterogeneous objects can be edited, both in geometry and material distributions, in a flexible and simple way, using our framework. In Sect. 5 we describe some of the operations that our framework provides to construct models of heterogeneous objects from scratch. In Sect. 6 several examples of real objects modeled with a computer application using our framework are shown. And finally, the conclusions of this work are summarized in Sect. 7.

2 Related work

A precise characterization of a heterogeneous object is presented in [7] by Kumar and Dutta. The mathematical model for heterogeneous objects (\(r_{m}\)-set / \(r_{m}\)-object) proposed by the authors captures very well the essence of this type of objects, so it is quite an appropriate mathematical model for computational representations of heterogeneous objects. The authors also presented a computational representation by means of non-manifold B-reps based on \(r_{m}\)-objects.

Traditional solid modeling methods, like boundary representation (B-rep), constructive solid geometry (CSG), or enumeration, are not the most suitable for heterogeneous objects. This is due to the fact that they either do not allow representing the inside of the object, or use very simple functions for precisely modeling the interior.

Research on the use of hyperpatches as a tool for modeling heterogeneous objects [1] started during the 1980s. Hyperpatches have an extraordinary capacity to precisely represent each point inside the object by allowing to designate the desired material to every point. However, there is a high degree of freedom in the mathematical tool, which needs to be refined so it can be a useful tool.

Several attempts have been made to refine hyperpatches:

Schmitt, Pasko and Schlick [14] suggested a method to model heterogeneous objects that uses FRep as the basic model combined with trivariate B-Splines primitives by means of CSG operations. This method can be very useful for rapid prototyping or virtual sculpting.

Qian and Dutta [12] suggested using B-Spline hyperpatches to represent heterogeneous objects. They focused on making it easy for the user to assign the materials to each point of the object considering the desired properties for that specific point. For this task, the authors defined a diffusion process.

In [5], and later in [3] and [4], a model based on trivariate simplex splines was presented. This model is useful when constructing a representation of a heterogeneous object using a triangle mesh as the starting point. It allows obtaining very accurate tetrahedral spline decompositions. Variable continuity is defined between 0 and \(C^{n-1}\), being n the degree of the splines. The generated simplex B-Spline mesh is huge, even for objects with relatively simple geometries, because the models have been constructed from triangulations. The editing, as with any hyperpatch, is done by moving the control points.

Yang and Qian [16] describe a method for constructing complex geometries with B-Spline hyperpatches defined from curves using a lofting process. For certain problems, this method can be a good approach.

Warkhedkar and Bhatt [15] used regular B-Spline hyperpatches to accommodate the slices from a CT scan and adjust the distribution values in the vertices of the B-Spline control mesh to represent the human body. The visualization is done using classical techniques, such as marching cubes.

In [6], the authors describe a method based on functionally graded material (FGM), very adequate for rapid prototyping, for which it is not necessary to precisely model very complex geometries.

These current methods have certain weaknesses, such as:

  • The classical formulation of hyperpatches produces completely continuous models or with no continuity at all. Mixed continuity is not allowed in classic hyperpatches. For example: Cubic B-Spline hyperpatches have coefficients that are aligned in regular grids and produce \(C^{2}\) continuous objects. They cannot model discontinuities, both in geometry or in distribution of materials, between adjacent cells. Knot insertion and other techniques try to solve this problem but make the editing process intricate.

  • Hyperpatches per se do not address the problem of validity (the hyperpatch function per se is not injective), which is a very important property in a object modeling framework, because it prevents the modeling of nonsense objects.

  • The natural way to edit a hyperpatch is by moving its geometric coefficients, however if these coefficients are treated independently, without the aid of the framework to perceive and maintain the existing relations among them, the editing is very unintuitive and difficult for modeling new objects.

  • Other current methods like CSG or B-rep do not allow a precise representation of both the inside of the object and its boundary.

  • Despite its ability to make rapid prototypes, methods based on CSG are not well suited to modeling complex geometries that cannot be obtained by boolean operations.

  • Compact computational representations are preferable since they produce a finite set of symbols that facilitate its processing, storage and transmission.

3 Our framework

Traditionally, to describe a new framework for modeling objects, a three-level approach has been used [9, 13]:

  • Physical objects They are the objects that need to be studied or manipulated. They may or may not exist.

  • Mathematical models Physical objects cannot be modeled in a computer, so it is necessary to adopt an adequate idealization thereof. These idealized objects must have a clear and intuitive connection with physical objects, and at the same time, be simple enough so that they can be represented in a discrete and limited computer.

  • Computational representations The final step in the modeling activity is to assign to the mathematical model a representation that can be suitable for its use in a computer.

We use this approach, so in the next three sections we explain each of these levels.

3.1 Material distribution

In this section, we characterize the physical objects we are trying to model.

Kumar and Dutta present in [7] a great mathematical characterization of heterogeneous objects. We use its characterization with slight variations.

Heterogeneous objects are composed of different constituent materials (also known as primary materials), which are present in varying proportions throughout the object. It is assumed that the number of primary materials n is finite. The material at a point \(\mathbf {p}\) in a object \(\mathbf {S}\) is a combination (mixture) of the n primary materials specified by the volume fractions of these materials. Thus, the \(\mathbf {\mathbb {R}}^n\) set, with a vectorial space structure, is a mathematical space that defines the material distribution, each dimension representing a specific primary material.

Let \(\mathbf {M}=\{m_1,m_2,\ldots ,m_n\}\) be a set of primary materials, where each material \(m_{i}\) is a literal (the name of that material). Let \(n=\mathbf {|M|}\) be the cardinality of the set \(\mathbf {M}\). The material distribution of any given point \(\mathbf {p}\) of a heterogeneous object is represented by a tuple \({\mathbf {a}=(a_1,a_2,\ldots ,a_n) \in \mathbf {\mathbb {R}}^n}\), where each element \(a_{i}\) of the material distribution is the fraction of the volume occupied by the ith material at that point.

The volume fractions of each primary material must add up to 1, otherwise the objects in the real world are senseless. In other words, not all possible material distributions \(\mathbf {a} \in \mathbf {\mathbb {R}}^n\) are appropriate. The valid space of material distributions \(\mathbf {V}\) can be defined as:

$$\begin{aligned} \mathbf {V}= \left\{ \mathbf {a} \in \mathbf {\mathbb {R}}^n \;\; \left| \;\; \sum \limits _{i=1}^{n}{a_{i}=1}, \quad a_{i}\ge 0 \right\} \right. \end{aligned}$$
(1)

A material distribution \(\mathbf {a}\) is valid only if \(\mathbf {a} \in \mathbf {V} \subseteq \mathbf {\mathbb {R}}^n\); i.e., a material distribution is valid if its elements \(a_i\) are the coefficients of a convex combination of a set of primary materials \(\mathbf {M}\).

A combination operation is defined over the set \(\mathbf {V}\) of valid material distributions. Let \(\mathbf {a}, \mathbf {b} \in \mathbf {V}\) be two valid material distributions, then its combination is given by:

$$\begin{aligned} \mathbf {a} \oplus _{\alpha } \mathbf {b} = \alpha \cdot \mathbf {a} + (1-\alpha ) \cdot \mathbf {b}, \quad \alpha \in [0,1], \end{aligned}$$
(2)

where \(\alpha \) is an scalar that defines the contribution of each material distribution to the final result.

The operation of combination \(\oplus _{\alpha }\) is closed in \(\mathbf {V}\). We think this formulation of the combination operation \(\oplus _{\alpha }\) is more simple and straightforward than other proposed formulations.

3.2 Heterogeneous regular object

In this section we characterize the mathematical model we use in our framework.

The \(r_{m}\)-objects (made up by \(r_{m}\)-sets) proposed by Kumar and Dutta [7] are the appropriate mathematical idealization for heterogeneous objects. Here, we use \(r_{m}\)-objects as the mathematical model for a heterogeneous object, but with slight variations.

We force the material function to be piecewise continuous, in order to model discontinuities in the material distribution. This is a very important capability of our framework as it allows abrupt change of materials throughout the modeled object.

The mathematical model we suggest is the hr-object, based on the \(r_{m}\)-sets and the \(r_{m}\)-objects of Kumar and Dutta. Let \(\mathbf {M}\) be a set of primary materials, and let \(n=\mathbf {|M|}\) be the cardinality of the set \(\mathbf {M}\).

A heterogeneous regular object (hr-object) (see Fig. 2) is defined as a ternion, \(\mathbf {O}=\{\mathbf {S},\mathbf {V},F\}\), where:

  • \(\mathbf {S}\) is an r set. \(\mathbf {S} \subseteq \mathbf {\mathbb {R}}^3\) is a limited set with its boundary defined by rigid and regular algebraic functions.

    Fig. 2
    figure 2

    Structure of a hr-object

  • \(\mathbf {V} \subseteq \mathbf {\mathbb {R}}^n\) is the set of all valid material distributions.

  • F is the material function; it assigns a valid material distribution \(\mathbf {a}\) (see Eq. 1) to each point \(\mathbf {p}\) of the r set. The F function defines the way primary materials are distributed throughout the volume of the object.

Unlike other proposed models, the domain of our material function F is not \(\mathbb {E}^{3}\). This make it possible to apply deformations to the modeled heterogeneous objects without losing information on the material distributions.

F is a piecewise continuous function:

Let \(\{\mathbf {S}_{1},\mathbf {S}_{2},\ldots ,\mathbf {S}_{p}\} \subseteq \mathscr {P}(\mathbf {S})\) be a partition of \(\mathbf {S}\), i.e.:

\(\mathbf {S}_{i} \cap \mathbf {S}_{j} = \emptyset , \;\; i \ne j\)    and \({\bigcup \limits _{i=1}^{p}}{^*}\mathbf {S}_{i}=\mathbf {S}\).

$$\begin{aligned} F(\mathbf {p})=\left\{ \begin{array}{cl} F_{i} : \mathbf {S}_{i} \rightarrow \mathbf {V} &{} \\ F_{i}(\mathbf {p})=\mathbf {a}, &{}\ \quad \mathbf {p}\in \mathbf {S}_{i} \;\;\;\; 1 \le i \le p \end{array} \right. \end{aligned}$$
(3)

Each function \(F_{i}\) is continuous in the \(\mathbf {S}_{i}\) set in which it is defined. We name each of the subsets \(\mathbf {S}_{i}\) an hr-set (every volume in which the F function is continuous).

As can be seen in Eq. 3, the material function F defines the way the materials are distributed in the volume of the object. It assigns a valid distribution of materials to each point \(\mathbf {p}\) of the r set.

The material function F does not have to be continuous in the whole r set \(\mathbf {S}\). This allows modeling complex objects with discontinuities both in geometry and material distribution.

The external geometric boundary of the regular heterogeneous object \(\mathbf {O}\), \(b_\mathrm{ext}(\mathbf {O})\), is the boundary of the regularized union of the \(\mathbf {S}_{i}\) sets.

$$\begin{aligned} b_\mathrm{ext}(\mathbf {O})=b \left( \bigcup \limits _{i} {^*} \mathbf {S}_{i}\right) , \quad 1\le i \le p \end{aligned}$$

The points that do not belong to \(b_\mathrm{ext}(\mathbf {O})\), but belong to \(b(\mathbf {S}_i), 1\le i \le p\), that is, those points that are not in the boundary of the regular heterogeneous object but only in the boundary of some of the hr-sets that form it, are called internal boundary points.

$$\begin{aligned} b_\mathrm{int}(\mathbf {O})=b_\mathrm{ext} (\mathbf {O}) \Bigg \backslash \bigcup \limits _{i} b(\mathbf {S}_{i}), \quad 1\le i \le p \end{aligned}$$

Internal boundary points can be part of more than one hr-set. They are irregular points that may have two or more associated material distributions.

Let \({{\underline{\mathbf {p}}}} \in b_\mathrm{int}(\mathbf {O})\) be a point belonging to the internal boundary points of the hr-object \(\mathbf {O}\).

Let \(\mathbf {L}=\{l_{1},\ldots ,l_{m}\}\in \{1,\ldots ,p\}\), be the set formed by the indices of the hr-sets to which the point \({{\underline{\mathbf {p}}}}\) belongs: \({{\underline{\mathbf {p}}}} \in \bigcup \limits _{l_{i}}^{\mathbf {L}} b(\mathbf {S}_{l_{i}}) \subseteq {b_\mathrm{int}(\mathbf {O})}\), and let \(l_\mathrm{min}=\mathrm{min}(\mathbf {L})\)

We define the material function on this internal boundary point \(F({{\underline{\mathbf {p}}}})\) as:

$$\begin{aligned} F({{\underline{\mathbf {p}}}})=F_{l_\mathrm{min}}({{\underline{\mathbf {p}}}}) \end{aligned}$$

Thus the material function F is injective in these points, and therefore the hr-object is valid.

Note that \(\mathbf {M}\) is not part of the mathematical definition of heterogeneous regular object, because the only thing that matters is its cardinality \(n=|\mathbf {M}|\) (number of primary materials for a specific problem). Applications using hr-objects will assign the meaning of each material.

3.3 Heterogeneous composite Béziér hyperpatches

Finally, in this section, we characterize the computational representation we use in our framework.

Hyperpatches (also known as parametric objects or trivariate objects) are a mathematical tool that has been successfully used to represent objects [10]. They have a clear advantage over other classical tools, such as boundary representation (B-rep), constructive solid geometry (CSG), or decomposition models (exhaustive enumeration, octrees, etc.): they allow to accurately represent not only the boundary of the object, but also the interior. A hyperpatch is a set of points whose coordinates are the result of a vectorial, continuous, single-valued function:

$$\begin{aligned} \mathbf {B}(u,v,w)=(x(u,v,w),y(u,v,w),z(u,v,w)), \end{aligned}$$

where the parametric variables u, v, and w are usually limited to values within the closed interval [0, 1].

This vectorial function defines the coordinates of the set of points that make up the object. For every 3-tuple of values of the parametric variables (uvw), the \(\mathbf {B}\) function provides the coordinates of a point \(\mathbf {p}=(x,y,z) \in {\mathbb {R}}^3\) of the object. Thus, a hyperpatch is a parametric projection of a solid domain (a unit size cube) in the three-dimensional space. The domain of the projection is known as parametric space \(\mathbb {U}\), and the projection range is called modeling space \({\mathbb {R}}^3\).

The geometric form of the hyperpatch is:

$$\begin{aligned} \mathbf {p}(u,v,w)= & {} \sum \limits _{i=0}^{3}\sum \limits _{j=0}^{3}{\sum \limits _{k=0}^{3}{\mathbf {g}_{ijk}B_{i}^{3}(u)B_{j}^{3}(v)B_{k}^{3}(w)}}\\&\quad u,v,w \in [0,1], \end{aligned}$$

where \(\mathbf {g}_{ijk}=(x_{ijk},y_{ijk},z_{ijk})\) are the geometric coefficients that define the shape of the object and \(B^{3}\) are the cubic blending functions that combine these coefficients to obtain all the points of the object. The geometric coefficients are also known as control points. As can be seen, the shape of the object is directly linked to the geometric coefficients.

There are several types of blending functions that can be used to combine geometric coefficients. For this work, we have chosen cubic Béziér blending functions [8].

$$\begin{aligned} \begin{aligned} B_{0}^{3}(t)&= (1-t)^3&\qquad B_{1}^{3}(t)&= 3t (1-t)^2 \\ B_{2}^{3}(t)&= 3t^2 (1-t)&\qquad B_{3}^{3}(t)&= t^3 \end{aligned} \end{aligned}$$
(4)

In the tricubic case, \(4 \times 4 \times 4 = 64\) geometric coefficients are used to define a hyperpatch (as can be seen in Fig. 3). It is usually useful to think that these coefficients are organized in a three-dimensional array with indices i, j, and k varying from 0 to 3.

Fig. 3
figure 3

Three-dimensional array of \(4 \times 4 \times 4 = 64\) geometric coefficients with indices i, j, and k varying from 0 to 3

A set of boundary elements is associated to each tricubic Béziér hyperpatch, perfectly defining its boundary (see Fig. 4):

  • Six surfaces that are obtained by fixing the value of one of the parametric coordinates uvw, which takes the value 0 or 1, while the other two run freely along the [0, 1] interval. They are called isoparametric boundary surfaces. For example \(\mathbf {B}(0,v,w)\) or \(\mathbf {B}_{0vw}\).

    Fig. 4
    figure 4

    Boundary elements associated to a hyperpatch. From left to right corner points, boundary isoparametric curves and boundary isoparametric surfaces

  • Twelve curves obtained by fixing the value of two of the parametric coordinates uvw, which take the value 0 or 1, while the third runs freely along the [0, 1] interval. These are called isoparametric boundary curves.

  • Eight points obtained by fixing the value of the three parametric coordinates uvw, which take the value 0 or 1. These are called corner points.

The Béziér functions were chosen because:

  • They interpolate the eight corner points of a parametric Béziér hyperpatch, that is, the hyperpatch passes through these points.

  • The tangents to each corner point are defined by only its neighboring geometric coefficients (in the array of 64 coefficients). Thus, moving a control point close in the array to a corner point, have a clear effect on the shape of the hyperpatch around that corner point.

Béziér hyperpatches accurately model their interior. However, it is not possible to determine material distribution at every point; thus, it is necessary to define the heterogeneous Béziér hyperpatch as follows [1]:

$$\begin{aligned} \mathbf {B}_{m}= & {} \sum \limits _{i=0}^{3}\sum \limits _{j=0}^{3}{\sum \limits _{k=0}^{3}{\mathbf {h}_{ijk}B_{i}^{3}(u)B_{j}^{3}(v)B_{k}^{3}(w)}}\nonumber \\&\quad u,v,w \in [0,1], \end{aligned}$$
(5)

where \(\mathbf {h}_{ijk}=(\mathbf {p}_{ijk},\mathbf {a}_{ijk})\) are the heterogeneous geometric coefficients, which are pairs of values. The elements

$$\begin{aligned} {\mathbf {p}_{ijk}=(x_{ijk},y_{ijk},z_{ijk})} \in \mathbb {R}^{3} \end{aligned}$$

are the points that define the shape of the hyperpatch, and the elements

$$\begin{aligned} {\mathbf {a}_{ijk}} {=(a_{1_{ijk}},a_{2_{ijk}},\ldots ,} {a_{n_{ijk}})} { \in \mathbf {V}} \subseteq {\mathbb {R}^{n}} \end{aligned}$$

are the material distributions defining the gradation of the different materials throughout the hyperpatch.

Note that a heterogeneous Béziér hyperpatch \(\mathbf {B}_{m}\) is a set formed by two sets:

$$\begin{aligned} \mathbf {B}_{m}&= \{ \mathbf {P}_{m},\mathbf {A}_{m} \} \end{aligned}$$

The set \(\mathbf {P}_{m}\) defines the shape of the hyperpatch, and the set \(\mathbf {A}_{m}\) defines the gradation of the different materials throughout it (see Fig. 5).

$$\begin{aligned} \mathbf {P}_{m}&= \sum \limits _{i=0}^{3}{\sum \limits _{j=0}^{3}{\sum \limits _{k=0}^{3}{\mathbf {p}_{ijk}B_{i}^{3}(u)B_{j}^{3}(v)B_{k}^{3}(w)}} \quad u,v,w \in [0,1]} \\ \mathbf {A}_{m}&= \sum \limits _{i=0}^{3}{\sum \limits _{j=0}^{3}{\sum \limits _{k=0}^{3}{\mathbf {a}_{ijk}B_{i}^{3}(u)B_{j}^{3}(v)B_{k}^{3}(w)}} \quad u,v,w \in [0,1]} \end{aligned}$$

A heterogeneous composite Béziér hyperpatch, \(\mathbf {B}\), is a finite collection of heterogeneous Béziér hyperpatches.

$$\begin{aligned} \mathbf {B}=\left\{ \mathbf {B}_{1},\mathbf {B}_{2},\ldots ,\mathbf {B}_{m} \right\} , \end{aligned}$$

where \(\mathbf {B}_{i}=\{ \mathbf {P}_{i},\mathbf {A}_{i} \}\).

Fig. 5
figure 5

A heterogeneous Béziér hyperpatch \(\mathbf {B}_{m}\), is composed by a set \(\mathbf {P}_{m}\) of points that defines the geometry of the hyperpatch, and a set \(\mathbf {A}_{m}\) of material distributions that defines the gradation of materials throughout the hyperpatch

\(\forall \;\; \mathbf {P}_{i} \in \mathbf {B}_{i}, \mathbf {P}_{j} \in \mathbf {B}_{j} \;\; i \ne j, \;\; \mathbf {P}_{i} \cap ^*\mathbf {P}_{j} = \emptyset \). That is, the hyperpatches are pairwise disjoint, and at most, only share one, two or four corner points; one or four isoparametric boundary curves; and/or one isoparametric boundary surface.

A heterogeneous composite Béziér hyperpatch can be seen as a cell decomposition, in which each cell is a heterogeneous Béziér hyperpatch. From now on, we are going to use either parametric cell or hyperpatch to refer to the heterogeneous Béziér hyperpatches in this decomposition.

3.4 Validity

In any framework for object modeling, validity is a very important property [9, 13], as it ensures that meaningless models of objects cannot be obtained. Therefore, in this section we will study the validity of objects modeled by using our framework.

If additional conditions are not established, the classic hyperpatch formulation does not guarantee the validity of the objects represented. For that reason, in 2001, we developed a validity condition for b-spline hyperpatches that easily extends to the Béziér case [2]. Our validity condition works by checking relative positions of geometric coefficients in each parametric cell. Thus, after editing the solid by moving some geometric coefficients it is only necessary to check the validity in those parametric cells containing these coefficients. This process is very fast and can be done in real time.

Our condition of validity is sufficient but not necessary. This means that some parametric cells, that are in fact valid, are rejected. However, this is an advantage of our validity condition, since the points inside the rejected heterogeneous Béziér hyperpatches are not regularly distributed (see Fig. 6). Parametric cells with points regularly distributed inside them are preferable when modeling heterogeneous objects.

3.5 Continuity

There is zero-order continuity \(C^{0}\) between two parametric cells \(\mathbf {B}_{l}\) and \(\mathbf {B}_{m}\), if they share 16 boundary geometric coefficients. Let \(\mathbf {B}_{l}(1,v,w)=\mathbf {B}_{m}(0,v,w)\) be the shared surface, then the coefficients \(\mathbf {h}_{l_{3jk}} \in \mathbf {B}_{l}\) and \(\mathbf {h}_{m_{0jk}} \in \mathbf {B}_{m}\) have to be equal \(\forall j,k \in \{0,1,2,3\}\).

Note that the reasoning is the same in the case of shared surfaces with fixed values of v or w.

This zero-order continuity condition is too restrictive, so we developed a more flexible one. This is another contribution of our work. In our framework, zero-order continuity can be established for each of the four corner points of the shared surface independently (see Fig. 7).

Fig. 6
figure 6

This parametric cell is valid, however, our condition of validity rejects it. This is an advantage of our framework, because the points inside this cell are not regularly distributed (encircled points in blue). Parametric cells with regular distributions of points inside them are preferable when modeling heterogeneous objects

Fig. 7
figure 7

Zero-order continuity between two parametric cells can be established at corner point level. These two parametric cells share the corner points in dark blue and their immediate neighbors so they have \(C^{0}\) continuity in the left side. In the right side, each cell has different corner points and different neighbors, so they do not have \(C^{0}\) continuity

For a given corner point, only three geometric coefficients have effect in the shape of the boundary isoparametric surface around it. They are its immediate neighbors. So, to obtain zero-order continuity around a given corner point, both cells have to share it, and have to share its immediate neighboring geometric coefficients.

Let \(\mathbf {h}_{l_{3,3,3}}=\mathbf {h}_{m_{0,3,3}}\) be the shared corner point, then the neighbor geometric coefficients \(\mathbf {h}_{l_{3,3,2}}=\mathbf {h}_{m_{0,3,2}}\), \(\mathbf {h}_{l_{3,2,3}}=\mathbf {h}_{m_{0,2,3}}\) and \(\mathbf {h}_{l_{3,2,2}}=\mathbf {h}_{m_{0,2,2}}\) have to be equal in order to obtain zero-order continuity around that corner point (see Fig. 7).

Our condition is very flexible and allows to model complex shapes easily.

Notice that a heterogeneous geometric coefficient \(\mathbf {h}_{ijk}=(\mathbf {p}_{ijk},\mathbf {a}_{ijk})\) has two components: a position in three-dimensional space \(\mathbf {p}_{ijk} \in \mathbb {R}^{3}\) and a material distribution \(\mathbf {a}_{ijk} \in \mathbf {V} \subset \mathbb {R}^{n}\), so zero-order continuity \(C^{0}\) applies to both the geometry and the distribution of the materials.

Both components are independent, so it is possible to establish \(C^{0}\) continuity between two parametric cells for the geometry (the shape of the modeled object) but not for the material distribution.

We will study now first-order continuity \(C^{1}\). Let \(\mathbf {B}_{l}\) and \(\mathbf {B}_{m}\) be two parametric cells that share a boundary isoparametric surface. Let \(\mathbf {B}_{l}(1,v,w) = \mathbf {B}_{m}(0,v,w)\) be the points of the shared surface.

The heterogeneous Béziér hyperpatches have first-order continuity \(C^{1}\) in the shared surface if all the isoparametric curves with constant values of v and w passing through each point of the shared surface, have equal tangent vectors to these points on both cells.

$$\begin{aligned} \mathbf {B}_{l}^{u}(1,v,w) = \mathbf {B}_{m}^{u}(0,v,w) \quad \forall v,w \in [0,1] \end{aligned}$$
(6)

The tangents to these points depend on the 16 geometric coefficients that define the shared surface, and their immediate neighbors on each cell. So, in order to ensure \(C^{1}\) continuity, each group of three coefficients must form two vectors that must be equal.

Let \(\mathbf {h}_{*,j,k}\) be one geometric coefficient shared between \(\mathbf {B}_{l}\) and \(\mathbf {B}_{m}\). Let \(\mathbf {v}_{l} = \mathbf {h}_{*,j,k} - \mathbf {h}_{l_{3-1,j,k}}\) the vector formed by the shared coefficient and its immediate neighbor in \(\mathbf {B}_{l}\). And let \(\mathbf {v}_{m} = \mathbf {h}_{m_{0+1,j,k}} - \mathbf {h}_{*,j,k}\) the vector formed by the shared coefficient and its immediate neighbor in \(\mathbf {B}_{m}\). Then, there is \(C^{1}\) continuity between \(\mathbf {B}_{l}\) and \(\mathbf {B}_{m}\) in the shared surface, if (see Fig. 8):

$$\begin{aligned} \mathbf {v}_{l} = \mathbf {v}_{m}; \quad \!\! \mathbf {h}_{*,j,k} \!-\! \mathbf {h}_{l_{3-1,j,k}} = \mathbf {h}_{m_{0+1,j,k}} \!-\! \mathbf {h}_{*,j,k} \quad \! \forall j,k \!\in \! \{2,3\}\nonumber \\ \end{aligned}$$
(7)

Note that the reasoning is the same in the case of shared surfaces with fixed values of v or w.

Fig. 8
figure 8

The tangents to the points on the shared surface (light blue) are defined by the 16 geometric coefficients of the surface (dark blue) and their immediate neighbors (red) on each cell. In order to ensure \(C^{1}\) continuity, each group of three coefficients must form two vectors that must be equal. In our framework, \(C^{1}\) continuity can be established at corner point level, so the continuity condition of Eq. 8 can be set for each group of four shared coefficients independently (encircled points in blue)

Again, this first-order continuity condition is too restrictive, so we developed a more flexible one. In our framework, \(C^{1}\) continuity can be established for each corner point of the shared surface independently (see Fig. 8).

After editing an immediate neighbor \(\mathbf {h}_{l_{3-1,j,k}}\) of a shared geometric coefficient \(\mathbf {h}_{*,j,k}\) it is easy to calculate the position of the corresponding coefficient \(\mathbf {h}_{m_{0+1,j,k}}\) as:

$$\begin{aligned} \mathbf {h}_{m_{0+1,j,k}}=2 \mathbf {h}_{*,j,k} - \mathbf {h}_{l_{3-1,j,k}} \end{aligned}$$
(8)

Note that the reasoning is the same in the case of shared surfaces with fixed values of v or w.

A heterogeneous geometric coefficient \(\mathbf {h}_{ijk}=(\mathbf {p}_{ijk},\mathbf {a}_{ijk})\) has a position in three-dimensional space and a material distribution. Let us study first-order continuity in both cases separately.

The position of a heterogeneous geometric coefficient is a point in the three-dimensional space \(\mathbb {R}^{3}\), so the result of the operation \(2 \mathbf {p}_{*,j,k} - \mathbf {p}_{l_{3-1,j,k}}\) is always a valid point in \(\mathbb {R}^{3}\).

However, the same operation cannot be applied on the material distribution, as the material distribution of a heterogeneous geometric coefficient has to be a point in \(\mathbf {V} \subset \mathbb {R}^{n}\).

For example, if we use a set \(\mathbf {M} = \{m_{0},m_{1}\}\) of two primary materials, \(\mathbf {|M|} = 2\), only the points of \(\mathbb {R}^{2}\) that lie in the line segment with endpoints (1, 0) and (0, 1) represent valid material distributions.

Suppose \(\mathbf {a}_{l_{3-1,j,k}} = (0.5,0.5)\) and \(\mathbf {a}_{*,j,k} = (0.2,0.8)\), applying Eq. 8, \(\mathbf {a}_{m_{0+1,j,k}} = (-0.1,1.1)\) which is a not valid material distribution.

In order to maintain \(C^{1}\) continuity for material distributions automatically, we developed a \(C^{1}\) continuity condition for material distributions different to Eq. 7. Given the material distribution \(\mathbf {a}\) on a corner point shared by two parametric cells \(\mathbf {B}_{l}\) and \(\mathbf {B}_{m}\), we ensure \(C^{1}\) continuity in the distribution of materials around that corner point, by assigning the same material distribution \(\mathbf {a}\) to all the immediate neighboring coefficients in both cells (see Fig. 10).

As can be seen in Fig. 9 this continuity condition for the distribution of material allows us to model many interesting continuous transitions between two materials (for example, transitions with shape of cylinders or spheres). It is important to note that this is not a linear interpolation between the distributions of material in each of the eight corner points of each parametric cell, but a cubic interpolation.

Fig. 9
figure 9

Our first-order continuity condition for distribution of material allows to model many interesting continuous transitions between two materials, for example with shape of cylinders or spheres (left side). It is also possible to combine discontinuity and first-order continuity in the same shared surface between two cells (right side)

It is also possible to have \(C^{1}\) continuity between two cells in some corner points and discontinuity in other corner points shared by the same cells (see Figs. 9, 10).

Of course, if a greater degree of accuracy in the transition between a material and another one is required, continuity always can be adjusted manually.

We do not consider second-order continuity \(C^{2}\), because this type of continuity cannot be maintained locally, as it involves all geometric coefficients of both cells \(\mathbf {B}_{l}\) and \(\mathbf {B}_{m}\), and consequently all other adjacent cells. That means that, if we establish second-order continuity between two cubic parametric cells, all adjacent cells have to be also \(C^{2}\) continuous, and then it is not possible to model discontinuities in the object. This makes it poorly flexible for modeling complex objects. Furthermore, second-order continuity has moderate use. For example, most mechanical parts do not need it [10] (page 95).

Fig. 10
figure 10

Our framework maintains \(C^{1}\) continuity for material distributions between two cells in a given corner point (white point), by assigning the same material distribution to its immediate neighboring points (blue points)

However, it is possible to obtain second-order continuity between two adjacent cells if necessary by using our framework while maintaining flexibility, just by increasing the degree of the Béziér blending functions.

4 Editing objects

We have specifically designed this model to make the editing process of heterogeneous objects an easier task.

4.1 Editing geometry

Because the shape of an object is directly linked to its geometric coefficients, the natural way to edit a hyperpatch is by moving its geometric coefficients. This generates immediate results.

However, if the geometric coefficients are treated independently, without the framework aid to perceive and maintain the existing relations, the editing process becomes very confusing and difficult for a human operator.

Figure 11 shows that even in a very simple composite hyperpatch (only six parametric cells), the large number of coefficients makes knowing which points have to be edited to generate a certain effect difficult. We have developed a simplified mesh of geometric coefficients where only the boundary curves and the corner points are shown.

Fig. 11
figure 11

Even with a simple model, a classical mesh of geometric coefficients (center) makes it difficult to localize which points need editing to obtain the desired effect. The image on the right shows our simplified mesh, which greatly eases the task

In the Béziér case, corner points have maximum influence on the object because the blending functions interpolate them (the object passes through them); thus, they are the first level of interaction presented to the user.

When the user selects a corner point, the system shows a grid of immediate neighbors. Each corner point has seven contiguous coefficients in the \(4 \times 4 \times 4\) grid of geometric coefficients that defines a parametric cell. These seven coefficients are the immediate neighbors of the corner point (see Fig. 12). In general, each corner point is shared by eight adjacent parametric cells and therefore has 26 neighboring control points arranged in a \(3\times 3\times 3\) grid. This is the second level of interaction presented to the user.

When the user moves a corner point, our framework automatically applies the same movement to all the immediate neighbors, maintaining the continuity of the adjacent parametric cells on that corner point, as well as the general shape of the hyperpatch around it (see Fig. 14b).

Fig. 12
figure 12

(Left) each corner point has seven contiguous coefficients in the \(4 \times 4 \times 4\) grid of geometric coefficients that defines a parametric cell. (Right) in general, each corner point has 26 neighboring control points arranged in a \(3\times 3\times 3\) grid

The framework also allows moving the neighboring geometric coefficients of a selected corner point, for precise adjustments of the shape of the heterogeneous composite Béziér hyperpatch on that point. If the corner point is marked as continuous, when the user moves an immediate neighbor, the system automatically compensates the position of some of the others immediate neighbors by applying Eq. 8, thus maintaining \(C^{1}\) continuity. If the corner point is marked as non-continuous, when the user moves a neighbor, the system does not modify the neighboring geometric coefficients (see Fig. 14c, d).

Our framework is not limited to regular grids in which each corner point is shared by exactly eight parametric cells, so a given corner point can have an arbitrary number of immediate neighbors. In these irregular corner points it is not possible to maintain continuity automatically; this is an unsolved problem; however, our system can integrate these points, because certain types of discontinuity are very useful for modeling complex objects (see Figs. 13, 14).

4.2 Editing material distributions

When editing the distribution of materials inside a heterogeneous composite Béziér hyperpatch our framework shows the parametric cells that compose it, and the corner points.

If the user selects cells, the system allows to apply the same material distribution to all the 64 geometric coefficients of each cell. This is a uniform distribution of materials. It can be very useful to model those parts of the solid that are homogeneous.

Fig. 13
figure 13

Our framework is not limited to regular grids of coefficients. In this image we can see a real mechanical part modeled with our framework, with irregular corner points

If the user selects a corner point, the system allows to apply the same material distribution to the seven neighbor geometric coefficients of the corner point in each cell that share it. This is a \(C^{1}\) continuous gradation of materials (see Fig. 15).

If some cells have been selected and the user selects a corner point belonging to them, the system allows to apply the same material distribution to the neighboring geometric coefficients of the corner point but only in each selected cell. This is a \(C^{1}\) continuous gradation of materials among the selected cells and a non-continuous gradation of material among the non selected cells which also share the selected corner point (see Fig. 15).

Fig. 14
figure 14

Hyperpatch editing. From left to right: a before editing, b moving a corner point, c moving a neighboring point with continuity activated, d moving three neighboring points with no continuity activated. Note that in b and c the framework automatically moves the neighboring points accordingly to maintain \(C^1\) continuity

Fig. 15
figure 15

Editing material distributions. If the user selects a corner point shared among several cells (left), the framework can apply a given material distribution to all cells that share the corner point (center) or to some cells (right). It depends on whether or not there are selected some cell. Thus it is possible to establish non-continuous or \(C^{1}\) continuous gradations of materials among cells, if necessary

It is also possible to apply a different material distribution to each coefficient of a parametric cell manually. This way the user has a very precise control of the gradation of materials. However, this manual process is only necessary in a few cases.

In all cases the framework checks automatically the validity of the material distribution, ensuring that all the elements of the applied material distribution are the coefficients of a convex combination of the set of primary materials (see Eq. 1).

5 Creating new objects

A heterogeneous composite Béziér hyperpatch is constructed by adding parametric cells to it. This way of working simplifies the creation of new objects. When a user adds a new cell, our framework automatically performs the following tasks:

  • It checks whether the added parametric cell is injective (valid).

  • It checks that the new cell does not intersect any existing cell, or that both cells only share a corner point, a boundary isoparametric curve, or a boundary isoparametric surface.

  • If the new cell shares a boundary isoparametric surface with any other cell in the hyperpatch, our framework checks whether there is \(C^{1}\) continuity in each of the four shared corner points, and, it classifies each point as continuous or non-continuous.

Incorporating new cells can be done using several intuitive methods like:

  • Extrusion of existing cells (see Fig. 16).

    Fig. 16
    figure 16

    Extrusion along the normal of three parametric cells from one of their boundary isoparametric surfaces to generate a more complex geometry

  • Blending of two parametric cells. The new blended cell can be \(C^{1}\) continuous both for the geometry as for the distribution of materials if needed (see Fig. 17).

    Fig. 17
    figure 17

    Blending of two parametric cells. The blended cell is \(C^{1}\) continuous both for the geometry as for the distribution of materials

  • Revolution of a Béziér surface around an axis.

  • Lofting of a Béziér surface along a Béziér path.

  • Addition from a library of predefined cell structures (see Fig. 18).

    Fig. 18
    figure 18

    Creating a heterogeneous object in eight steps. From top to bottom, and from left to right: a adding two rings from a library of predefined cell structures; b and c extrusion of the rings to obtain a wider structure; d non-continuous blending of two groups of two cells to connect both rings; e subdivision of the two blended cells; f editing of the external cells of the rings in order to obtain a more rounded shape; g and h setting a \(C^{1}\) continuous gradation of materials among selected cells

  • Addition from a file containing a previously saved model. This allows to merge together several objects.

In all cases our framework ensures the validity of the generated heterogeneous composite Béziér hyperpatch. A new parametric cell is only added to the model if it is valid.

6 Examples

We developed a computer application to test whether the framework can accurately represent real objects. Using our application we have modeled several objects.

We modeled a mechanical part (see Figs. 19, 20) composed of four materials (light grey, dark grey, blue and red in the figure). In some zones of the object, the transition among the materials is a \(C^{1}\) continuous gradation. The number of parametric cells needed to accurately model the part is low (100 cells).

Fig. 19
figure 19

Example 1 Mechanical part modeled from scratch using the computer application based on our framework

Fig. 20
figure 20

Example 2 Heterogeneous motorcycle tire modeled following precisely the blueprints included in the patent [11]

The most interesting heterogeneous object we have modeled is a motorcycle tire (see Figs. 21, 22). We followed the exact blueprints of a patented tire [11]. The whole modeling process of the shown tire only took 6 h. The amount of cells needed only was 204.

Fig. 21
figure 21

Detailed view of the mechanical part showing its heterogeneous internal structure

Fig. 22
figure 22

Detailed view of the heterogeneous tire. The tread is composed by a continuous combination of three materials

An interesting feature of the framework is that the whole tire, including all its components (tread, body ply, belt, sidewall, etc.) is modeled as a single object, which is very convenient for simulations. This is possible due to the ability of the framework to model discontinuities in material distributions in the various parametric cells that make up the object.

7 Conclusions

In this work, we have presented a comprehensive framework that allows representing heterogeneous objects in a simple and efficient way. The framework is based on Béziér hyperpatches and solves the main problems of this well-known formulation.

Validity of the represented objects is kept automatically by checking relative positions of geometric coefficients in each parametric cell. Our validity condition not only rejects non-valid cells, it rejects also cells with interior points not well distributed. This is very useful when modeling heterogeneous objects.

In addition, we have presented a simplified mesh of geometric coefficients that allows a human operator to focus on the main structure of the object and adjust the fine details in a very simple and intuitive way. The editing is performed by movements of geometric coefficients in a process assisted by the system. The framework simplifies the editing process by automatically maintaining continuity (both in the geometry as in the distribution of materials) at the corner points that require it. Furthermore, our framework can also manage irregular non-continuous corner points, for modeling complex objects that require discontinuities.

The presented framework can also create new object models in an interactive manner with the aid of techniques such as extrusion, sweeping, or revolution of existing parametric cells while maintaining a relatively low number of parametric cells.

Finally, we have presented several complex objects shaped with a computer application using our framework. The application allows testing the ability of the model to accurately represent real objects.

7.1 Future work

Our framework can be extended to represent Porous materials as it is possible to use the emptiness as a primary material. This is perfectly coherent with the methods used for layered manufacturing (LM), in which a special material is used to fill in the empty spaces during the manufacturing process and later this special material is removed leaving a gap.

Modeling internal microstructures on several scale levels inside the object is also possible. Each parametric cell is the mapping of a unit cube into three-dimensional space, so we can define the microstructure in this unit size domain.