Modeling Techniques

This section covers the different techniques for manipulating a base model to obtain a complex structure. But first, we need to define the term Boolean mask.

Boolean Masks

A Boolean mask is an array of Boolean values (True/False) with the same shape as another array and is used for many operations in programming. For example, it can be used to select or highlight part of an image. In NumPy, a Boolean mask can be used for selecting some elements which can then be used for manipulating the array.

VCAMS offers a special function for applying a Boolean mask to a VoxelPart instance. The apply_mask() method takes a Boolean mask and a value parameter and, sets the elements selected by the mask to the value parameter.

It should be noted that applying a Boolean mask is not a one-time operation but can be done as many times as necessary. Fig. 9 shows an empty data array that has three Boolean masks applied to it in succession, finally resulting in the complex multi-material mesh shown previously in Fig. 8. This procedure is demonstrated in Example A-6

Illustration of three Boolean masks being combined to create a complex multi-material structure.

Fig. 9 Three Boolean masks being combined to create a complex multi-material structure.

Use of Boolean masks allows for creating highly complex structure. Refer to the Example Problems section for a large number of different use cases.

Model Manipulation

Upon creation, one material code is assigned to all elements in the model. Model Manipulation refers to the methods using which the part’s data array is changed to obtain the desired model. There are three methods for manipulating a model:

  • Manual changing of the values in the data array. This can be as simple as changing the value of individual elements, or as complex as the user desires. The data array is a NumPy array and any valid change that does not change its dtype is permitted. Realistically, this method has limited use because the other methods allow for modification is a larger scale. Examples A-3, A-4, and A-5 show this method in practice:

  • Use of a custom boolean mask for manipulating a model. This is a simple and effective method when the mask is created elsewhere and is demonstrated in Examples A-6 and A-7. This is the basis for the next two methods.

  • Using a boolean mask created from a level-set function. The level-set function is passed to the mask_from_function() function and must comply with its specifications. This method offers extreme control over the final structure and Examples C-1 and C-2 show this method in practice.

  • Use of a pre-defined boolean mask created using the facilities provided by the library. This method is identical to the previous method, and the only difference is that the mask is obtained from a predefined function or class that creates a common complex structure. The function and classes and their examples are covered in the Pre-Defined Structures section.