Technique breaks down complex CAD models into the individual shapes they’re made of. (Image courtesy of researchers)
Nearly all commercial products start as a CAD file, a 2D or 3D model with the product’s design specifications. One method that’s widely used to represent today’s 3D models is constructive solid geometry (CSG), a technique where numerous basic shapes, or “primitives,” with a few adjustable parameters can be assembled in various ways to form a single object. When finalised, the compiled digital object is converted to a mesh of 3D triangles that defines the object’s shape. These meshes are used as input for many applications, including 3D printing and virtual simulation.
Customising that mesh, however, is no easy task. With complex models comprising thousands of triangles, customisation becomes daunting and time-consuming. Traditional techniques to convert triangle meshes back into shapes don’t scale well to complex models or work accurately on low-resolution, noisy files.
In a paper presented at the AMC SIGGRAPH Asia conference, MIT researchers describe a system that applies a technique called program synthesis to break down CAD models into their primitive shapes. Program synthesis automatically constructs computer programs based on a set of grammars. Essentially, to build CAD models, designers assemble individual shapes into a final object; the researchers’ method does the reverse, disassembling the CAD models into individual shapes that can be edited. As input, the system takes a 3D triangle mesh and first determines the individual shapes that make it up. Program synthesis crawls through the shapes, trying to figure out how the shapes were put together and assembled into the final model. The final shapes contain editable parameters for users to tweak that can be re-uploaded to the mesh.
After the system receives an input mesh, a preprocessing step detects the possible locations, orientations, and parameters of all primitive shapes. This process creates a massive point cloud across the surface of the triangle mesh. A special “primitive-detection” algorithm infers from these points the dimensions for each primitive shape that makes up the mesh.
The researchers then sample tons of points in the entire 3D space and flag them as either inside or outside the mesh. This helps determine how the shapes converge or relate to one another. A simple example is a mesh consisting of two spheres, A and B, merged together. If one sampled point falls inside sphere A, one inside sphere B, and one at the intersection of the two (inside both A and B), it’s most likely a union of the two shapes.
Given this information, along with the primitive dimensions, program synthesis could potentially create a CGS tree. But, 3D meshes of even low complexity would require program synthesis to sample tens of thousands of points. This would create a massive search space that’s computationally impractical to handle.
To ensure the system worked efficiently, the researchers designed a sampling method that creates several small subsets of point samples across the 3D space, which is much easier for program synthesis to compute. By sampling these subsets, it creates a new candidate “program,” or CGS tree, that could be considered correct. After numerous iterations —and using techniques to eliminate certain points and trees —the system lands on the correct CGS tree for each shape, with correct intermediate steps and final parameters. Any edited shapes are fed back into the mesh as the system computationally follows the intermediate steps back to the final object.
Get your FREE print subscription to TCT Magazine.
Exhibit at the UK's definitive and most influential 3D printing and additive manufacturing event, TCT 3Sixty.
The process could be useful in manufacturing or when combined with 3D printing software. This is especially important in the age of design sharing, where amateur 3D printer users upload 3D print models to websites for online communities to download and modify. Uploads are mostly triangle meshes because meshes are far more universally accepted across platforms than the original CSG-based CAD files. The system can potentially handle other formats like point clouds by adding a preprocessing step.