• No results found

3.3 Computational implementation

3.3.2 Mesh smoothing

The goal of mesh smoothing function is to remove or modify any triangular faces that are either redundant or severely skewed in the isosurface model. The end result of this operation is an isosurface model with evenly spaced nodes, and a more concise nodal-face set. Consequently, the FEA will be more accurate because of the improved element quality. Computational time can also be reduced due to the reduced number of element. Three different mesh smoothing techniques are used in this study: (1) point-merging, (2) finite element spacing and (3) long edge split. Point-merging is the most important mechanism and is applied to the entire isosurface mode. The other two techniques are only performed on the shrink-wrapped boundary surfaces.

73

3.3.2.1 Merging isosurface nodes

In this study, mesh smoothing is carried out as an iteration process that removes faces and nodes, or vertices in non-FEA context (Figure 3-3 and Figure 3-9). The decision of removal is made according to a simple edge length criterion: any triangle that contains an edge shorter than a specified value will be deleted (red edges in Figure 3-9). This length value is user- defined according to their modelling requirements. As face deletion will result in a hole on the isosurface, it must be patched by reshaping the neighbouring triangles. Node-merging also results in face degeneration (F9 and F10 in Figure 3-3c). These degenerated faces are also removed. Computationally, the node-merging process is carried out in the following sequence:

1. The edge lengths of all triangles are calculated and sorted in the ascending order. Triangles with shorter edge(s) are deleted first.

2. The location of all nodes is checked for order of importance (Figure 3-3d). Less critical nodes are deleted first.

3. When a merging decision is made, one of the two nodes becomes redundant and is moved outside the modelling space and later deleted (Figure 3-9).

Each node is given a importance value between 0 and 3.5 points. Basically, 1 point is given to a node if it is on the x-surfaces of the modelling boundary, 1 point if on the y-surfaces, 1 point if on the z-surfaces, and an additional 0.5 points if the node is part of the boundary of the original isosurface. If two nodes are equally critical, they are merged at the midpoint, and one of them is randomly picked for deletion.

Figure 3-9 (also Figure 3-3a) is also a special case, demonstrating the merging of three triangles into one. Tetrahedron as shown in Figure 3-3b is another special case where a face duplicate is created through face deletion and must be dealt with separately. To do this, once a tetrahedron is identified, two of the triangles containing the shortest edge are determined

74

and deleted (F1 and F4 in Figure 3-3b), and then one of the duplicated faces can be removed (F2 and F3 in Figure 3-3b).

Figure 3-9. Schematic of the node-merging and face-patching process.

Tetrahedrons can be identified in the node-face set by counting how many times each node has appeared in the nodal list. Those that appear exactly 4 times and share exactly 4 triangular faces are part of a tetrahedron. Sometimes the entire tetrahedron can be deleted if it is not connected with the rest of isosurface model.

3.3.2.2 Condensing the face-node lists

The mesh smoothing process inevitably creates a large number of redundant nodes and face duplicates. Maintaining correct nodal and face lists is therefore an essential task in this isosurface smoothing process. A small function is warranted to maintain a concise face-node set. However, caution must be taken as removing any node from the list will result in a change in the nodal number, thus the face list must be updated concurrently.

To save computational time, the actual node and face deletion from the vertex-face set takes place after the node-merging process is completed for the entire model, rather than every time two nodes. Using Figure 3-9 as an example, when nodes N8 and N9 are merged, it is apparent

that:

75 2. Face 2 N9-N8-N5 becomes N9-N9-N5.

3. Face 3 N5-N7-N9 remains the same.

4. Node 8 N8 is moved out of the modelling space.

Assuming this is the end of the operation, the mesh integrity is then examined. 1. Face 1 N7-N9-N9 is no longer a face. This entity is deleted.

2. Face 2 N9-N9-N5 is no longer a face. This entity is deleted.

3. Node 8 N8 is not used by any face. This node is deleted.

4. Node 9 N9 moves up the list and becomes the new N8.

5. Face 3 N5-N7-N9 is re-numbered as N5-N7-N8.

Node 9 could have been removed instead of Node 8 in the first place since they are equally critical as both have 0 point. If the nodes N2 and N9 were to be removed, Node 9 (0 point)

would be moved out of the modelling space since Node 2 was more critical (1 point for being on the modelling boundary).

3.3.2.3 Boundary mesh smoothing through finite element method

An alternative approach to improve the mesh quality is node spacing through finite element method, where all edges are treated as a tension spring that pulls its neighbouring nodes toward each other. Let this “tensile force” of every edge be directly proportional to its length, long edges would exert more force on their neighbouring nodes than short edges. Consequently, the mesh will re-arrange itself to counter-balance all forces by moving nodes to some intermediate positions. In other words, the goal of this technique is to relocate nodes in a way that the mesh quality can be enhanced. This process is combined with node-merging and is repeated a number of times until no further improvement is possible. This process is executed at most six runs per iteration as there are six boundaries in a 3D modelling space. Each run is conducted on its own 2D plane and in a 2D FEA context.

76

As an FEA problem, a global stiffness matrix representing the spring tension is created. The elemental stiffness matrix of one spring element, AB, is

[ 1 0 01 −1 0 −10 −1 0 −10 1 0 01 ] { 𝑥𝐴 𝑦𝐴 𝑥𝐵 𝑦𝐵 } = { 𝐹𝐴,𝑥 𝐹𝐴,𝑦 𝐹𝐵,𝑥 𝐹𝐵,𝑦}

where the 𝑥’s are the current coordinates of nodes. The global stiffness matrix is assembled from elemental matrices. The x/y/z coordinates of all nodes that are on the edges, on the corners of the modelling boundary, or on the boundary of the original isosurface are fixed, hence they are unaffected by this operation.

Figure 3-10. Reconstruction and splitting of triangles on the isosurface boundary. Triangles with long edges can be dealt with in two different ways through reconstruction or splitting based on the length criterion (Figure 3-10). Either that a new pair of triangles can be defined with different nodal compositions (Figure 3-10, right, dashed red line), or the original triangles can be split into four (Figure 3-10, right, thick red line). Both techniques directly remove long edges, and indirectly affect the subsequent mesh-smoothing operation that rearranges the “forces field” of the current spring system (Figure 3-11, red edges).

77

Figure 3-11. Edge splitting adds force vectors to the existing spring system.

For every long edge removed, two triangles are split or reconstructed. The surface normal of the new faces are oriented in the same direction as the original faces according to the right hand rule. Edge-splitting is performed separately in a fashion similar to the short edge removal process. However it adds new nodes and faces to the existing set. Edge-splitting is executed based on a list of faces that contain long edges, and rectify the issues one by one. A long edge will not be split if it happens to be part of the original 3D isosurface (Figure 3-3d, surface 6), or it is part of the modelling boundary edges (Figure 3-3d, point 1, point 2 and edge 3). Also, if either new edges being created is too short according to the short edge removal criterion, the process is skipped. Node relocation by finite element method and edge modification is repeated alternately for a number of times to ensure that both sets of smoothing criteria are satisfied.

Related documents