# Meshing Complex CAD Geometry Using Models and Quilts

We have a bone to pick with complex CAD geometry - it is a real challenge for mesh generation. If your experiences are like ours, you often import a CAD model only to be confronted by something like the surfaces illustrated in Figure 1.

The number and arrangement of surfaces for this bone have nothing to do with its geometry. Instead, they are simply an artifact of how the geometry was created, in this case from a 3D scan of the physical object. Furthermore, organic shapes like this lack feature lines that help constrain the mesh topology. All we want to do is generate a mesh that is independent of this rather arbitrary surface topology.

This is the problem that Pointwise's solid meshing feature suite is intended to solve - the highly automated generation of surface meshes that are independent of CAD topology. Instead of working with the complex surface topology in Figure 1, solid meshing automatically creates a model of your geometry during import so that it appears as a single entity like the one in Figure 2.

With your CAD model assembled as a single solid model, generating a surface mesh is as simple as setting your desired edge length and clicking the surface meshing button. The resulting CAD-independent surface mesh is shown in Figure 3.

Let's look behind the scenes to see how this all works.

## Surfaces, Trimmed Surfaces, and Models

Before proceeding, we need to define some terminology. Within Pointwise, we refer to the geometry on which the mesh is to be generated as the database. The database consists of many types of geometric and topological entities. The entities relevant to this discussion are surfaces, trimmed surfaces, and models and are illustrated in Figure 4.

A surface is relatively straight forward: it is 3D geometry that has a 2D parametric representation. Surfaces are created by well-defined procedures such as rotating a line around an axis, sweeping a line along a curve, or interpolating between two or more curves.

A trimmed surface is a topological entity built upon a surface. As the name implies, trimming involves cutting off portions of the surface such as slicing off a corner or cutting a hole in the middle.

A solid model is a topological entity consisting of trimmed surfaces that are knit together to enclose a volume. The implication of the term "solid" is that geometry has no holes or gaps and is watertight. As an analogy, you could fill the volume with water and none would leak out. Pointwise's implementation of solid models is actually a bit more flexible - models do not have to form a closed solid.

## Quilts and Trimmed Surfaces

The three entity types described above are well known in the world of CAD. A quilt on the other hand is a topological entity invented specifically for meshing. A quilt consists of several trimmed surfaces that are to be meshed with a single surface mesh.

Consider how a model is meshed. Because it is watertight, it solves the problems of gaps and overlaps that plague surface meshing of CAD geometry. When a model is meshed, all the resulting surface meshes connect precisely along all the edges so that you then can generate a volume mesh on the model's interior. However, there will be a one-to-one correspondence between the surface meshes and the model's trimmed surfaces. This is not always desirable (see Figure 1).

By assembling trimmed surfaces into quilts (each of which is meshed with a single surface grid), you get CAD-independent mesh topology, which is often most desirable.

A Rubik's Cube (Figure 5) helps clarify how quilts are used. If each of the nine squares on the face of the cube is a trimmed surface, you will end up with 54 surface meshes when this model is meshed. More than likely, all that you really care about is meshing the six faces of the cube. To accomplish this, you would assemble the nine trimmed surfaces into a quilt. With your model now consisting of six quilts (one for each face), you will get six surface meshes.

## How Quilts and Models Work

Let's see how this works in practice for the bone example in Figure 1. During import, you choose the IGES file to import and then you can set parameters telling Pointwise how to assemble quilts and models (Figure 6).

The Model Assemble Tolerance is the distance below which gaps between surfaces can be considered to be zero. To assemble the bone model in Figure 2, we used 0.001. Quilt assembly is based on the angle between normal vectors of adjacent surfaces. Because a quilt is meshed with a single surface grid, you typically want to have quilt boundaries align with feature lines or "hard edges" in the geometry. In other words, you do not want hard edges in the middle of a mesh because they will be smoothed over. Those edges are identified by the Quilt Assemble Angle in degrees. Because the bone is an organic shape with no hard edges, we used a value of 180, which means "join all quilts".

## Quilts and Models for a Designed Geometry

Let us look at another example, this time for an insulator - a designed geometry with plenty of hard edges. The organic example of the bone used above lacked hard edges. But otherwise, it is similar to a lot of CAD models we see in CFD in which the geometry is defined by a patchwork of quilts, such as an airplane's wing or an automobile's exterior surfaces. The left side of Figure 7 shows the CAD geometry before quilt assembly.

Instead of assembling quilts and models automatically during import, this time we will do it manually. The first step is to assemble the geometry in a single model (or models if you're working with a CAD assembly). This is done by selecting all the model entities and using the Assemble Models command (Figure 8). For the insulator in Figure 7, the entire geometry is assembled into a single closed model, using the default assembly tolerance.

With the model assembled, the next step is to assemble quilts according to your meshing requirements. For this insulator, the mesh needs to conform to hard edges. First, select all the model's quilts and then use the Assemble Quilts command (Figure 9). We used an assembly angle of 20 degrees, meaning that two adjacent surfaces would only be assembled into a quilt if their normal vectors differed by less than 20 degrees. This preserved the hard edges around all the bevels and holes and resulted in the topology shown on the right of Figure 7. The original 62 quilts were combined into only 22. At this point, meshing proceeds as usual.

## Where Are All the Trimmed Surfaces?

One of the first things Pointwise users notice is that the list of database entities does not include trimmed surfaces any more. It is not that they are gone. Rather, the software now treats each trimmed surface as a model consisting of a single quilt. The first step, whether it is during import or any time afterward, is to assemble the geometry into a model. The second step is to assemble quilts on which to generate your meshes.

Just start thinking of your trimmed surfaces as quilts and you are halfway to mastering solid meshing.

Of course, you will find several other features in Pointwise for working with quilts and models, including trimming, splitting, and joining, so you can create precisely the CAD topology you need for your meshing.

## The Benefits of Solid Meshing

Pointwise has several techniques for dealing with complex CAD geometry, but there are several distinct benefits to using solid meshing.

1. Your CAD file already may contain solid models so you might as well take advantage of what they offer in terms of healing gaps and overlaps.
2. Model and quilt assembly can be done automatically during import of your CAD file.
3. Once you've created a model of your geometry, you do not have to worry about gaps or overlaps. You make the model once and use it for the remainder of your mesh project.
4. Assembling quilts and models reduces the number of database entities you have to manage.
5. You can control the fidelity of your mesh through quilt assembly and the angle tolerance you use to identify hard edges.

## Try it For Yourself

Find out how many minutes it takes to generate your mesh using a demo license of Pointwise. Start the process today.