In this paper, an automatic grid generator based on STL models is proposed. The staircase boundary treatment is implemented to handle irregular geometries and the computation domain is discretized using a regular Cartesian grid. Using the grid generator, staircase grids that are suitable for fast and accurate finite difference analysis could be generated. Employing the slicing algorithm in RP technologies [1], the STL models are sliced with a set of parallel planes to generate 2D slices after the STL files obtained from a CAD system undergo topology reconstruction. To decrease the staircase error (increase accuracy) and enhance working efficiency, the cross-section at the middle of the layer is taken to represent the cross-section of whole layer. The scan line filling technique of computer graphics [2] is used to achieve grid generation after slicing. Finally, we demonstrate an application of the introduced method to generate staircase grids, which allows successful FDM simulation in the field of explosion. The example shows that the automatic grid generator based on STL models is fast and gives simulation results that are in agreement with practical observations. 
A grid generator for 3-D explosion simulations using the staircase boundary approach in Cartesian coordinates based on STL models