Skip to content
AI.info

Research

Towards Valid B-Rep Generation: Training-Free Wireframe Anomaly Detection and Repair

Overview Research area: Generative modeling of Boundary Representation (B-Rep) CAD models, specifically anomaly detection and test-time repair of intermediate wireframes in multi-stage B-Rep generatio

arXiv
2608.04955
Published
2026-08-05
Authors
Jingyu Wu, Youcheng Cai, Tengyu Luo, Ligang Liu

AI summary

Overview

  • Research area: Generative modeling of Boundary Representation (B-Rep) CAD models, specifically anomaly detection and test-time repair of intermediate wireframes in multi-stage B-Rep generation pipelines.
  • Technical level: Advanced. The paper assumes familiarity with B-Rep topology (vertices, edges, loops, faces, shells), diffusion models, autoregressive token generation, classifier-free/TFG-style guidance, and CAD kernel validity checking (OpenCASCADE / PythonOCC).
  • Scope: The paper introduces WDR (Wireframe Detection and Repair), a training-free, plug-and-play module that detects geometric and topological risks in intermediate wireframes and guides their regeneration so that downstream B-Reps pass kernel validity checks, evaluated across three generators (DTGBrepGen, Stitch-A-Shape, BrepForge) and three datasets (DeepCAD, ABC, Furniture).

What This Paper Is About

Multi-stage B-Rep generators first produce an intermediate wireframe and then complete it into geometry, but geometric and topological defects in that wireframe (self-intersections, edge collapses, disconnected vertices) propagate into final models that fail CAD kernel validity checks. Retraining large generative models to fix this is computationally and data intensive, so the paper asks whether a training-free module can intervene at the wireframe stage instead. WDR is that module: it screens intermediate wireframes for downstream invalidity risk and steers regeneration without modifying any generator weights.

Key Contributions

  1. A training-free, plug-and-play wireframe detection and repair framework (WDR) that operates on the intermediate wireframes of multi-stage B-Rep generation pipelines and improves output validity without retraining the generators. It is not a post-processing filter over a completed B-Rep; it intervenes before geometry completion.
  2. The Geometric-Topology Anomaly Detector (GTAD), which combines parallel VLM-based coarse screening with geometric (discrete tangent-point) and topological (four constraint-based) detectors to predict downstream invalidity risk and route generation to dedicated guidance branches.
  3. The Energy-Guided Geometric-Topology Repair (EGGTR) module, with a geometry branch that biases regenerated coordinates away from high-risk configurations and a topology branch that reranks regenerated connectivity variables, performing detector-triggered guided regeneration and local candidate reranking.
  4. Two forms of test-time compute scaling: Energy-Guided Resampling for autoregressive stages (local candidate reranking during decoding with K = 4) and training-free guidance extended to diffusion-based geometry generation via TFG, applied while preserving the original generator condition.

Main Findings

  • Unconditional validity improves substantially. On DeepCAD, DTGBrepGen rises from 79.5 to 95.6 Valid, Stitch-A-Shape from 84.2 to 97.0, and BrepForge from 85.3 to 97.4. On ABC, DTGBrepGen rises from 68.1 to 83.9, Stitch-A-Shape from 56.6 to 83.5, and BrepForge from 75.4 to 86.3. The paper summarizes this as an improvement in Valid of 10.9–26.9 percentage points while largely retaining Novel and Unique and comparable COV, MMD, and JSD.
  • Class-conditioned validity improves on Furniture. The ten-class macro-average Valid rises from 64.36% to 73.63% for DTGBrepGen and from 58.59% to 68.04% for Stitch-A-Shape.
  • Point-cloud-conditioned reconstruction improves in validity and fidelity simultaneously. Over the same 3,000 BrepForge conditions, Valid rises from 87.1% to 89.3% (+2.2), CD drops from 0.93 to 0.87, EMD drops from 2.45 to 2.19, and F-Score rises from 0.91 to 0.94, with failed reconstructions retained in all metrics.
  • All three detector signals are complementary. Held-out downstream-risk F1 is 81.97% for the combined VLM + geometric + topological detector, above VLM (71.30), geometric (65.40), topological (74.75), VLM + geometric (69.57), VLM + topological (74.86), and geometric + topological (69.65).
  • Selective routing works nearly as well as always-on repair while intervening less. Full GTAD routing reaches 83.9% Valid, only 0.4 points below always-on EGGTR, while reducing Valid-to-Invalid regressions from 211 to 79; matched random routing reaches 80.2%.
  • The topology branch is the stronger single correction. On DTGBrepGen/ABC, geometry-only regeneration improves Valid by 4.8 points (to 72.9) and topology-only by 9.3 points (to 77.4), identifying connectivity errors as the stronger bottleneck in that setting.
  • Local reranking beats global alternatives at equal K. Combined geometry and topology repair with K = 4 local resampling reaches 83.9% Valid (+15.8), versus rejection sampling at 73.6 (+5.5) and parallel Best-of-N at 80.7 (+12.6) — 3.2 points above Best-of-4 — while retaining 99.9% Novel and 99.3% Unique.
  • The VLM backbone choice is empirical. On ABC development data, qwen-3.5-flash scores the highest F1 (71.85) with mean latency 1678.1 ms, versus gemini-3-flash (68.68, 1153.4 ms), gpt-5.4-mini (68.06, 2136.3 ms), and claude-haiku-4.5 (63.58, 1567.2 ms).
  • The geometric detector is a soft risk score, not a predicate. On 1,000 controlled cases each, it flags 795 interior-crossing cases (mean/median energy 7.47/7.89), 832 near-collapsed-edge cases (8.23/9.10), and only 67 legal near-contact cases (2.18/3.54). On an independent cohort of 2,682 valid ABC samples with thin, narrow, or slender structures, mean energy is 2.18 and 7.16% are flagged at the δ = 7.0 threshold.
  • Failure modes remain. The paper documents GTAD misclassification and EGGTR guided-regeneration failures, and states that WDR may encounter detector errors, unrecoverable corruptions, or condition drift.

Methodology in Plain English

The pipeline is split into diagnosis and correction.

First, diagnosis (GTAD). Given an intermediate wireframe, three detectors run in parallel. A vision-language model looks at multi-view renderings of the wireframe and returns a binary "looks risky" flag; it is used only as a routing trigger, not as a validity certificate or a numeric repair signal. A geometric detector computes a discrete tangent-point energy averaged over wireframe edges, which is high when curves approach self-intersection; if it exceeds δ = 7.0, the geometry branch activates. A topological detector runs four structural checks — Vertex-Edge, Edge-Loop, Loop-Face, and Face-Shell constraints — and sums their violation scores; if the sum is greater than zero, the topology branch activates. A positive VLM signal activates both branches. The wireframe is accepted untouched only if all three detectors are negative.

Second, correction (EGGTR). When branches are active, the generator regenerates the wireframe under the same conditioning, guided by whichever branch is active. For autoregressive generators, instead of generating N complete sequences and picking the best afterwards, the method performs local energy-aware reranking during decoding: at each token position it draws at most K = 4 candidate continuations, computes the local change in structural energy from the recoverable partial wireframe, and deterministically picks the candidate minimizing the sum of negative log-likelihood and the energy increment. This keeps the accepted prefix and rejects risky continuations early. For diffusion-based geometry generation, the framework adapts TFG-style training-free guidance, tilting the conditional distribution toward lower geometry energy through a guided reverse update while preserving the original condition.

Evaluation uses OCCT/PythonOCC kernel validity (watertightness, loop integrity, shell consistency), with 3,000 generated samples and 1,000 references for unconditional evaluation, all experiments on an NVIDIA A100 GPU, and generator weights and conditioning interfaces left unchanged.

Why This Matters

The paper reframes invalid B-Rep generation as a problem to be fixed at inference time rather than through expensive retraining, and shows that a diagnosis-plus-localized-correction split can raise kernel validity across three different generator families and both autoregressive and diffusion stages. Because "repair" is guided regeneration rather than deterministic editing, the method does not require a completed wireframe and does not narrow output diversity in the measured metrics. The authors are explicit that this optimizes an operational OCCT-based criterion and does not by itself establish manufacturability or downstream functional performance.

Real-world applications:

  • CAD model generation and design automation, where generated models must be editable, watertight solids rather than visually plausible but structurally broken shapes.
  • Physical simulation and analysis, which requires closed, manifold solids as input.
  • Precision manufacturing workflows, where models failing kernel checks cannot be processed downstream.
  • Point-cloud-to-CAD reconstruction from scans or sensing data, where the paper reports both higher validity and better agreement with the input point cloud.

Industry relevance: CAD vendors and engineering software teams that rely on kernel-valid geometry have a direct stake in validity rates; the plug-and-play nature means existing generator deployments could add the module at inference without retraining pipelines, at the cost of additional inference computation and the requirement that a wireframe stage be exposed.

Future Directions

  • More efficient CAD-specific detectors, replacing or supplementing the general-purpose VLM screening with cheaper, geometry-aware models.
  • Condition-aware guidance, addressing condition drift so that repair does not push outputs away from the input condition.
  • Adaptive stopping, since WDR adds inference cost and always-on repair is only 0.4 points better than selective routing in the reported ablation.
  • Extensions to representations without explicit wireframes, plus handling of detector errors and unrecoverable corruptions documented in the failure cases.
  • Open question on overhead: the paper reports VLM latency by backbone but does not report an overall wall-clock cost of the full WDR pipeline; the total overhead of the framework is not reported.

Target Audience

Researchers and graduate students working on generative CAD and B-Rep synthesis, 3D deep learning, and test-time compute scaling for structured output generation; practitioners integrating generative models into CAD or simulation pipelines who need higher kernel-validity rates without retraining; and readers interested in combining multimodal screening signals with energy-based guidance for discrete and continuous structured generation.

Authors’ abstract

Multi-stage boundary representation (B-Rep) generation leverages intermediate wireframes to synthesize CAD models. However, geometric and topological risks in these wireframes -- such as self-intersections, edge collapses, and disconnected vertices -- can propagate to invalid final B-Reps. Mitigating such failures by retraining large generative models is computationally prohibitive. We propose Wireframe Detection and Repair (WDR), a training-free framework that intervenes at the intermediate wireframe stage to improve downstream B-Rep validity. WDR features a Geometric-Topology Anomaly Detector (GTAD) that combines parallel VLM-based coarse screening with geometric and topological detectors to predict downstream invalidity risk and route generation to dedicated branches. An Energy-Guided Geometric-Topology Repair (EGGTR) module then performs detector-triggered guided regeneration through geometry and topology branches. By scaling test-time computation via Energy-Guided Resampling and training-free guidance for diffusion models, WDR can be integrated into autoregressive and diffusion pipelines without retraining. Extensive experiments demonstrate consistent improvements in kernel-checked validity while largely retaining the measured diversity and distributional quality of synthesized CAD models. The code will be made publicly available upon acceptance.

Read the original paper