.. _GAI_surface_mesher_user_guide:

**************************
Geometry AI Surface Mesher
**************************

Geometry AI Surface mesher is a combination of a geometry processing utility with a surface mesher.

Main characteristics:

- handles non watertight geometries,
- handles intersecting solid bodies well,
- allows for basic geometry transformations of solids (to use this feature, define solids in separate CAD files),
- patches holes in the geometry,
- allows for the analytical specification of a Wind Tunnel geometry as a farfield as well as creating a half-model for more efficient straight line simulations,
- does not conform to feature edges, to improve their representation, the geometry accuracy must be increased.


Meshing Process
===============

The surface mesher performs two main steps:

1. **Geometry Processing**

   Through the use of *Geometry AI*, the geometry is processed and prepared for surface meshing. This includes:

   - applying basic geometric transformations to solids,
   - resolving intersections,
   - patching holes in the geometry,
   - applying basic geometry transformations to solids defined in separate files,
   - constructing the farfield geometry,
   - splitting the geometry to create a half-model.

2. **Surface Meshing**

   The geometry is meshed using the surface mesher which enables the user to specify all kinds of refinements, also per face of the input geometry.

.. note::

   The Geometry AI mesher may stop before fully achieving the requested **Geometry accuracy** if system resource constraints are encountered during surface meshing. When this occurs, a message indicating early termination will appear in the process log. If you observe this, consider increasing the **Geometry accuracy** value (coarser) to reduce the meshing workload and lower resource usage.

Examples
========

Examples of meshing using *Geometry AI* can be found in the :ref:`Python API Example Library <python_api_example_library>`. Specifically look at:

- :doc:`Windsor Body with Wheels <../../python_api/example_library/notebooks/windsor_body>`.

.. admonition:: Recommended for:
   :class: tip

   - non-watertight geometries,
   - faulty low quality geometries,
   - intersecting solid bodies,
   - geometries of automotive production vehicles.


.. _fig_GAI_surface_mesher_example:
.. figure:: Figures/gai_sm_example.png
    :align: center
    :width: 70%

    Example of a mesh generated using the **Geometry AI Surface Mesher**.
