14.8 Meshing

After drawing and revolving the corrugated horn, we will recalculate the mesh (accordingly to current Mesh Settings). The argument of the generateMesh function from the QW-Modeller module is the document name (a string type). Therefore, we create a variable named current_doc and assign it the name of the active document.

In the main code section we add the following commands:

 

# recalculate mesh

 

current_doc = qwm_doc.Name

QW_Modeller.generateMesh(current_doc)

 

When executing the macro in an empty project, the mesh will be generated based on default settings. This includes setting the maximum cell size along each axis to 10 mm and enforcing additional mesh snapping planes on all geometry elements, including vertices and edges, for metal and other material objects. The minimal distance between the snapping planes will be set to 0.1 mm. In case that the script is executed within an existing project, the mesh will be recalculated and refreshed in accordance with the current settings of that project, as available in the Mesh Settings dialogue.

It is recommended to verify the actual settings of the mesh and special planes (in the Mesh Inspect dialogue) before running the simulation.