Computational fabrication is increasingly popular among end-users and makers in the form of 3D printing and laser cutting. Using Computer-Aided Design (CAD) tools to construct models from scratch is a significant barrier to entry for new users, so many online repositories provide ready-to-print though difficult-to-edit triangle meshes of popular designs. Recent work has proposed program synthesis techniques to automatically decompile triangle meshes to easier-to-edit Constructive Solid Geometry (CSG) designs. While these synthesized CSG designs simplify editing some models, they are flat, i.e., they do not contain loops or other forms of parameterization, which makes editing designs with repeated structurechallenging . This paper presents an algorithm for lifting CSG designs to CAD programs , preserving equivalence to the original CSGs but parameterizing over repetitive structures. Our technique takes as input a flat CSG and infers parameters that capture the latent structure of the CSG using an equality-graph based rewrite mechanism combined with constraint solvers for inferring arithmetic operations. Our algorithm synthesizes CAD programs with (possibly nested) loops and arithmetic expressions including trigonometric functions. We implemented our algorithm in a tool called tool and evaluated it by running it on 16 designs collected from popular model-sharing websites and found that it reduces code size by 64\% on average, and exposes the underlying structure for 81\% of the models .
Recent program synthesis techniques help users customize CAD models(e.g., for 3D printing) by decompiling low-level triangle meshes to Constructive Solid Geometry (CSG) expressions. Without loops or functions, editing CSG can require many coordinated changes, and existing mesh decompilers use heuristics that can obfuscate high-level structure . This paper proposes a second decompilation stage to robustly "shrink" unstructured CSG expressions into more editable programs with map and fold operators. We present Szalinski, a tool that uses Equality Saturation with semantics-preserving CAD rewrites to efficiently search for smaller equivalent programs. Szalinski relies on inverse transformations, a novel way for solvers to speculatively add equivalences to an E-graph. We qualitatively evaluate Szalinski in case studies, show how it composes with an existing mesh decompiler, and demonstrate that Szalinski can shrink large models in seconds .
R
Computational fabrication is increasingly popular among end-users and makers in the form of 3D printing and laser cutting. Using Computer-Aided Design (CAD) tools to construct models from scratch is a significant barrier to entry for new users, so many online repositories provide ready-to-print though difficult-to-edit triangle meshes of popular designs. Recent work has proposed
Recent
R
to automatically decompile
help users customize CAD models(e.g., for 3D printing) by decompiling low-level
D
easier-to-edit
R
designs. While these synthesized CSG designs simplify editing some models, they are flat, i.e., they do not contain loops or other forms of parameterization, which makes editing designs with repeated structurechallenging
expressions. Without loops or functions, editing CSG can require many coordinated changes, and existing mesh decompilers use heuristics that can obfuscate high-level structure
R
presents an algorithm for lifting CSG designs to CAD programs , preserving equivalence to the original CSGs but parameterizing over repetitive structures. Our technique takes as input a flat CSG and infers parameters that capture the latent structure of the CSG using an equality-graph based rewrite mechanism combined with constraint solvers for inferring arithmetic operations. Our algorithm synthesizes CAD programs with (possibly nested) loops and arithmetic expressions including trigonometric functions. We implemented our algorithm in a tool called tool and evaluated it by running it on 16 designs collected from popular model-sharing websites and found that it reduces code size by 64\% on average, and exposes the underlying structure for 81\% of the models
proposes a second decompilation stage to robustly "shrink" unstructured CSG expressions into more editable programs with map and fold operators. We present Szalinski, a tool that uses Equality Saturation with semantics-preserving CAD rewrites to efficiently search for smaller equivalent programs. Szalinski relies on inverse transformations, a novel way for solvers to speculatively add equivalences to an E-graph. We qualitatively evaluate Szalinski in case studies, show how it composes with an existing mesh decompiler, and demonstrate that Szalinski can shrink large models in seconds