# On Modeling Antennas Using MoM-Based Algorithms: Wire-Grid versus Surface Triangulation
## 2 Materials and Methods
### Triangle-Grid
#### 2.3.3 Triangle-Grid: Code Implementation  
The class-diagram in Figure 9 displays the main components of the Triangle-Grid software module. The most critical classes, their attributes, and methods are depicted. The _TGmain_ class serves as the main class of the program and inherits publicly from the Qt framework library class, QMainWindow. The _TGview_ class, on the other hand, displays the geometric model of the analyzed antenna by leveraging the capabilities of the open-source Open Cascade platform [340]. This platform comprises a comprehensive suite of libraries and software development tools designed specifically for 3D modeling, with a strong emphasis on computer-aided design systems. The class-diagram demonstrates a clear separation of concerns between the two classes. In this diagram, the _TGmain_ class is responsible for managing the program's overall functionality, while the _TGview_ class focuses specifically on the visual representation of the antenna model. Furthermore, the versatility of the Open Cascade platform allows for future enhancements and modifications to be made to the Triangle-Grid software with ease, ensuring its longevity and continued usefulness in the field of antenna analysis. The _projectModel_ class serves as the storage container for the loaded project model and its settings. The creation and modification of project models are handled by the _newProjectForm_ class, which is derived from the standard _QWidget_ class of the Qt framework. The _clippingForm_ class is responsible for providing a cutting plane for the antenna model, allowing for easy selection of source edges for simulations, particularly for complex antenna structures. The cutting plane can be manipulated along the x, y, and z axes, adding extra functionality to the Triangle-Grid software. The _portSettingForm_ class is instantiated and its form is  
Figure 9: UML component-diagram of the Triangle-Grid. displayed upon the selection of edges for input source placement. The form includes graphical elements that display the coordinates for the beginning and end of the selected edges. The _CGALmesher_ class serves as a linking class between the main program and the CGAL library [341], providing an interface for utilizing the surface triangulation methods implemented in the CGAL. This auxiliary class is instrumental in generating the mesh required for effective antenna analysis. The calculation of antenna patterns is accomplished through separate functions within the main class, utilizing the use of the Eigen library [342]. The library is used to fill the SLAE matrix and solve it. The _fieldDisplayForm_ class allows generating of a three-dimensional graph of the antenna pattern providing a clear and intuitive representation of the simulation results by using the VTK library [343]. Figure 10 describes the steps involved in the antenna modeling process using the Triangle-Grid module. The UML sequence-diagram highlights the interactions between the various classes involved, starting from the creation and loading of the antenna project model to the final display of the antenna pattern. The first step in the process is initiated by the user starting the program, which results in the creation of instances of classes _TGmain_ and _TGview_. These classes correspond to the main window of the program, and the Qt widget is responsible for displaying the geometry of the antenna model. In the next step of the antenna modeling process, the user can create a new project by selecting the appropriate menu item. The program opens the _NewProjectForm_ window, where the user can specify the project name, working directory, and import the antenna model in <<_step_\" format. Additionally, the frequency range of the input source can also be set by the user. Once all necessary project details are entered, the program creates all required project files and processes the antenna model using the OpenCascade library to obtain the initial triangulation.