Reinforcement learning for block decomposition of planar CAD models

Benjamin C. DiPrete,Rao Garimella,Cristina Garcia Cardona,Navamita Ray
DOI: https://doi.org/10.1007/s00366-023-01940-6
IF: 8.083
2024-02-15
Engineering With Computers
Abstract:The problem of hexahedral mesh generation of general CAD models has vexed researchers for over 3 decades and analysts often spend more than 50% of the design-analysis cycle time decomposing complex models into simpler blocks meshable by existing techniques. The decomposed blocks are required for generating good quality meshes (tilings of quadrilaterals or hexahedra) suitable for numerical simulations of physical systems governed by conservation laws. We present a novel AI-assisted method for decomposing (segmenting) planar CAD (computer-aided design) models into well shaped rectangular blocks. Even though the simple examples presented here can also be meshed using many conventional methods, we believe this work is proof-of-principle of a AI-based decomposition method that can eventually be generalized to complex 2D and 3D CAD models. Our method uses reinforcement learning to train an agent to perform a series of optimal cuts on the CAD model that result in a good quality block decomposition. We show that the agent quickly learns an effective strategy for picking the location and direction of the cuts and maximizing its rewards. This paper is the first successful demonstration of an agent autonomously learning how to perform this block decomposition task effectively, thereby holding the promise of a viable method to automate this challenging process for more complex cases.
engineering, mechanical,computer science, interdisciplinary applications
What problem does this paper attempt to address?
### Problem the Paper Attempts to Solve This paper attempts to solve the problem of block decomposition of planar CAD models. Specifically, the authors propose a method based on Reinforcement Learning (RL) to decompose complex planar CAD models into well-shaped rectangular blocks. This process is crucial for generating high-quality quadrilateral or hexahedral meshes, which are suitable for numerical simulation of physical systems governed by conservation laws. ### Background and Motivation In highly nonlinear problems (such as fluid dynamics with shock waves), hexahedral meshes are preferred over tetrahedral meshes due to their higher accuracy and directional control capabilities. However, despite over 30 years of research, there is still no reliable algorithm that can automatically generate hexahedral meshes for general CAD models. Manually decomposing complex models typically consumes more than 50% of the design-analysis cycle time, greatly limiting efficiency. ### Method Overview The proposed method uses reinforcement learning to train an agent to perform a series of optimal cuts on CAD models to achieve good block decomposition. The specific steps are as follows: 1. **Environment Setup**: A custom environment is defined that can read geometric models and answer queries about the model (such as the number of vertices, the number of edges connected to a vertex, the angle formed by two edges at a vertex, etc.). 2. **Agent Decision-Making**: The agent makes geometric modifications (i.e., cuts) by selecting vertices and observing the state. In the current study, cuts are limited to full cuts along the X-axis or Y-axis from model vertices. 3. **Reward Mechanism**: The agent is rewarded based on the quality of the cuts (e.g., reducing complexity, low aspect ratio). If a cut does not change the model (e.g., cutting along an edge), it is penalized. 4. **Training Process**: Through repeated trials and learning, the agent gradually learns how to select the best cutting positions and directions to maximize cumulative rewards. ### Innovations - **First Successful Demonstration**: This is the first successful demonstration of an agent autonomously learning how to effectively perform block decomposition tasks, showing the potential to extend this method to more complex 2D and 3D CAD models. - **Generality**: The method is not only applicable to simple planar shapes but also has the potential to be extended to more complex geometric models without the need for specific adjustments for each case. ### Conclusion Although the current method is only applied to simple planar shapes, its main purpose is to introduce an AI framework that includes most of the principles needed to apply it to more complex 2D and 3D shapes and to demonstrate the effectiveness of the method. Future work will further explore how to apply this method to more complex real-world problems.