欢迎访问中国科学院大学学报,今天是

中国科学院大学学报

• • 上一篇    下一篇

基于 CSG 的二维 CAD 形状智能解析方法*

冯卓航, 申立勇   

  1. 中国科学院大学数学科学学院, 北京 100049
  • 收稿日期:2024-12-09 修回日期:2025-03-03
  • 通讯作者: E-mail: lyshen@ucas.ac.cn
  • 基金资助:
    *国家自然科学基金面上项目(12371384)和中央高校基本科研业务费专项资金资助

An intelligent analysis method for 2-D CAD shapes based on CSG

FENG Zhuohang, SHEN Liyong   

  1. School of Mathematical Sciences, University of Chinese Academy of Sciences, Beijing 100049, China
  • Received:2024-12-09 Revised:2025-03-03

摘要: 构造实体几何 CSG 技术通过几何基元集与基元间的布尔运算来定义复杂形状,但从已有的几何形状逆向建模恢复 CSG 构造序列一直是富有挑战性的研究问题。本文提出一种基于 Transformer 的深度网络架构,可以解析输入的几何形状,并输出该形状的 CSG 建模序列。采取 CSGNET 算法作为基线,本文首先扩充了训练所用的合成数据集,使得模型能够学习并解析更广泛的形状。此外,本文采取 VGG 编码器 - Transformer 解码器的自回归学习架构,基于注意力机制更好地关联生成序列,将二维形状输入解析为固定格式的 CSG 序列输出,得到了更好的重建质量。本文还引入了预测有效性矫正模块,确保模型不会输出无效的重建序列。结果表明,本文提出的模型在合成数据集和真实 CAD 数据集上都取得了更好的质量。

关键词: 构造几何实体, 注意力机制, 深度学习, 有效性矫正

Abstract: Constructive Solid Geometry (CSG) is a geometric modeling technique that defines complex shapes through Boolean operations between basic geometric primitives. However, reverse modeling to recover the CSG construction sequence from existing geometric shapes has been a challenging research problem. In this paper, we propose a Transformer-based deep network architecture that can parse input geometric shapes and output their corresponding CSG modeling sequences. Using the CSGNET algorithm as a baseline, we first expanded the synthetic dataset used for training, enabling the model to learn and parse a broader range of shapes. Additionally, we adopted an autoregressive learning architecture with a VGG encoder and a Transformer decoder, leveraging the attention mechanism to better correlate the generated sequences. This approach translates 2D shape inputs into CSG sequence outputs in a fixed format, resulting in improved reconstruction quality. We also introduced a validity correction module to ensure that the model does not output invalid reconstruction sequences. Experimental results show that the proposed model achieves better quality on both synthetic and real CAD datasets.

Key words: Constructive Solid Geometry, Attention Mechanism, Deep Learning, Validity Correction

中图分类号: