Meshing is a fundamental step in representing and processing 3D geometry in various computational applications :
- Representation of Surfaces and Volumes: Meshing allows the representation of complex surfaces and volumes by decomposing them into simpler geometric elements (such as triangles, quadrilaterals, tetrahedra, or hexahedra).
- Simulation and Rendering: Meshing is crucial for creating a discretized domain. This domain is used for numerical simulations, allowing to model physical phenomena like stress distribution, heat transfer, fluid flow, and… optical phenomena such as refraction, diffraction, scatering at geometry interfaces.
- Computer-Aided Design (CAD): Meshing is employed in CAD systems to represent 3D models and surfaces. CAD models often use meshes for efficient storage, manipulation, and visualization of geometric information during the design process.
The picture below gives you an example of a car front made with meshing. It shows you as well how complex shapes can be built with simple elements.
General introduction
Understand what is a meshing
In computer graphics and computational geometry, a 3D mesh refers to a collection of nodes, edges, and faces that define the shape and structure of a three-dimensional object. Meshing is the process of creating this representation. It involves dividing the 3D space into discrete elements to approximate the geometry of the object.
Here are some key components of a 3D mesh:
- Nodes (or Vertices): Points in 3D space that define the corners of the mesh elements.
- Edges (or Lines): Connect the vertices and form the boundaries of the mesh elements.
- Faces (or Polygons): Flat surfaces defined by a closed loop of edges. In 3D meshes, faces are typically triangles or quadrilaterals.
The process of meshing, called Tessellation, involves determining how to distribute nodes and connect them to form elements that approximate the shape of the object being modeled.
Meshing used in Speos
Understand how meshing is defined in Speos
As for finite element simulation, Speos uses meshing to generate discrete elements of geometries. Speos relies on a Triangular surface meshing, which is widely used in Computer Aided Design (CAD) software. As Speos can be embedded into various CAD environments, it relies on meshing algorithms coming from CAD. It means, from same meshing values, meshing representation can be different from one CAD platform to another.
Speos/CAD platforms use surface meshing rather than volume meshing because it’s simpler to manage than a volumetric meshing algorithm. This simplicity offers better analysis efficiency for large and complex geometries.
Accessing Speos meshing parameters
There are two possibilities to access Speos meshing parameters. Through simulations (Direct, Inverse, Interactive) options:
Or through Local Meshing definition:
Both options rely on the same parameters. Parameters in simulation options affect all geometries assigned in simulation. Parameters in Local Meshing definition only affect geometries or faces assigned to it. These parameters are prioritized compared to general meshing parameters specified in simulation parameters.
Meshing parameters
There are three ways to parametrize meshing:
- SAG Tolerance: Control the meshing and the geometry of surface topography.
The Sag corresponds to a surface deviation. It is applied when the face or edge is curved. When the face is planar and all the edges are straight, the Sag is not applied.
- Maximum step size: Control the length of triangle mesh segment.
The Step corresponds to the maximum edge length of a meshing segment. A small Meshing Step value generates triangles with smaller edge lengths. This usually increases the accuracy of the results.
- Angle Tolerance:
The Angle controls the maximum angle tolerances for all the normals of a mesh triangle. Technically, the smaller the angle is, the smaller the triangle will be, when the surface is curvy.
You can refer to Understanding Meshing Properties documentation section to get more information.
Meshing Modes
Speos provides three meshing modes, which determine how geometries are meshed. They are applied to SAG Tolerances and Maximum step size only.
Proportional to face
The tolerance adapts and is adjusted to the size of each face of an object.
Length correspond to the diagonal length of the Face Bounding Box (blue highlighted square in the picture bellow).
SAG value is the value provided by the user as input parameter.
Pros:
Cons:
Refer to "watertighness principle" section to know more. |
Proportional to body
The tolerance adapts and is adjusted to the size of an object.
Length correspond to the diagonal length of the Body Bounding Box (blue highlighted parallelepiped in the picture bellow).
SAG value is the value provided by the user as input parameter.
Pros:
Refer to "watertighness principle" section to know more.
Cons:
|
Fixed
The tolerance will remain unchanged no matter the size or the shape of the object.
Pros:
Cons:
|
Watertightness principle
The term "watertight" conveys the idea that the mesh is completely enclosed, like a water-tight container. In practical terms, a watertight mesh ensures that there are no open surfaces or gaps in the model, which is important for accurate physical simulations and realistic rendering.
How to check if a mesh is watertight:
A meshing is considered watertight when there is no gap or overlap between meshing elements (faces, segments, and nodes). Below a visual control procedure for quick diagnosis:
- Zoom 3D view on sensitive objects areas like edges or corners.
- Activate Preview meshing (right click on bodies/faces selected in the simulation or local meshing)
- Check if local triangles share common nodes on the edge/corner of faces.
- If yes: mesh is watertight (right picture below)
- If no: mesh is not watertight (left picture below)
Non-watertight mesh | Watertight mesh |
The common consequence of having a non-watertight mesh in Speos is a high error percentage rate during simulation. When there are holes in the mesh, rays propagate through these holes and are directly categorized as errors ray. The error percentage can be seen during the simulation run or in HTML report generated after simulation completion.
Common warnings
Identify warning message and understand where they are coming from
Meshing warning messages appear during the simulation initialization stage when speos fails to apply the meshing defined by the user. There are two kinds of warning types :
Appears when certain faces have been meshed with coarser mesh parameters. | |
Appears when some faces have not been meshed at all. |
The workflow bellow explains to you how these messages appear and for which reason :
How to analyze faces too small to be meshed ?
- Double-click on warning to select all the faces impacted by it.
- Locate where these faces and bodies are with one of these 2 options:
- Copy/paste in structure tree (Ctrl + C & Ctrl + V).
- Create a group and explode it.
- Analyze the face:
- Use SpaceClaim measurement tool. Incorrect face can result in a line or area with a non-positive value.
- Use Check Geometry SC option (only for copy/paste option) to look for self-intersections, topology errors, …
Meshing Best Practices
Some advices to perform a correct meshing
It’s important to keep in mind that meshing is a crucial step in simulation model creation. It’s important to spend time on a model, with complex geometries, to find good mesh parameters. Without good quality geometries as input, meshing performance and precision cannot be optimal. Before doing any meshing operation, make sure that the geometries are imported as expected. Ansys recommends checking CAD geometries quality before importing them into Speos. Some software editors propose tools specialized in ensuring CAD data quality.
Guidelines for 3D surface meshing
Consider the following points for efficient meshing over 3D surfaces:
-
Triangles quality and aspect ratio:
Be sure triangle mesh elements are of good quality and respect a balanced ratio. It generally means avoiding highly distorted elements. -
Triangle size gradation:
Gradually vary the size of mesh elements in areas of interest. Finer meshes may be needed in regions with complex geometry or high gradients, while coarser meshes can be used in more uniform areas to reduce computational cost. -
Mesh density control:
Control mesh density based on the requirements of the simulation.
The choice of mesh quality, gradation and mesh density can differ depending on the answers to the following questions you might have:
-
What type of analysis you are conducting?
- Is it a rendering ? Is it a straylight study or photometric/radiometric study one ? Are there tangent and/or curved surfaces where light might pass through?
-
How much time do you want to invest in the mesh?
- In case of complex geometries and/or huge body size disparity in the model, spending time on the meshing definition guarantees, generally, a good model mesh. But this introduces additional time to the rest of the Speos model creation.
-
How much time do you want to invest in simulation initialization?
- Having a finer meshing, on complex geometries (with spherical shape for example) would require a larger number of triangles; meaning the initialization time is increased. If you want to iterate the simulation many times for sweeping parameters or initial optimization, using a coarser mesh might be more efficient. Another method would consist to import unvarying elements, as LightBox.
Practical recommendations
Make good use of Local Meshing
- Local Meshing is a function which “forces” specific meshing parameters to a group of selected faces. It means, when a Local Meshing is applied on a face, during tessellation process, Speos will consider Local Meshing properties instead of global mesh properties (set in simulation’s options) for this group of faces only.
Local Meshing's main benefit is bringing granularity to the model by increasing mesh accuracy on specific elements which are important in the light path.
It also drives 3D Irradiance sensor resolution. To get a homogeneous and consistent resolution, it’s recommended to use the Step Parameter in Fixed mode.
As Local Meshing might generate non-watertight behavior on the mesh, we recommend to set it like following :
- Fine tune the global mesh settings available in your simulation’s option - be aware that each simulation you create has independent meshing parameters. If you want to use the same mesh setting across different simulations, duplicate the existing simulation object by coping and pasting it.
- Create one or several local meshing with coarser meshing on side geometries (meaning geometries where probability to be hit by light is relatively low).
- Create specific local meshing for 3D Irradiance sensor. Be also aware that two faces cannot be meshed two times. So, one face cannot be linked to more than one Local Meshing.
Use "Proportional to Body" or "Fixed" modes instead of "Proportional to Face" mode for higher possibility of watertight meshing.
Be careful with the CAD origin, especially for tangent geometries.
Make sure that you can access the carry surface in Catia.
ODX file import - which meshing to apply ?
Since Speos 2024R1, there is a new way to import geometries natively from OpticStudio. This method is accessible through the “Optical Design Exchange Icon” in Components tab of Light Simulation ribbon.
This function imports two kind of elements :
- CAD geometries under the Structure Tree.
- Meshed geometries found in Components.
Meshed geometries in Components must be used for simulation and they also have their own meshing properties. They are accessible with right click > Options.
In 2024R1, there is no preview meshing available. If the default parameters do not give the desired accuracy, please try the following settings :
In 2024R2 and beyond, preview meshing is available and default parameters provided are the ones provided just above.