Skip to main content
QUICK REVIEW

[论文解读] SketchGen: Generating Constrained CAD Sketches

Wamiq Reyaz Para, Shariq Farooq Bhat|arXiv (Cornell University)|Jun 4, 2021
3D Shape Modeling and Analysis参考文献 38被引用 25
一句话总结

SketchGen 采用基于 transformer 的模型以及精心设计的 CAD 草图语言来生成原语及其几何约束,从而实现约束感知的 CAD 草图生成和对现有草图的自动约束。它在受约束的 CAD 草图生成任务上显著优于此前的 SketchGraphs 基线。

ABSTRACT

Computer-aided design (CAD) is the most widely used modeling approach for technical design. The typical starting point in these designs is 2D sketches which can later be extruded and combined to obtain complex three-dimensional assemblies. Such sketches are typically composed of parametric primitives, such as points, lines, and circular arcs, augmented with geometric constraints linking the primitives, such as coincidence, parallelism, or orthogonality. Sketches can be represented as graphs, with the primitives as nodes and the constraints as edges. Training a model to automatically generate CAD sketches can enable several novel workflows, but is challenging due to the complexity of the graphs and the heterogeneity of the primitives and constraints. In particular, each type of primitive and constraint may require a record of different size and parameter types. We propose SketchGen as a generative model based on a transformer architecture to address the heterogeneity problem by carefully designing a sequential language for the primitives and constraints that allows distinguishing between different primitive or constraint types and their parameters, while encouraging our model to re-use information across related parameters, encoding shared structure. A particular highlight of our work is the ability to produce primitives linked via constraints that enables the final output to be further regularized via a constraint solver. We evaluate our model by demonstrating constraint prediction for given sets of primitives and full sketch generation from scratch, showing that our approach significantly out performs the state-of-the-art in CAD sketch generation.

研究动机与目标

  • 通过明确处理异构原语和约束,推动 CAD 草图的改进生成。
  • 提出一种结构化的基于标记的 CAD 草图语言,以实现有效的 transformer 建模。
  • 开发两个专门的 transformer:一个用于原语,一个用于约束,受语法树的启发。
  • 证明具备约束感知的生成可以通过求解器进行正则化,以生成有效的草图。

提出的方法

  • 将 CAD 草图表示为由异质原语组成、由约束连接的图。
  • 为原语和约束设计一个正式的基于标记的语言,具备起始/结束语法和语法树引导。
  • 通过 k-means 将连续的原语参数量化为每种参数类型的 256 个箱。
  • 使用 transformer 解码器作为自回归原语生成器,基于多个输入序列(Q, Q3, Q4, QI)条件。
  • 实现基于指针网络的约束生成器,选择原语索引以形成约束序列。
  • 使用教师强制和交叉熵损失训练原语和约束生成器;在推理阶段应用 nucleus 采样。
  • 允许使用约束求解器进行事后优化,以纠正量化误差并提高可行性。

实验结果

研究问题

  • RQ1结构化的基于标记的语言是否能够实现对异构 CAD 原语及其约束的有效自回归生成?
  • RQ2将语法树引导(Q3、Q4)加入是否比纯序列建模提高生成质量?
  • RQ3将原语和约束生成分离以及对约束使用指针网络有什么好处?
  • RQ4生成的约束是否能通过求解器对原语参数量化进行稳健的正则化和纠正?
  • RQ5在像 SketchGraphs 这样的受约束数据集上,生成的分布与真实 CAD 草图有多接近?

主要发现

方法草图原语约束.
random1020.7370.9724.14
SG-sketch158.90-2.42
ours88.228.600.61
  • 该模型在测试草图上的负对数似然值低于 SketchGraphs 基线(NLL 值:草图 88.22,原语 8.60,约束 0.61)。
  • 生成的草图在统计量上比基线更接近数据分布,这在生成序列中的 E_stat 指标所示。
  • 在消融试验中,移除语法树输入(Q3 和 Q4)会降低性能,同时在共享嵌入中混合标记类型也会损害结果。
  • 生成的约束可以纠正原语参数量化误差,自动约束实现高准确性(测试集约束约 98.4%)。
  • 生成后对约束进行求解器优化提高草图的可行性(例如修复线段端点之间的间隙)。
  • 该方法在 SketchGraphs 数据集的完整草图生成和自动约束任务上均优于主要基线。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。