Morphing & TCL Command File Creation
Aim -
- To Morph the given side body component to the desired shape as given in the reference image and write a Macros for the same morphing operation.
Objective -
- To do morphing operation for the given side body component.
- To write a macros for the morphing operation.
- To do macro file creation for the morphing operation which is tcl/tk file.
Cad Model Image -


[Note: These are the reference images of morphing done for side body component.Figure 1- represent's that the morphing is done to the side body to get desired shape.Figure 2 reprents before morphing and after morphing.We also have to do the same thing to the side body component which is given to us.]
A Brief Explanation about Morphing-
- Morphing is a tool that allows you to alter finite element models while keeping mesh distortions to a minimum.
- HyperMorph can be used to:
- Change the profile and the dimensions of your mesh.
- Map an existing mesh onto a new geometry, and
- Create shape variables that can be used for optimization.
- The methods available to carry out morphing are available under:
- Freehand Morphing
- Map to Geometry
- Morph Volumes, and,
- Domains and Handles
- To provide greater control as well as an efficient morphing, you can use:
- Morphing constraints,
- Symmetries, and,
- Biasing factors.
- Morphs can be saved as Shapes. Shapes can then be:
- Positioned to other parts of the model.
- Animated, to review the morphing.
- And also be used to transfer loads from one model to another.
- After morphing has been performed, you can visualize the quality of the mesh, and can automatically smooth it if need be. A re-mesh can also be performed, keeping the morphing entities like handles, domains and shapes intact.
Introduction to Morphing and it's Terminology-
Morphing in Simple Terms:
- Morphing is a toll in hypermesh which allows you to change your FEA model or reshape your FEA model according to new design which you have developed or that you want to design.
Why do we need morphing ?
- Morphing will change the loacation of the nodes which you want to change.
- It's not going to change the element number,element id,element name, or any contact groups created before.
- It is a good tool which will change our entire model without changing or disorting the elements that are already present in that particular model.
What are domains and handles ?
- Domains are basically entities which contains elements and nodes in it.
- Mesh model is divided into domains.
- The domains and handles approach consists of dividing the mesh into regions called domains with associated handles.
- Domains consist of selected nodes and elements.
- Domains and handles are divided into two basic groups, global and local.
- The global group consists of global domains, each of which is associated with a number of global handles.
- Global handles will only influence the nodes in the global domain to which they are associated. Global handles and domains are best for making large scale shape changes to the model.
- The local group consists of five types of local domains:
- 1D domains.
- 2D domains.
- 3D domains.
- Edge domains.
- General domains.
- Local handles/edge domains can only influence nodes contained in the domains they are associated with. Local handles/edge domains are intended to be used to make small scale, parametric changes to the model.
- While a model can contain both global and local handles and domains, it is not necessary to have both types of domains and handles in a model.

Figure 3-Domains and Handles |

Figure 4-Domains and Handles |
- Global domain : A single domain which can influence every node in the model.
- Local domains : include1D domain, 2D domain, 3D domain and edge domain. A model can have multiple local domains for morphing different local areas.
How does morphing works ?
- When you perform morphing you can choose instead of all elements and nodes separatley you can choose the entire domain itself which is gonna act as set of all these elements and nodes.
- All domains has handles,So handles are placed at the main boundaries.Choosing those handles you canalter the design,alter elements shapes and size.
- Using handles,We can change the shape of our design.
- There are differnt types of handles available.
- This is basically a local handle,Which is only going to change the elements which are specified there.
- There are also called global handles or global domains which will change the entire model itself.
- Local handles only effect parent and neighbouring domains.
Morphing Applications-
- We can change the shape of a particular model by morphing.
- We can also change the element quality in certain criteria or certain cases by using morphing.But this goes into the advanced morphing.
- If we have a cuboid and you want to map it into the particular surface which is curved,we can easily do that by morphing.
- We can change the entire surface to match our FEA model by morphing.
- If we are doing a FEA analysis on a car hood.Now you have done analysis on a car hood.We want to do some changes to that.How can we do that changes to the hood ?We can do it by morphing.So after changing the shape,You will again do the same analysis,Until the optimal results required.
Articles for Brief Explanation about Morphing-
- https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:a4f24225-32b5-43c2-b4a3-f42d8ff751a1
- https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:6450a2d7-d881-4fb2-8226-d5bcf87e1f3b
Procedure -
Phase 1-Importing
- Hence we are importing a given CAD geometry into hypermesh.
- There are file formates like IGES,STEP,Parasolid where we can import these file formats into any CAD,CAE Softwares.
- But in hypermesh we can only import three file formates like
- IGES [Initial Graphics Exchange Specification].
- STEP [Standard for the Exchange of Product Model Data].
- Solidworks.
- IGES,STEP,These two are standard file formats which are used most in industries.But now a days in industries,they are aslo using parasolid file
format's.

Phase 2-Morphing
- In morphing there are 3 methods of morphing called
- Free Hand Morphing
- Map to Geometry
- Morph Volumes
Free Hand Morphing-
- Freehand morphing provides quick ways of morphing a finite element mesh.Freehand morphing can be performed in three ways:
1.Move nodes-Lets you morph elements by selecting fixed nodes, moving nodes, affected elements and a moving direction.
- The affected elements that are located between the moving and the fixed nodes will be stretched uniformly.
- The stretching of the elements can be biased towards either the fixed or the moving nodes, providing a great degree of control on the resulting mesh profile.
2.Record-Lets you record nodal movements from panels outside HyperMorph, like translate, rotate, quality index etc.
3.Sculpting-Lets you enforce a selected shape onto your mesh.
4.Save Shape-Use the Save Shape subpanel to save a current morph as a shape.

Map to Geometry-
- Map to Geometry provides quick ways of taking an existing mesh and conform it to a new geometry.
- Domains and handles can be used to provide better control on the morphing process.
- The geometry can be a line, node list, plane, surfaces, or elements using edge domains and handles to guide the process.
- Geometry can also be provided in the form of section lines, or surfaces.Some of the types of geometry that can be mapped are shown in figure 1.

Figure 7-Types of Geometry that can be Mapped |

Figure 8-Before Morphing and After Morphing |
Volume Morph-
- A morph volume is a six-sided hexahedron whose shape can be manipulated to morph the mesh.
- The length and curvature of each edge of a morph volume can be modified independently.
- Adjacent morph volumes can be linked through tangency conditions. This allows you to update the characteristics of the morph volumes.
- Handles are placed at each of the vertices of the morph volumes. Morphing involves moving these handles.
- Morph volumes thus present a very simple, powerful, and intuitive way to morph.
- Morph volumes will only influence the nodes that are registered to it. You can either, register the nodes within a morph volume automatically when it is created, or you can select the nodes or nodes on selected elements to be registered.
- If the morph volumes do not appear to be morphing nodes inside them, you may need to register those nodes.
- For the given side body model,We will be using morph volume method and we will be morphing the model.

Figure 9-Side Body of Car |

Figure 10-Car Side Body Parts Name |
- We have to morph this side body to a desired shape.

2:1 Start Morphing
- Go to the Tools >> HyperMoph >> Domains >> Create 2D Domains.
- The morph volumes panel can be accessed by one of two methods:
- On the Morphing menu point to create and select Morph Volumes.
- On the Tool page, Go to HyperMorph >> Morph volumes.

- 2D Domains can be created only for 2D Shell Element's.
- 2D Domains have been created for the given side body.
- After creating domains on the 2D shell element's.It will look like as which is shown in below snap.Have a look.

Figure 13-2D Domains on Mesh |

- The Handles also have been created along with the domains.If you zoom and see the model.You can see the nodes in the side body.

Figure 15-181 Domains and 300 Handles have been created |
2:2 Morph Volume
- Morph Volume will change the entire shape of the geometry.
- Morph Volume is similar to sculpting.
- A morph volume (or "mvol") is a six-sided prism that can be used to manipulate a mesh by manipulating the shape of the morph volume. Morph volumes are very malleable; the length and curvature of each edge can be modified independently of the others, and adjacent morph volumes can be linked through various tangency conditions.
- This malleability allows you to enclose a given mesh with morph volumes, alter the morph volumes to fit your model, and then change the shape of your model by modifying the morph volumes. Morph volumes present a simple, powerful, and intuitive way to morph.

Figure 16-Morph Volume panel |
2:3 Create Morph Volumes.
- Go to morph volumes >> create sub-panel.
- Switch the creation method create morphvol.
- For handle placement, select corners only.
- Keep the auto-tangent check box selected.
- In the Enclosed Element's sub panel >> Select the elements by displayed >> create. shown in Figure 17.

Figure 17-Element's Selected to create morph volume |
- To morph the element's properly,We are creating morph volume.

- After creating the morph volume.Split the morph volume in longitudinal direction and specify the number of split-lines to create.Here i'm specifying 10 lines to be splitted on morph volume.
- Use the Split/Combine subpanel to combine multiple morph volumes into a single larger one, or to split a morph volume into multiple smaller ones.
- Any split or combine operations you perform in a matrix of morph volumes will propagate through the matrix along the vector of the split-line (or the edge that is being removed in a combine operation).
- Go to the Morph volumes >> split/combine sub-panel.
- Ensure the split toggle is set to split mvols : by edges.
- Make sure to select the check boxes of make tangent and create handles.
- Click Split.

Figure 19-Splitted the Morph Volumes |

Figure 20-10 lines has been splitted in longitudinal direction |

Figure 21-Split/Combine Sub Panel |
- Similarly,Do the same thing for lateral direction also.In lateral direction,I'm splitting 5 lines on the morph volume.

Figure 22-Splitted the Morph Volume |

Figure 23-Split/Combine Sub Panel |
Figure 24-Morph Volume has been completley splitted |
- Here in the figure 24.The morph volume has been splitted completley to drag or move the handles to sculpt the side body to get desired shape which has been shown in the figure 2.

Figure 25-Morph Volume has been completley splitted to get desired shape |
- Changing the profile of the B-pillar-
- Go to the morph >> move handles sub-panel.
- Set the morphing method to interactive.
- Select the handles by window and start to drag the handles to get desired shape of Pillar B.

Figure 26-Desired Shape of Pillar B |
- Similarly do the same thing for the pillars A and C.
- And for Roof,Back Wheel Arc,Trunk.Do the same thing for every part.
- Select the handles by window or selecting it by individually or select the origin node and drag the handles.By doing this,Other neighbouring handles will not be moved.
- Do the same process for every side body feature.

Figure 27-Morphing Done has been done for every region to get desired shape |

Figure 28-Before Morphing |

Phase 3-Macro File Creation
What is Hypermesh Macro ?
- A HyperMesh macro is similar to a user-defined script or executable that can be used to automate a HyperMesh process or execute a series of steps semi-automatically.
- Hypermesh Macro is a command file containing hypermesh,mouse and templex commands.
Application Examples-
- One click shortcut to automesh panel,cleanup sub-panel,add point:point button.
- One click tool turning on/off all of the geometry.
- One click tool creating a component collector with a hard-coded name.
Some Terms in TCL[Tool Command Language]/Tk[Tool Kit] file-
- Fixedpointhandle 0-Which is,Fix the point handle to rotate at 0.
- Rotateabout 000-Here I have not specified any axis or rotating centre.
- Rotateabout 1-941.059613 29.499426 813.969092-If I click some where else,the rotating centre changes.Where I have exactly clicked,So these are the coordinates.
Benefits-
- Reduces user time and mouse clicks for lengthy and repititive tasks.
- Creates Custom Hypermesh Environments.
- Standardize CAE Process.
- Minimize CAE analysis set-up time.
- Rerun previously-conducted CAE Processes.
- Get rid off time consuming.

- The macro file will be there in default location in C disk/Documents.
- Go and delete some unwanted things like quality criteria,rotatational views commands in macro file.
- After that save the macro file and run it in hypermesh.The entire model will be displayed in GUI.It will take 2 or 3 mins to be displayed in GUI cause the process will be running.

Figure 31-To Run a Macro File |

Figure 32-Selecting Macro File/.Tck |
Final CAD Model Image-

Figure 33-Final CAD Model Image |
Result -
- Hence the morphing of the following FE model has been done successfully.
- Hence the macro file creation also has been done successfully.
Conclusion and Learning Outcome -
- In this week 11 challenge,I came to know,How to morph the FE model to the desired shape.
- How to create a macro file for hypermesh and how to run the macro in hypermesh.
- How to modify the original mesh to the desired mesh by morphing.
Some Useful Articles for the Macros -