摘 要: 为了将任意模型使用球体进行密实填充,提出了一种基于包围盒与碰撞的模型填充算法。该算法首先生成模型的轴对称包围盒;其次在包围盒内产生任意数量球体并进行刚体碰撞,碰撞后的球体将会在包围盒的范围内均匀分布;最后采用判断法线方向算法筛选出模型内部的球体并保留至最终结果。通过实例证明,该算法能够根据输入的球体填充数量及孔隙率快速生成模型内的紧密填充球体。该算法对于模型的适应性高,生成速度快,具有2,000万三角网格的模型仅需20 秒即可生成内部填充球体,为生成点阵结构模型进一步奠定了基础。 |
关键词: 模型填充;包围盒;球体碰撞 |
中图分类号: TP301.6
文献标识码: A
|
|
Research on Model Filling Algorithm based on Bounding Box and Collision |
YAN Nan1, LIN Zhikai2
|
( 1.School of Optical -Electrical and Computer Engineering, University of Shanghai for Science and Technology, Shanghai 200093, China ; 2.School of Mechanical Engineering, University of Shanghai for Science and Technology, Shanghai 200093, China)
yannan19920423@163.com; 1012287837@qq.com
|
Abstract: In order to densely fill any model with sphere, this paper proposes a model filling algorithm based on bounding box and collision. First, the algorithm has an axisymmetric bounding box of the model generated, and then any number of spheres are generated in the bounding box and are collided with rigid bodies. The collided spheres will be evenly distributed within the bounding box. Finally, the algorithm of judging normal direction is used to filter out the spheres inside the model and retain them to the result. Examples have shown that the algorithm can quickly generate the tightly filled spheres in the model according to the filling quantity and porosity of the input sphere. The proposed algorithm has high adaptability to the model and the generation speed is fast. For a model with 20 million triangular meshes, it takes only 20 seconds to generate the internally filled sphere, which further lays the foundation for the generation of the lattice structure model. |
Keywords: model filling; bounding box; sphere collision |