Lune

OOPSLA2025Top-tier venue

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

Yumeng He, Chandrakana Nandi, Sreepathi Pai

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 frequently 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 (a CAD model or a polygon mesh) 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 many 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 (1) error localization in CAD models through invariant checking, (2) quantitative comparisons between slicers, and (3) 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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • babble: Learning Better Abstractions with E-Graphs and Anti-unification cites Synthesizing structured CAD models with equality saturation and inverse transformations
  • babble: Learning Better Abstractions with E-Graphs and Anti-unification cites ShapeMOD: macro operation discovery for 3D shape programs
  • ShapeMOD: macro operation discovery for 3D shape programs cites Synthesizing structured CAD models with equality saturation and inverse transformations
  • Taxon: a Language for Formal Reasoning with Digital Fabrication Machines cites Synthesizing structured CAD models with equality saturation and inverse transformations
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Semantics for 2D RasterizationBhargav Kulkarni, Henry Whiting, Pavel PanchekhaOOPSLA 2026

Builds on6

  1. Synthesizing structured CAD models with equality saturation and inverse transformationsChandrakana Nandi, Max Willsey, Adam Anderson, James R. Wilcox et al.PLDI 2020 · 65 citations
  2. babble: Learning Better Abstractions with E-Graphs and Anti-unificationDavid Cao, Rose Kunkel, Chandrakana Nandi, Max Willsey et al.POPL 2023 · 38 citations
  3. Imprimer: Computational Notebooks for CNC MillingJasper Tran O'Leary, Gabrielle Benabdallah, Nadya PeekCHI 2023 · 31 citations
  4. ShapeMOD: macro operation discovery for 3D shape programsR. Kenny Jones, David Charatan, Paul Guerrero, Niloy J. Mitra et al.SIGGRAPH 2021 · 24 citations
  5. Taxon: a Language for Formal Reasoning with Digital Fabrication MachinesJasper Tran O'Leary, Chandrakana Nandi, Khang Lee, Nadya PeekUIST 2021 · 9 citations

Related papers

  1. From Copy/Paste to Copying Pastes: Supporting Replication in an Online Digital Fabrication CommunityBlair Subbaraman, Nadya PeekCHI 2026 · 1 citation
  2. CADReview: Automatically Reviewing CAD Programs with Error Detection and CorrectionJiali Chen, Xusen Hei, Hongfei Liu, Yuancheng Wei et al.ACL 2025
  3. VisiPrint: Previewing 3D-Print Appearance from Real Material SamplesMaxine Perroni-Scharf, Faraz Faruqi, Sooyeon Ahn, Raul Hernandez et al.CHI 2026 · 1 citation
  4. SplatOverflow: Asynchronous Hardware TroubleshootingAmritansh Kwatra, Tobias M. Weinberg, Ilan Mandel, Ritik Batra et al.CHI 2025 · 12 citations
  5. G-ID: Identifying 3D Prints Using Slicing ParametersMustafa Doga Dogan, Faraz Faruqi, Andrew Day Churchill, Kenneth Friedman et al.CHI 2020 · 46 citations
Dusk over the sea between two cliffs drawn in fine vertical lines