Source-linked AI summary

BrepGen: A B-rep Generative Diffusion Model with Structured Latent Geometry

Xiang Xu, Joseph G. Lambourne, Pradeep Kumar Jayaraman, Zhengqing Wang, Karl D. D. Willis, Yasutaka Furukawa

arXiv:2401.15563v3cs.CVcs.LG

TL;DR

Direct B-rep generation must represent varied geometry while preserving valid topology, a gap left by methods limited to simpler shapes or lacking structured topology. BrepGen uses a hierarchical latent-geometry tree with duplicated nodes and diffusion-based denoising to generate and reconstruct B-reps. It surpasses existing methods and generates complicated free-form and doubly-curved models, while remaining limited to single-body solids and subject to merging and watertightness constraints.

  • Problem

    Direct B-rep generation must handle diverse parametric geometry and correct topology, while prior methods were limited in shape complexity or structured topology generation.

  • Method

    BrepGen uses a hierarchical tree whose node features encode B-rep geometry, while duplicated nodes encode topology and Transformer-based diffusion denoises and merges nodes to reconstruct the model.

  • Results

    BrepGen surpasses existing methods across B-rep generation benchmarks and generates complicated furniture models with free-form and doubly-curved surfaces.

  • Takeaways & Limitations

    BrepGen advances direct B-rep generation toward CAD models containing complex free-form geometry and structured topology.

  • Takeaways & Limitations

    BrepGen supports only single-body solids, can merge nearby edges or faces under its distance threshold, and does not guarantee watertight solids.

Abstract

from arXiv · show

This paper presents BrepGen, a diffusion-based generative approach that directly outputs a Boundary representation (B-rep) Computer-Aided Design (CAD) model. BrepGen represents a B-rep model as a novel structured latent geometry in a hierarchical tree. With the root node representing a whole CAD solid, each element of a B-rep model (i.e., a face, an edge, or a vertex) progressively turns into a child-node from top to bottom. B-rep geometry information goes into the nodes as the global bounding box of each primitive along with a latent code describing the local geometric shape. The B-rep topology information is implicitly represented by node duplication. When two faces share an edge, the edge curve will appear twice in the tree, and a T-junction vertex with three incident edges appears six times in the tree with identical node features. Starting from the root and progressing to the leaf, BrepGen employs Transformer-based diffusion models to sequentially denoise node features while duplicated nodes are detected and merged, recovering the B-Rep topology information. Extensive experiments show that BrepGen advances the task of CAD B-rep generation, surpassing existing methods on various benchmarks. Results on our newly collected furniture dataset further showcase its exceptional capability in generating complicated geometry. While previous methods were limited to generating simple prismatic shapes, BrepGen incorporates free-form and doubly-curved surfaces for the first time. Additional applications of BrepGen include CAD autocomplete and design interpolation. The code, pretrained models, and dataset are available at https://github.com/samxuxiang/BrepGen.

1 INTRODUCTION

BrepGen addresses the difficulty of directly generating valid, geometrically diverse B-rep CAD models by encoding geometry and topology in a unified tree and recovering topology through diffusion and node merging.

  • Motivation: B-rep generation must handle diverse parametric geometries and correct topological relations, while prior direct methods were limited to simplified prismatic shapes.B-reps include varied curves and surfaces, and their relations must form watertight solids.
  • Method: BrepGen represents each CAD solid as a hierarchical tree whose nodes encode face, edge, and vertex position and local geometry.The root denotes the solid, while successive child levels represent faces, edges, and vertices.
  • Method: Duplicated nodes encode mating and association topology, unifying B-rep geometry and topology so continuous geometry regression can recover discrete structure.Shared elements appear as multiple nodes with identical features.
  • Method: A Transformer-based diffusion model denoises nodes from faces to vertices, then merges similar duplicates to reconstruct adjacency, loops, trimmed faces, and the final B-rep.Merging occurs across parents and within parents before faces are joined into the CAD model.
  • Contributions: The method introduces latent diffusion for free-form surfaces and trimming curves, a Furniture B-rep Dataset, and direct B-rep generation with state-of-the-art performance.These contributions extend generation beyond the limited shape ranges of earlier approaches.

2 RELATED WORK

Prior CAD generation methods use CSG, sketch-and-extrude, meshes, or constrained diffusion, whereas BrepGen targets direct generation of structured B-reps with complex geometry and topology.

  • Constructive Solid Geometry: CSG represents shapes by combining primitives with Boolean operations, but converting non-trivial CSG shapes into B-reps can create unwanted geometric complexity.Nearly aligned primitives may produce thin sliver faces after conversion.
  • Sketch and Extrude: Sketch-and-extrude methods model sequences of operations but remain limited mainly to line, arc, and circle sketches with extrusion, unlike BrepGen’s direct B-rep synthesis.BrepGen emphasizes complex curves and surfaces unavailable to those formats.
  • Boundary Representation: B-rep generation research includes mesh generation and reconstruction from drawings or point clouds, while SolidGen generates entire B-reps but is restricted to prismatic primitives.BrepGen is described as more general because it also produces free-form doubly-curved geometry.
  • Diffusion Models for CAD Generation: Diffusion methods have generated geometry with given topology or topology-free triangle soups, but unconditionally generating structured geometry with correct topology remains challenging.BrepGen is positioned as addressing this combination of geometry and topology generation.
  • B-rep Datasets: The Furniture B-rep Dataset is presented as the first dataset of human-designed B-rep models spanning standard object classes such as tables and chairs.It complements existing synthetic and human-designed B-rep datasets.

3 STRUCTURED LATENT GEOMETRY

BrepGen encodes B-rep geometry as node features in a fixed-topology hierarchical tree, using sampled local shapes, global positions, and duplication to represent variable topology.

  • Tree Representation: The representation unifies geometric elements and pairwise topological relations in a hierarchical tree with fixed graph topology and duplicated nodes.Node features carry geometry, while near-identical duplicates encode topology.
  • Geometry Encoding: Face and edge nodes combine bounding-box position features with latent codes obtained by compressing sampled surface or curve points.Faces use UV-grid samples, while edges use samples along the curve parameter.
  • Geometry Encoding: Vertex nodes encode only their 3D point coordinates because vertices have no additional shape details.This gives each primitive a feature suited to its geometric type.
  • Topology Encoding: Mating duplication copies shared edges and vertices under adjacent parents, transforming the B-rep graph into a tree while preserving adjacency information.Shared edge and vertex copies retain identical geometry features.
  • Topology Encoding: Association duplication pads variable numbers of faces and edges to fixed branching factors, and repeated children under a parent can later be removed to recover associations.Random duplication padding was found to produce fewer missing faces and edges than zero-padding.

4 METHOD

BrepGen combines compressed face and edge geometry with a hierarchical latent diffusion process that generates B-rep features from root to leaf. Post-processing detects duplicated nodes, merges them, and refines geometry to recover topology and produce a CAD B-rep.

  • 4.1 Overview: BrepGen uses two VAEs to compress face and edge shape features, while a latent diffusion module sequentially denoises tree node features from root to leaf.The face VAE uses 2D convolutions, the edge VAE uses 1D convolutions, and the diffusion module operates on compressed geometry and global position.
  • 4.2 Latent Diffusion Module: The diffusion process adds Gaussian noise to node features, and Transformer denoisers learn to predict that noise for iterative reconstruction.The clean node features include face position, face latent geometry, edge position, and joint edge-vertex latent geometry.
  • 4.2.2 Sequential Denoising: Sequential generation denoises faces, edges, and vertices top-down, conditioning edges on parent faces and latent geometry on global position.Separate denoising networks are used for the conditional distributions, with parent-child relations directly injecting face conditions into edge tokens.
  • 4.3 B-rep Post-Processing: The method detects duplicate nodes using bounding-box and decoded-shape similarity, prunes repeated geometry, and merges shared nodes to recover associations and topology.The procedure uses a 0.08 Euclidean bounding-box threshold and a 0.2 decoded point-wise difference threshold, then identifies shared edges and vertices across parents.
  • 4.3 B-rep Post-Processing: Geometry is fine-tuned after topology recovery by averaging duplicate vertices and aligning edge and face geometry to their associated boundaries.Edges are scaled, translated, and flipped when needed, while face points are fitted to associated edges by minimizing Chamfer Distance.

5 FURNITURE B-REP DATASET

The Furniture B-rep Dataset provides human-designed CAD models across ten furniture categories, including freeform surfaces and canonical labels. Dataset statistics describe category counts, solid counts, and face and edge complexity.

  • Dataset Overview: The Furniture B-rep Dataset contains 6,171 B-rep CAD models across 10 common furniture categories.Models were exported from the public Onshape design library and manually filtered, categorized, deduplicated, quality-checked, and canonically oriented.
  • Dataset Overview: The dataset is presented as the first B-rep collection combining human-designed 3D models, freeform surfaces, and canonical category labels.The source models come from publicly available Onshape designs and include more varied geometry than datasets limited to synthetic or canonical parts.
  • Dataset Statistics: Dataset statistics report the number of B-rep models per category, the number of solid bodies per model, and distributions of face and edge counts.These statistics are visualized in Figure 5 for analyzing dataset composition and geometric complexity.

6 EXPERIMENTS

BrepGen is evaluated on mechanical, furniture, and industrial CAD datasets using distribution and CAD validity metrics. Qualitative results show diverse, realistic, structurally complex B-reps with fewer broken regions and correct topological connections.

  • 6.1 Experimental Setup: Experiments cover DeepCAD mechanical parts, the Furniture B-rep Dataset, and the ABC industrial-design dataset.The evaluation uses the original DeepCAD split and preprocessing for closed faces and duplicate training models.
  • 6.1 Experimental Setup: Training uses PyTorch on four NVIDIA RTX A5000 GPUs with half precision, AdamW optimization, and diffusion-specific beta scheduling.The latent diffusion module uses 1,000 diffusion steps with a linear beta schedule from 1e-4 to 0.02.
  • 6.1 Unconditional Generation: BrepGen generates realistic and diverse DeepCAD B-reps with more complex topology, fewer broken regions, and correct topological connections than the shown baselines.Figure 6 compares DeepCAD, SolidGen, and BrepGen on unconditional mechanical-part generation.
  • 6.1 Experimental Setup: Inference combines PNDM fast sampling with slower DDPM denoising for face and edge positions, while augmentation and token-count choices address train-test differences.The slower position denoisers are used to obtain more precise bounding-box locations.
  • 6.1 Experimental Setup: Generation quality is measured with distribution metrics from sampled surface points and CAD metrics for novelty, uniqueness, and watertight validity.The distribution evaluation uses 3,000 generated B-reps and 1,000 reference test B-reps, while CAD metrics use the generated set.

6.2 Unconditional B-rep Generation

BrepGen generates diverse, realistic B-rep CAD models with complex geometry and topology, outperforming baselines on DeepCAD metrics and matching the training distribution more closely. It also produces novel shapes and supports unconditional generation on ABC.

  • Quantitative Evaluation: BrepGen consistently outperforms DeepCAD and SolidGen on DeepCAD COV, MMD, and JSD metrics, with improved generation quality and distribution matching.The evaluation averages results over 20 runs; Table 1 also reports BrepGen results on ABC.
  • Unconditional Generation: BrepGen generates realistic CAD B-reps with complicated geometry and topology on the ABC dataset.
  • Quantitative Evaluation: Its generated face, edge, and vertex distributions most closely match the DeepCAD training distribution among the compared methods.
  • Unconditional Generation: The method produces appealing B-reps with diverse topologically connected faces and fewer unbounded open regions or self-intersecting edges than baselines.
  • Shape Novelty Analysis: Generated BrepGen shapes are realistic yet novel, differing in topology and geometry from their closest retrieved training examples.Novelty is assessed using Chamfer Distance and Light Field Distance over 500 generated samples.

6.3 Controllable B-rep Generation

BrepGen supports controllable CAD generation through class conditioning, face-based autocomplete, and design interpolation. These applications preserve or generate complex B-rep geometry and topology, including free-form surfaces and smooth transitions between designs.

  • Controllable Generation: The Furniture B-rep experiments use permutation-invariant token processing, eliminating the need for a fixed order between existing and generated components.
  • Class-conditioned Generation: Class-conditioned BrepGen generates category-specific CAD models with correct topological connections, free-form surfaces, and watertight solids.The generated edges form connected wireframes whose loops trim faces into solids.
  • CAD Autocomplete: Face-conditioned autocomplete completes partial B-reps into diverse full geometries and topologies while regenerating subsequent edges and vertices.
  • Design Interpolation: Design interpolation produces directly generated B-reps whose geometry and topology change smoothly from source to target.The interpolation progressively adds target face tokens and then removes source tokens.

6.4 Ablation Studies

The ablations examine separate topology and geometry generation, topology validity, and post-processing thresholds. They show that unconditional incidence-matrix generation is challenging, while validity depends on threshold choices.

  • Two-stage Generation: The two-stage ablation generates topology first and geometry second, conditioning geometry on ground-truth topology instead of using unified node duplication.
  • Topology Ablation: Unconditionally generating the face-edge and edge-vertex incidence matrix is challenging and yields a very low valid ratio.Topology is valid only when incidence constraints and closed-loop requirements are satisfied.

6.5 Failure Cases

BrepGen has three common failure categories: missing faces that produce non-watertight solids, self-intersections that break trimmed geometry, and noisy or inconsistent geometry.

  • Failure Categories: Missing faces can produce non-watertight solids, a failure BrepGen cannot guarantee against.The paper suggests detecting and denoising additional faces in open regions as a potential remedy.
  • Failure Categories: Self-intersecting edges or faces can lead to broken geometry after trimming.The paper suggests integrating a self-intersection loss to reduce such occurrences.
  • Failure Categories: Wobbly or broken geometry is caused mainly by noise in decoded points or inconsistency between surfaces and connected edges.

7 LIMITATIONS AND FUTURE WORK

BrepGen has several limitations concerning supported model structure, geometric separation, and validity of generated solids.

  • BrepGen supports only single-body solids, leaving CAD models with multiple assembled bodies for future work.
  • A 0.05 normalized-distance threshold can merge sufficiently close edges or faces during deduplication.The geometry is normalized to [−3, 3], and the threshold is roughly equivalent to one bin difference after 7-bit quantization.
  • BrepGen does not guarantee watertight solids because denoising may leave small gaps or occasionally omit entire faces.The authors report a higher valid ratio than other architectures despite this limitation.

8 CONCLUSION

BrepGen directly generates B-rep models with diffusion and achieves state-of-the-art generation results. Its Furniture B-rep Dataset experiments demonstrate complicated free-form and doubly-curved geometry generation.

  • BrepGen surpasses existing methods and establishes state-of-the-art results for B-rep generation.
  • Experiments on the Furniture B-rep Dataset demonstrate generation of complicated 3D models with free-form and doubly-curved surfaces.
Loading 2401.15563v3…