Formalizing Linear Motion G-code for Invariant Checking and Differential Testing of Fabrication Tools

๐Ÿ“… 2025-08-31
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
The absence of formal verification methods for G-code linear motion in 3D printing hinders assurance of geometric-code consistency. Method: This paper proposes a dimension-elevated semantic representation framework that parses G-code into sets of axis-aligned bounding boxes and their approximated point clouds, integrating geometric modeling with program analysis to enable invariant checking and differential testing across the manufacturing pipeline. Contribution/Results: The framework supports, for the first time, quantitative cross-slicer comparison (Cura vs. PrusaSlicer), error localization, and root-cause analysis of defects introduced during mesh repair (e.g., in MeshLab or Meshmixer). Evaluated on 58 real-world models, it efficiently detects slicing anomalies induced by small geometric features, exposes behavioral discrepancies among mainstream slicers, and identifies new errors inadvertently introduced during repairโ€”thereby significantly enhancing the verifiability and reliability of end-to-end additive manufacturing pipelines.

Technology Category

Application Category

๐Ÿ“ Abstract
The computational fabrication pipeline for 3D printing is much like a compiler - users design models in Computer Aided Design (CAD) tools that are lowered to polygon meshes to be ultimately compiled to machine code by 3D slicers. For traditional compilers and programming languages, techniques for checking program invariants are well-established. Similarly, methods like differential testing are often used to uncover bugs in compilers themselves, which makes them more reliable. The fabrication pipeline would benefit from similar techniques but traditional approaches do not directly apply to the representations used in this domain. Unlike traditional programs, 3D models exist both as geometric objects as well as machine code that ultimately runs on the hardware. The machine code, like in traditional compiling, is affected by many factors like the model, the slicer being used, and numerous user-configurable parameters that control the slicing process. In this work, we propose a new algorithm for lifting G-code (a common language used in fabrication pipelines) by denoting a G-code program to a set of cuboids, and then defining an approximate point cloud representation for efficiently operating on these cuboids. Our algorithm opens up new opportunities: we show three use cases that demonstrate how it enables error localization in CAD models through invariant checking, quantitative comparisons between slicers, and evaluating the efficacy of mesh repair tools. We present a prototype implementation of our algorithm in a tool, GlitchFinder, and evaluate it on 58 real-world CAD models. Our results show that GlitchFinder is particularly effective in identifying slicing issues due to small features, can highlight differences in how popular slicers (Cura and PrusaSlicer) slice the same model, and can identify cases where mesh repair tools (MeshLab and Meshmixer) introduce new errors during repair.
Problem

Research questions and friction points this paper is trying to address.

Formalizing G-code for invariant checking in fabrication tools
Enabling error localization in CAD models through differential testing
Quantitative comparison of slicers and mesh repair tool efficacy
Innovation

Methods, ideas, or system contributions that make the work stand out.

Lifting G-code to cuboid representation
Approximate point cloud for efficient operations
Enabling invariant checking and differential testing
๐Ÿ”Ž Similar Papers
2024-07-04Neural Information Processing SystemsCitations: 0
Y
Yumeng He
University of Utah, USA
C
Chandrakana Nandi
Certora Inc. and University of Washington, USA
Sreepathi Pai
Sreepathi Pai
University of Rochester
Heterogeneous Computer SystemsCompilersProgramming SystemsComputer Architecture