1. Introduction
While optimizing designs for fabrication is a longstanding and well studied engineering problem, the vast majority of the work in this area assumes that there is a unique map from a design to a fabrication plan. In reality, however, many applications allow for multiple fabrication alternatives. Consider, for example, the model shown in Figure 1 where different fabrication plans trade off material cost and fabrication time. In this context, fabricationoriented design optimization becomes even more challenging, since it requires exploring the landscape of optimal fabrication plans for many design variations. Every variation of the original design (Figure 1) determines a new landscape of fabrication plans with different cost tradeoffs. Designers must therefore navigate the joint space of design and fabrication plans to find the optimal landscape of solutions.
In this work, we present a novel approach that simultaneously optimizes both the design and fabrication plans for carpentry. Prior work represents carpentry designs and fabrication plans as programs [Wu et al., 2019] to optimize the fabrication plan of a single design at a time. Our approach also uses a programlike representation, but we jointly optimize the design and the fabrication plan.
Our problem setting has two main challenges. First, the discrete space of fabrication plan alternatives can vary significantly for each discrete design variation. This setup can be understood as a bilevel problem, characterized by the existence of two optimization problems in which the constraint region of the upperlevel problem (the joint space of designs and fabrication plans) is implicitly determined by the lowerlevel optimization problem (the space of feasible fabrication plans given a design). The second challenge is that there are multiple conflicting fabrication objectives. Plans that improve the total production time may waste more material or involve less precise cutting operations. Our goal is therefore to find multiple solutions to our fabrication problem that represent optimal points in the landscape of possible tradeoffs, called the Pareto front. Importantly, the different fabrication plans on the Pareto front may come from different design variations. The complexity of the bilevel search space combined with the need for finding a landscape of Paretooptimal solutions makes this optimization challenging.
We propose a method to make this problem computationally tractable in light of the challenges above. Our key observation is that there is redundancy on both levels of the search space that can be exploited. In particular, different design variations may share similar subsets of parts, which can use the same fabrication plans. We propose exploiting this sharing to encode a large number of design variations and their possible fabrication plans compactly. We use a data structure called an equivalence graph (egraph) [Nelson, 1980] to maximize sharing and thus amortize the cost of heavily optimizing part of a design since all other design variations sharing a part benefit from its optimization.
Egraphs have been growing in popularity in the programming languages community; they provide a compact representation for equivalent programs that can be leveraged for theorem proving and code optimization. There are two challenges in directly applying to design optimization under fabrication variations, detailed below.
First, the different fabrication plans for a given design are all semantically equivalent programs. However, the fabrication plans associated with different design variations, in general, are not semantically equivalent, i.e., they may produce different sets of parts. This makes it difficult to directly apply traditional techniques which exploit sharing by searching for minimal cost, but still semantically equivalent, versions of a program. One of our key technical contributions is therefore a new data structure for representing the search space, which we call the BagofParts (BOP) Egraph. This data structure takes advantage of common substructures across both design and fabrication plans to maximize redundancy and boost the expressive power of egraphs.
Second, optimization techniques built around egraphs have adopted a two stage approach: expansion (incrementally growing the egraph by including more equivalent programs^{1}^{1}1In the programming languages literature, this is known as equality saturation.) followed by extraction (the process of searching the egraph for an optimal program). In particular, the expansion stage has not been feedbackdirected, i.e., the cost of candidate programs has only been used in extraction, but that information has not been fed back in to guide further egraph expansion. A key contribution of our work is a method for Iterative Contraction and Expansion on Egraphs (ICEE). Because ICEE is feedbackdirected, it enables us to effectively explore the large combinatorial space of designs and their corresponding fabrication plans. ICEE also uses feedback to prune the least valuable parts of the egraph during search, keeping its size manageable. Further, these expansion and contraction decisions are driven by a multiobjective problem that enables finding a diverse set of points on the Pareto front.
We implemented our approach and compared it against prior work and against results generated by carpentry experts. Our results show that ICEE is up to faster than prior approaches while achieving similar results. In some cases, it is the only approach that successfully generates an optimal set of results due to its efficiency in exploring large design spaces. We showcase how our method can be applied to a variety of designs of different complexity and show how our method is advantageous in diverse contexts. For example we achieve 25% reduced material in one model, 60% reduced time in another, and 20% saved total cost in a third when assuming a carpenter charges $40/h, when compared to a method that does not explore design variations.
2. Related Work
Optimization for Design and Fabrication
Design for fabrication is an exciting area of research that aims to automatically achieve desired properties while optimizing fabrication plans. Examples of recent work include computational design of glass façades [Gavriil et al., 2020], compliant mechanical systems [Tang et al., 2020], barcode embeddings [Maia et al., 2019], and interlocking assemblies [Wang et al., 2019; Cignoni et al., 2014; Hildebrand et al., 2013], among many others [Bickel et al., 2018; Schwartzburg and Pauly, 2013]. Fabrication considerations are typically taken into account as constraints during design optimization, but these methods assume that there is an algorithm for generating one fabrication plan for a given design. To the best of our knowledge, no prior work explores the multiobjective space of fabrication alternatives during design optimization.
There is also significant literature on fabrication plan optimization for a given design under different constraints. Recent work includes optimization of composite molds for casting [Alderighi et al., 2019], tool paths for 3D printing [Zhao et al., 2016; Etienne et al., 2019], and decomposition for CNC milling [MahdaviAmiri et al., 2020; Yang et al., 2020]. While some of these methods minimize the distance to a target design under fabrication constraints [Zhang et al., 2019; Duenser et al., 2020], none of them explores a space of design modification to minimize fabrication cost.
In contrast, our work jointly explores the design and fabrication space in the carpentry domain, searching for the Paretooptimal design variations that minimize multiple fabrication costs.
Design and Fabrication for Carpentry
Carpentry is a wellstudied domain in design and fabrication due to its wide application scope. Prior work has investigated interactive and optimization methods for carpentry design [Umetani et al., 2012; Koo et al., 2014; Song et al., 2017; Garg et al., 2016; Fu et al., 2015]. There is also a body of work on fabrication plan optimization [Yang et al., 2015; Koo et al., 2017; Leen et al., 2019; Lau et al., 2011]. Closest to our work is the system of Wu et al. [2019], which represents both carpentry designs and fabrication plans as programs and introduces a compiler that optimizes fabrication plans for a single design. While our work builds on the domain specific languages (DSLs) proposed in that prior work, ours is centered on the fundamental problem of design optimization under fabrication alternatives, which has not been previously addressed.
BiLevel MultiObjective Optimization
Our problem and others like it are bilevel, with a nested structure in which each design determines a different space of feasible fabrication plans. The greatest challenge in handling bilevel problems lies in the fact that the lower level problem determines the feasible space of the upper level optimization problem. More background on bilevel optimization can be found in the book by Dempe [2018], as well as review papers by Lu et al. [2016] and Sinha et al. [2017].
Bilevel problems with multiple objectives can be even more challenging to solve [Dempe, 2018]. Some specific cases are solved with classical approaches, such as numerical optimization [Eichfelder, 2010] and the constraint method [Shi and Xia, 2001]
. Heuristicdriven search techniques have been used to address bilevel multiobjective problems, such as genetic algorithms
[Yin, 2000]and particle swarm optimization
[Halter and Mostaghim, 2006]. These methods apply a heuristic search to both levels in a nested manner, searching over the upper level with NSGAII operations, while the evaluating each individual call in a lowlevel NSGAII process [Deb and Sinha, 2009]. Our ICEE framework also applies a genetic algorithm during search. Different from past techniques, ICEE does not nest the twolevel search but rather reuses structure between different upperlevel feasible points. ICEE jointly explores both the design and fabrication spaces using the BOP Egraph representation.Egraphs
An is an efficient data structure for compactly representing large sets of equivalent programs. Egraphs were originally developed for automated theorem proving [Nelson, 1980], and were first adapted for program optimization by Joshi et al. [2002]. These ideas were further expanded to handle programs with loops and conditionals [Tate et al., 2009] and applied to a variety of domains for program optimization, synthesis, and equivalence checking [Stepp et al., 2011; Willsey et al., 2021; Nandi et al., 2020; Panchekha et al., 2015; Wu et al., 2019; Wang et al., 2020; Premtoon et al., 2020].
Recently, have been used for optimizing designs [Nandi et al., 2020], and also for optimizing fabrication plans [Wu et al., 2019], but they have not been used to simultaneously optimize both designs and fabrication plans. Prior work also does not explore feedbackdriven expansion and contraction for managing large optimization search spaces.
3. Background
In this section, we introduce some mathematical preliminaries used in the rest of the paper.
3.1. MultiObjective Optimization
A multiobjective optimization problem is defined by set of objectives that assign a real value to each point in the feasible search space . We choose the convention that small values of are desirable for objective .
As these objectives as typically conflicting, our algorithm searches for a diverse set of points that represent optimal tradeoffs, called Pareto optimal [Deb, 2014]:
Definition 3.1 (Pareto optimality).
A point is Pareto optimal if there does not exist any so that for all and for at least one .
We use to denote the concatenation . Pareto optimal points are the solution to the multiobjective optimization:
(1) 
The image of all Paretooptimal points is called the Pareto front.
NonDominated Sorting
Genetic algorithms based on nondominated sorting are a classic approach to multiobjective optimization [Deb et al., 2002; Deb and Jain, 2013]. The key idea is that sorting should be done based on proximity to the Pareto front. These papers define the concept of Pareto layers, where layer is the Pareto front, and layer is the Pareto front that would result if all solutions from layers to are removed. When selecting parent populations or when pruning children populations, solutions in lower layers are added first, and when a layer can only be added partially, elements of this layer are chosen to increase diversity. Different variations of this method use different strategies for diversity; we use NSGAIII [Deb and Jain, 2013] in our work.
Hypervolume
Hypervolume [Auger et al., 2009] is a metric commonly used to compare two sets of image points during Pareto front discovery. To calculate the hypervolume, we draw the smallest rectangular prism (axisaligned, as per the norm) between some reference point and each point on the pareto front. We then union the volume of each shape to calculate the hypervolume. Thus, a larger hypervolume implies a better approximation of the Pareto front.
3.2. Bilevel MultiObjective Optimization
Given a design space that defines possible variations of a carpentry model, our goal is to find a design and a corresponding fabrication plan
that minimizes a vector of conflicting objectives, where
is the space of fabrication plans corresponding to design . This setup yields the following multiobjective optimization problem:where defines the space of all possible plans for fabrication the design . Generally, our problem can be expressed as a bilevel multiobjective optimization that searches across designs to find those with the best fabrication costs, and requires optimizing the fabrication for each design during this exploration [Lu et al., 2016]:
where refers to Paretooptimal solutions to the multiobjective optimization problem.
A naïve solution to this bilevel problem would be to search over the design space using a standard multiobjective optimization method, while solving the nested optimization problem to find the fabrication plans given a design at each iteration. Given the combinatorial nature of our domain, this would be prohibitively slow, which motivates our proposed solution.
3.3. Equivalence Graphs (Egraphs)
Typically, programs (often referred to as terms) are viewed as treelike structures containing smaller subterms. For example, the term has the operator at its “root” and two subterms, and , each of which has no subterms. Terms can be expressed in multiple syntactically different ways. For example, in the language of arithmetic, the term is semantically equivalent to , but they are syntactically different. Naïvely computing and storing all semantically equivalent but syntactically different variants of the a term requires exponential time and memory. For a large program, this makes searching the space of equivalent terms intractable.
Egraphs [Nelson, 1980] are designed to address this challenge—an is a data structure that represents many equivalent terms efficiently by sharing subterms whenever possible. An not only stores a large set of terms, but it represents an equivalence relation over those terms, i.e., it partitions the set of terms into equivalence classes, or eclasses, each of which contains semantically equivalent but syntactically distinct terms. In Section 4.2, we show how to express carpentry designs in a way that captures the benefits of the .
Definition 3.2 (Egraph).
An is a set of equivalence classes or eclasses. An eclass is a set of equivalent enodes. An enode is an operator from the given language paired with some eclass children, i.e., is an enode where is an operator and each is an eclass that is a child of this enode. An enode may have no children, in which case we call it a leaf. An represents an equivalence relation over terms. Representation is defined recursively:

An represents a term if any of its eclasses do.

An eclass represents a term if any of its enodes do. All terms represented by enodes in the same eclass are equivalent.

An enode represents a term if each eclass represents term . A leaf enode represents just that term .
Figure 2 shows an example of an and representation. Note how the maximizes sharing even across syntactically distinct, semantically equivalent terms. When adding enodes or combining eclasses, the automatically maintains this maximal sharing property, using existing enodes whenever possible.
4. Optimization Algorithm
Our algorithm takes as input a carpentry design with a discrete set of possible design variations. Design variations determine different ways to decompose a 3D model into a set of fabricable parts, as shown in Figures 3 and 4. These can be manually or automatically generated (see Section 1.1 of the supplemental material).
Our goal is to find Paretooptimal solutions that minimize fabrication cost, where each solution is a pair of design variation and fabrication plan. Similar to prior work [Wu et al., 2019], we measure cost in terms of material usage (), cutting precision (), and fabrication time (). Section 1.3 of the supplemental material describes how these metrics are computed for this work.
4.1. Motivation and Insights
Given an algorithm for finding the Paretooptimal fabrication plans for a given design (e.g., the one proposed by Wu et al. [2019]), a brute force method would simply find the Paretooptimal solutions for each of the possible design variations and take the dominant ones to form the Pareto front of the combined design/fabrication space. Since design variations can produce an exponentially large space of designs , this approach would be intractable for complex models. An alternative approach could use a discrete optimization algorithm to explore the design space (e.g. hill climbing). This approach would still need to compute the Paretooptimal fabrication plans for each design explored in every iteration, which can expensive for complex design variants (e.g., it takes 810 minutes to compute Paretooptimal fabrication plans for a single design variation of the chair model in Figure 1 using the approach of Wu et al. [2019]).
We address these challenges with two key insights:

Design variants will share common subparts (both within a single variant and across different variants). As shown in Figure 3, even in a design where no two parts are the same, there is significant overlap across design variations. Exploiting this sharing can prevent recomputing the fabrication cost from scratch for every design variation. We propose using a to capture this sharing when (sub)designs have the same bag of parts; we call this the BOP Egraph.

The space of design variants is too large to exhaustively explore, and even a single variant may have many Paretooptimal fabrication plans. We propose using the BOP Egraph to guide the exploration in an incremental manner, with a new technique called ICEE (Iterative Contraction and Expansion of the Egraph) that jointly explores the design and fabrication plan spaces.
4.2. Bag of Parts (BOP) Egraph
Our algorithm selects a Paretooptimal set of fabrication plans, each of which will produce a design variation of the given model. A fabrication plan consists of four increasingly detailed things:

A bag of parts, a bag^{2}^{2}2 A bag or multiset is an unordered set with multiplicity, i.e. it may contain the same item multiple times. We will use the terms interchangeably. (a.k.a. multiset) of atomic parts that compose the model.

An assignment that maps those parts to individual pieces of stock material.

A packing for each piece of stock in the assignment that dictates how those parts are arranged in that stock.

A cutting order for each packing that specifies the order and the tool (chopsaw, tracksaw, etc.) used to cut the stock into the parts.
We say that an arrangement is items 13: a bag of parts assigned to and packed within pieces of stock material, but without cutting order decided. We can create a language to describe arrangements; a term in the arrangement language is one of the following:

An atomic node is a childless operator that represents a bag of parts packed into a single piece of stock. For example, maps two squares and one triangle all to the same piece of stock of type using a packing .

A union node takes two child arrangements and composes them into a single arrangement. The following arrangement is a union node of two atomic nodes: . It packs two squares into stock of type using packing , and it packs a triangle into a different piece of stock of the same type using packing .
To put arrangements into an , we must define the notion of equivalence that the uses to determine which enodes go in the same eclass. The more flexible this notion is (i.e., the larger the equivalence relation), the more sharing the can capture.
To maximize sharing, we say two arrangements are equivalent if they use the same bag of parts (BOP), even if those parts are assigned to different stock or packed differently. For example, is equivalent to even though they use different kinds of stock, and is equivalent to even though the former uses one piece of stock and the latter uses two.
Given our arrangement language and the BOP notion of equivalence, we can now describe the central data structure of our algorithm, the BOP Egraph. Recall from Section 3.3 that enodes within an have eclass children rather than enode children. So, viewing our arrangement language at the level, union enodes take two eclasses as children. All enodes in the same eclass are equivalent, i.e., they represent terms that use the same bag of parts but that arrange those parts differently into stock.
Figure 5 gives two example design variations and a BOP Egraph that captures a common subarrangement between the two. The eclasses E1 and E2 represent terms that correspond to the two box designs, and E4 captures ways to arrange the and parts which the variants share. The design variant including part also captures sharing with itself: eclass E5 reuses the arrangement in eclass .
Note that arrangements and the BOP Egraph do not mention designs. We do not “store” designs in the , we just need to remember which eclasses represent bags of parts that correspond to designs that we are interested in. This can be done outside the with a mapping from designs to eclasses. Many designs (especially symmetric ones) may have the same bag of parts. We call an eclass that is associated with a design a root eclass, and we call a term represented by a root eclass a root term. The BOP Egraph itself does not handle root vs. nonroot eclasses or terms differently, these are only used by the remainder of the algorithm to remember which arrangements correspond to design variants. The BOP Egraph will maximize sharing across design variations and arrangements since it makes no distinction between the two.
4.3. Iterative Contraction and Extension on Egraphs (ICEE)
4.3.1. Overview
ICEE takes a feasible design space as input, and outputs a Pareto front where each solution represents a (design, fabrication) pair. An overview of this algorithm is shown in Figure 6.
The initialization step selects a small subset of design variants from (Section 4.3.2) and then generates a small number of fabrication arrangements for each one (Section 4.3.3). All of these are added to the BOP Egraph, maintaining the property of maximal sharing, as described above. ICEE then applies the extraction algorithm (Section 4.3.4) to generate a Pareto front from the current BOP Egraph. This process will compute many different solutions and their fabrication costs , all of which are stored in the solution set .
The resulting Pareto front is used to compute ranking scores for each eclass in the BOP Egraph; the ranking score measures how often this bag of parts is used in Paretooptimal solutions and how many fabrication variations have been explored for this bag of parts. Using these scores, ICEE contracts the BOP Egraph by pruning eclasses that have been sufficiently explored but still do not contribute to Paretooptimal solutions (Section 4.3.5).
Having pruned the of the less relevant eclasses, ICEE then expands the BOP Egraph in two ways (Section 4.3.6). First, it suggests more design variations based on the extracted ParetoOptimal designs. Second, it generates more fabrication arrangements for both the new generated design variations and some of the previously existing eclasses. The ranking scores are used to select eclasses for expansion.
ICEE then extracts the new Pareto front from the updated BOP Egraph and repeats the contraction and expansion steps until the following termination criteria are met: 1) there is no hypervolume improvement within iterations, or 2) we exceed iterations. Additionally, we set a timeout beyond which we no longer change the BOP Egraph, but continue to extract based on crossover and mutation until one of the termination criteria is met. In our experiments, we set , , and hours.
4.3.2. Initial Generation of Design Variants
We bootstrap our search with the observation that design variations with more identical parts tend to be cheaper to fabricate because less time is spent setting up fabrication processes. Therefore, instead of initializing the BOP Egraph with designs randomly selected from , we randomly select up to designs and select the top designs from this set that have a maximal number of identical parts.
4.3.3. Fabrication Arrangements Generation
Again, instead of randomly generating arrangement variations for a given design, we use heuristics; namely, that (1) we can minimize the number of cuts by stacking and aligning material to cut multiple parts with a single cut, and (2) we can minimize the material cost by packing as many parts as possible to a single stock. Since a similar method for generating arrangement variations has been previously proposed by Wu et al. [2019], we leave a detailed discussion of the algorithm for supplemental material (Section 1.2). We note that the key difference between our method and the prior heuristicdriven algorithm is that we incorporate storage and direct control schemes that enable the method to output variations that are different from the ones generated during previous iterations of ICEE. This is essential to enable incremental expansion of the BOP Egraph without restoring variations that have already been pruned in previous contraction steps.
4.3.4. Pareto Front Extraction
In parlance, extraction is the process of selecting the “best” represented term from an according to some (typically singleobjective) cost function. One way to view extraction is that it simply chooses which enode should be the canonical representative of each eclass; once that is done, each eclass represents a single term. Since our cost function is multiobjective, we must instead extract a set of terms (arrangements) from the BOP Egraph that forms a Pareto front.
We use a genetic algorithm [Deb and Jain, 2013] to extract terms from the BOP Egraph. The population size is set to . The genome is essentially a list of integers, one per eclass, that specifies which enode is the representative. Since the BOP Egraph may have multiple root eclasses (corresponding to multiple design variations), we combine the genes for all the root eclasses, only picking a single enode among all of them. In effect, this means the genome defines both a design variation and the arrangement for that design.
For example, consider the bold term within the BOP Egraph in Figure 5. The genome for that term is as follows, where could be any integer since that eclass is not used by the term:
The root eclasses and share a single integer , meaning that the genome chooses the th enode across both eclasses, and that it uses the first of the two design variants. Since this encoding boils down to a list of integers, which is valid as long as each integer corresponds to an enode in that eclass, we can use simple mutation and singlepoint crossover operations.
A term does not completely determine a fabrication plan; it only specifies the arrangement. We need to additionally compute the cutting order for a given term to define a solution and then evaluate the fabrication costs. We observe that the material cost does not depend on the cutting order and that precision and fabrication costs strongly correlate once the arrangement is fixed. This is not surprising since cutting orders that minimize setups will jointly reduce time and precision error. Given this observation, we can compute two solutions for each term, using two singleobjective optimizations for computing cutting order: one that minimizes precision, and the other fabrication time.
We use two strategies to speed up these optimizations: (1) storing computed cutting orders in atomic enodes that will be shared across many terms and (2) a branch and bound technique. The optimization works as follows. Given a term, we first compute the optimal plans for the atomic enodes that have not been previously optimized. For each such enode, we try to generate maximal different orders of cuts, then extract the optimal plans with [Wu et al., 2019] method. We use this result to compute an upper and a lower bound for the term. If the lower bound is not dominated by the Pareto front of all computed solutions , we run an optimization that uses the upper bound as a starting point (see Section 1.4 of the supplemental material for details).
We again terminate the algorithm if there is no hypervolume improvement within iterations, or if we exceed iterations. In our experiments, we set and
and set the probability of crossover (
) and mutation () are set to be , respectively.4.3.5. BOP Egraph Contraction
As the algorithm proceeds, BOP Egraph contraction keeps the data structure from growing too large. To contract the BOP Egraph, we search for eclasses that represent bags of parts that have been sufficiently explored by the algorithm but are not present in Paretooptimal designs. This indicates that we have already discovered the best way to fabricate these bags of parts but they still do not contribute to Pareto optimal solutions; these eclasses are then deleted.
To measure how much an eclass has been explored, we first compute how many variations of fabrication arrangements have been encoded in the BOP Egraph. This number is stored over the and updated after each expansion step to ensure consistency following contraction steps. The exploration score, , is then defined as this value divided by the number of possible fabrication arrangements for an eclass, which we approximate by the number of parts in the eclass multiplied by the number of orientations of each part that can be assigned to the stock lumber.
The impact of an eclass, , is measured based on how often it is used in the set of solutions in the current Pareto front. We use the assignment of solutions to layers determined by the nondominated sorting (3.1) to compute for a given eclass. We initialize a with value and increment it by every time this eclass is used in a solution from layer , where is the total number of valid layers.
We normalize all computed exploration and impact scores to be between zero and one and then assign the following pruning score to each eclass:
where the weight is chosen to tradeoff between exploration and impact. If the is smaller that the pruning rate, , the eclass is removed along with any enodes pointing to this eclass (i.e. parent enodes). We set and to and in our implementation.
4.3.6. BOP Egraph Expansion
We expand the BOP Egraph by first generating new design variations and then by generating fabrication arrangements for both the existing and newly generated design.
We generate new design variations using a single step of a genetic algorithm that operates over the design space. The probability of crossover () and mutation () are set to be , respectively. We select the parent design variations from based on the nondominated sorting technique (Section 3.1). Since many solutions in
can correspond to the same design, we assign designs to the lowest layer that includes that design. We then generate new design variations with crossover and mutation operations. We use an integer vector encoding for each design. This time, the vector indexes the joint variations, e.g., for the designs shown in
Figure 4, . We get design variations by applying times of the single step genetic algorithm. Then we apply the same heuristic done during initialization (Section 4.3.2), selecting the top . Finally, the resulting designs are included to the BOP Egraph. We set in our implementation.We generate fabrication arrangements for each of the new design variations using the algorithm described in Section 4.3.3, and they are added to the BOP Egraph maintaining the maximal sharing property. We further generate fabrication arrangements for existing design variations, using a similar scoring function used during contraction. This is done in two steps. First we select root eclasses to expand based only on their impact score; namely, we take the top root eclasses using nondominated sorting. We then proceed to generate fabrication arrangements using the algorithm described in Section 4.3.3). However, instead generating the same number of fabrication arrangements variations for every selected root eclass, the number is adaptive to their pruning scores (as defined in Section 4.3.5).
Model  #C  #CV  Model  #C  #CV  
Frame  4  4  22  13  AChair  18  3  6  4 
LFrame  6  8  16  65  FPot  8  1  4  4 
ABookcase  12  6  16  192  ZTable  15  6  16  63 
SChair  14  14  32  66438  Loom  18  4  10  36 
Table  12  10  24  1140  JGym  23  8  16  54 
FCube  12  8  23  5  DChair  17  10  22  2280 
Window  12  16  32  10463  Bookcase  15  22  44  65536 
Bench  29  6  14  57  Dresser  10  10  25  480 
5. Results and Discussion
In order to gauge the utility of our tool, we want to answer the following questions:

How much does searching the design space with the fabrication space improve generated fabrication plans?

How does our tool compare with domain experts who are asked to consider different design variations?

How does our tool’s performance compare to a baseline naïve approach?
5.1. Models
We evaluate our method using the examples in Figure 7. Statistics for each model are shown in Table 1. These models vary widely in visual complexity and materials used — some are made from 1D sequential cuts on lumber, where others require 2D partitioning of sheets. Note the complexity of the search is not inherent to the visual complexity of the model, rather, it is determined by the number of connecting variations and the number of arrangements, which defines the size of the design space and the space of fabrication plans, respectively. For example, the Adirondack chair is more visually complex than the simple chair in Figure 7, but because it has about 5000 times fewer design variations, it converges much more quickly. Models of Art bookcase, Dining room chair, FPot, ZTable, Bench, and Adirondack chair are taken from [Wu et al., 2019].
5.2. Running environment
The parameters used in our ICEE algorithm are scaled based on the complexity of each model, measured in terms of the number of parts and the size of the design space . We further introduce a single tuning parameter , which allows us to tradeoff between exploring more design variations (smaller values of ) versus exploring more fabrication plans for given design variations (larger values). For all our experiments, we set to the default value of 0.75. The ICEE parameters are set as follows: , , , , and , , , , , hours, , , , , , and , where .
We report the running times of our algorithm in Table 2 for the models in Figure 7. The above times are measured on a MAC laptop computer with 16GB RAM and a 2.3 GHz 8Core Intel Core i9 CPU. More discussion of the running time is in the supplemental material.
Model  #O  #Iter  #EDV  #Arr  #PDV  CEt(m)  Et(m)  Total(m) 
Frame  2  11  8  181  3  0.7  2.1  2.8 
LFrame  2  24  19  2818  3  2.1  6.1  8.2 
ABookcase  3  25  25  28700  3  20.5  228.6  249.0 
SChair  2  15  136  35656  6  27.6  122.0  149.6 
Table  2  18  50  9346  9  5.9  34.9  40.8 
FCube  2  23  4  3499  3  1.4  4.0  5.5 
Window  2  23  116  81026  4  32.8  98.9  131.7 
Bench  2  25  16  37436  3  30.3  215.1  245.4 
AChair  2  28  4  14440  3  3.1  9.6  12.7 
FPot  3  14  3  185  2  1.7  13.0  14.7 
ZTable  3  70  41  336091  6  17.1  71.1  88.2 
Loom  3  21  10  1812  5  3.1  74.6  77.7 
JGym  3  46  18  286239  3  37.0  72.0  109.0 
DChair  2  18  40  15054  7  27.7  228.8  256.5 
Bookcase  3  15  32  34756  11  39.4  336.8  376.3 
Dresser  3  20  44  22209  5  14.1  241.2  255.4 
5.3. Benefits of Design Exploration
To demonstrate the benefit of simultaneous exploration of the design variation and fabrication plan spaces, we compare our tool against optimizing the fabrication plan for a single design.
Figure 8 shows the comparison between our pipeline and the Carpentry Compiler pipeline [Wu et al., 2019] which only considers a single design. The parameter setting of their pipeline and additional results can be found in Section 2 of the supplemental material. We explore the tradeoffs for fabrication time and material usage for the designs where all cuts can be executed with standard setups (these are considered to have no precision error) and include a third objective of precision error for the models where that is not possible. The Pareto fronts across designs generated by our tool cover a larger space and many of our solutions dominate those from previous work.
Exploring design variations enables better coverage of the Pareto front, which enables finding better tradeoffs. These tradeoffs are lowercost overall, cover more of the extrema, and are more densely available. For example, a hobbyist may want to minimize material cost independent of time, as the manufacturing process is enjoyable, and they consider it to have no cost. Material cost is hard to save, but our exploration of design variations enable solutions that reduce material cost by 7% in the Loom, 7% in the Jungle Gym, 15% in the Frame, and 25% in the Bookcase. On the other hand, someone with free access to reclaimed wood may only care about the total manufacturing time. Our approach enables solutions that reduce fabrication time by 60% — two models saved between 5060%, three between 3035%, and four between 2030%, for example — a huge time savings. If creating a very precise model is imperative, and a user would take great care to manufacture it exactly, then for four models, we find solutions that reduce error by 6177%. The detailed data are listed in Table S5 of the supplemental material.
Some examples don’t lie at the extrema: businesses often need to find a balance between the cost of materials, time spent on a project, and overall project quality, and the particular tradeoff will depend on their accounting needs. Our method enables finding solutions with better tradeoffs. Concretely, consider a carpenter charging $40/h. When scalarizing our multiobjective function into this single objective of money, we have several examples where the lowest cost on our Pareto front is 58% cheaper than the lowest cost on the baseline Pareto front, such as the ZTable, Flower pot, Jungle Gym, Dresser, Bookcase, and Art Bookcase. The window and frame have cost savings of of 12% and 20%, respectively. Though a cost reduction of several percent might appear insignificant, in production at scale, it represents thousands of dollars potentially saved. This scalarization function is just one way for a user to judge the tradeoff between different aspects of the multiobjective function. In reality, the user probably has some notion of what tradeoff would be ideal for their purposes, and will use the pareto front to represent the full space of options and make an informed choice. This scalarized tradeoff is further examined in the Table S7 of the supplemental material.
5.4. Comparison with Experts
For each model, we asked carpentry experts to generate design variations and fabrication plans. The resulting points are plotted as diamonds in Figure 8. Since experts produce each solution by hand, they produced Pareto fronts with many fewer solutions than our tool. For 14 of 16 models (except the Loom and Dresser models), solutions generated by our tool dominate the expert solutions. This suggests that, generally, although expert plans seem sensible, our tool generates better output thanks to its ability to generate more design variations and fabrication plans, including potentially unintuitive packing or cutting orders, and evaluate them much more quickly than a human.
5.5. Performance Evaluation
To test whether the BOP Egraph’s sharing is important for our tool’s performance, we compare against a nestedoptimization pipeline built on the Carpentry Compiler [Wu et al., 2019]. The baseline approach invokes the Carpentry Compiler pipeline on each design variant that our tool explores, and then it takes the Pareto front across all design variations.
Model  #EDV  Time (min)  

Ours  Baseline  
Frame  13  8  2.8  6.5 
Jungle Gym  54  18  109.0  761.2 
Long frame  65  19  8.2  59.7 
Table  1140  59  40.8  612.8 
Window  10463  116  131.7  2050.0 
We choose five models of varying complexity to evaluate performance and show results in Table 3. We tuned the parameters of the baseline method so we could achieve results that were as close as possible, if not qualitatively the same (when the baseline method ran to completion). Full results are available in the supplemental material (Table S6 and Figure S1). This indicates that our cooptimization approach yields similar results to the nested approach over the same space. When it comes to performance, our approach is about one order of magnitude faster. We attribute this speedup to the sharing captured by the BOP Egraph; we only had to evaluate common subdesigns and subfabricationplans one time, whereas the baseline shared no work across its different invocations for each design variant.
5.6. Fabricated Results
We validated our pipeline by physically constructing some of the models according to the design variationfabrication plan pairs generated by our tool. Figure 11 shows the results.
6. Discussion
6.1. MultiMaterials and Cutting Tools
Mechanical or aesthetic reasons might motivate designers to combine multiple materials, such as different types of wood, or wood and metal, in one model. Adding new materials to our approach involves almost no implementation overhead: we must select which cutting tools are appropriate, and accommodate the material’s costs into our metrics. Then, we simply need to indicate which material a given part is made of, exactly the same way we designate whether parts belong on 1D lumber or 2D stock. As shown in Figure 12, we have created a mixedmaterial model to showcase our ability to handle this added design complexity. The loom is made of two different types of wood as well as one kind of metal. All parts are optimized in the same and treated identically to the base implementation. We describe the cost metrics for different materials in the supplemental material (Section 1.3.1).
6.2. Objectives
Our method also naturally extends to other objective functions. We show one example in Figure 13, where we consider stability as an additional objective which we calculate with physical simulation. Notably, stability is invariant to the fabrication plan, and depends solely on the design itself, so it only needs to be measured once, at the root node. However, two designs can have different stability costs but share the same bag of parts. Figure 13 (a) and (b), exhibits one bag of parts which captures two different designs.
In this example, since the other metrics (time and material cost) do not exhibit this dependency, we can simply assign to the root nodes the stability cost of the bestperforming design that corresponds to that bag of parts; thus the cost for any given bag of parts is the best cost of any design that is represented by that bag of parts. Note that fabrication plans depend solely on the bag of parts. In general, if we want to use more than one metric like this one — a metric that depends on the design, and is not completely determined by a term in the egraph — we would need to compute the different tradeoffs for the variations during extraction, as was done with cutting order and precision, described in Section 4.3.4.
6.3. Convergence
While our results show the significance of the approach to reduce fabrication cost in practice, we cannot make any guarantees that plans we output are on the globallyoptimal Pareto front. Indeed, we do not anticipate that any alternative approach would be able to have such strong guarantees given the inherent complexity of the problem. This convergence limitation impacts our method in three different ways.
Parameter Tuning
Due to limitations in exploring the full combinatorial space, parameters of our search algorithm may influence convergence. Because the key aspect of ICEE is simultaneously searching “broad” (design variations) and “deep” (fabrication plans for various designs), we expose the parameter that tradesoff between depth and breadth during search. Exposing this single parameter, enables us to improve performance in special circumstances. For example, when not much can be gained from design variations, a larger will enable searching deeply on a particular design finding better solutions. All the results shown in this paper use the default value for that we have found effective in practice.
Comparison with Wu et al. [2019]
The fundamental difference between our work and [Wu et al., 2019] is that incorporating more design variations increases the design space, enabling us to find better performing results. Since the search space of this prior work is a subset of the search space we explore, our results should be strictly better. However, since neither method can ensure the results lie on the true Pareto front due to limitations in convergence, tuning parameters of both approaches may influence this result. An example of this limitation in shown in AChair example in Fig7. We show in the supplemental material (Section 2.4) how tuning to explore more deeply improves this result and also report experiments for tuning the 4 parameters from [Wu et al., 2019].
Increasing the Design Space
A final implication of the intractable search is that it is possible to achieve worse results by increasing the design space in special circumstances. We discuss in the supplemental material (Section 2.4) an example where we make the design space 145 times larger by including variations that do not benefit the search.
6.4. Limitations and Future Work
Our current approach encodes only discrete design variants in the BOP Egraph. An interesting direction for future work would be to support continuous variations in the designs space which can provide a larger space of fabrication plans to explore. However, supporting continuous design variants in an would require designing a new metric for comparing two design variants for equivalence. This is challenging because egraphs heavily exploit transitivity, so any error in the metric could lead to arbitrarily different designs being considered “equivalent”.
Several steps of our algorithm can also be parallelized for performance (e.g. generating design variants)—we leave this as an extension for the future.
We are also keen to explore broader applications of the ICEE strategy for integrating feedbackdirected search in other based optimization techniques. Past work applying for design optimization in CAD [Nandi et al., 2020] and for improving accuracy in floatingpoint code [Panchekha et al., 2015] have relied on ad hoc techniques for controlling the growth of the , e.g., by carefully tuning rules used during rewritebased optimization. We hope to explore whether ICEE can help with optimization in such domains by focusing the search on moreprofitable candidates and easing implementation effort by reducing the need for experts to carefully tune rewrite rules.
The most timeconsuming part of our ICEE algorithm lies in the Pareto front extraction phase. A pruning strategy with learningbased methods for predicting the objective metrics of an arrangement might be an interesting and valuable area of research.
Another direction we are eager to explore is accounting for other factors in the Pareto front. Currently, our technique finds a design variant and fabrication plan that optimizes fabrication time, material cost, and precision. Other interesting factors that can guide the search include ease of assembly and strength of the part.
7. Conclusion
We have presented a new approach to cooptimizing model design variations and their fabrication plans. Our approach relies on the insight that fabrication plans across design variants will share similar structure. We capture this sharing with the BOP Egraph data structure that considers fabrication plans equivalent if they produce the same bag of parts. The BOP Egraph also lets us guide the search toward profitable design variants/fabrication plans with a technique we call ICEE (Iterative Contraction and Expansion of ) that may be useful for uses of in other applications. Results generated by our tool compare favorably against both expertgenerated designs and a baseline built using prior work, indicating that the sharing captured by the BOP Egraph is essential to efficiently exploring the large, combined space of design variants and fabrication plans.
References
 Volumeaware design of composite molds. ACM Transactions on Graphics. Cited by: §2.
 Theory of the hypervolume indicator: optimal distributions and the choice of the reference point. In Proceedings of the tenth ACM SIGEVO workshop on Foundations of genetic algorithms, pp. 87–102. Cited by: §3.1.
 State of the art on stylized fabrication. Computer Graphics Forum 37 (6), pp. 325–342. External Links: Document Cited by: §2.
 Fieldaligned mesh joinery. ACM Transactions on Graphics (TOG) 33 (1), pp. 1–12. Cited by: §2.
 A fast and elitist multiobjective genetic algorithm: nsgaii. Trans. Evol. Comp 6 (2), pp. 182–197. External Links: ISSN 1089778X Cited by: §3.1.

An evolutionary manyobjective optimization algorithm using referencepointbased nondominated sorting approach, part i: solving problems with box constraints.
IEEE transactions on evolutionary computation
18 (4), pp. 577–601. Cited by: §3.1, §4.3.4. 
Solving bilevel multiobjective optimization problems using evolutionary algorithms
. In International conference on evolutionary multicriterion optimization, pp. 110–124. Cited by: §2.  Multiobjective optimization. In Search methodologies, pp. 403–449. Cited by: §3.1.
 Bilevel optimization: theory, algorithms and applications. TU Bergakademie Freiberg, Fakultät für Mathematik und Informatik. Cited by: §2, §2.
 RoboCut: hotwire cutting with robotcontrolled flexible rods. ACM Transactions on Graphics (TOG) 39 (4), pp. 98–1. Cited by: §2.
 Multiobjective bilevel optimization. Mathematical Programming 123 (2), pp. 419–449. Cited by: §2.
 CurviSlicer: slightly curved slicing for 3axis printers. ACM Transactions on Graphics (TOG) 38 (4), pp. 1–11. Cited by: §2.
 Computational interlocking furniture assembly. ACM Trans. Graph. 34 (4), pp. 91:1–91:11. External Links: ISSN 07300301, Link, Document Cited by: §2.
 Computational design of reconfigurables.. ACM Trans. Graph. 35 (4), pp. 90–1. Cited by: §2.
 Computational design of cold bent glass façades. ACM Transactions on Graphics (TOG) 39 (6), pp. 1–16. Cited by: §2.
 Bilevel optimization of multicomponent chemical systems using particle swarm optimization. In 2006 IEEE International Conference on Evolutionary Computation, pp. 1240–1247. Cited by: §2.
 Orthogonal slicing for additive manufacturing. Computers & Graphics 37 (6), pp. 669–675. Cited by: §2.
 Denali: a goaldirected superoptimizer. SIGPLAN Not. 37 (5), pp. 304–314. External Links: ISSN 03621340, Link, Document Cited by: §2.
 Towards zerowaste furniture design. IEEE Transactions on Visualization and Computer Graphics 23 (12), pp. 2627–2640. External Links: Document, ISSN 10772626 Cited by: §2.
 Creating workslike prototypes of mechanical objects. ACM Transactions on Graphics 33 (6). Cited by: §2.
 Converting 3d furniture models to fabricatable parts and connectors. In ACM SIGGRAPH 2011 Papers, SIGGRAPH ’11, New York, NY, USA, pp. 85:1–85:6. External Links: ISBN 9781450309431, Link, Document Cited by: §2.
 JigFab: computational fabrication of constraints to facilitate woodworking with power tools. In Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems, CHI ’19, New York, NY, USA, pp. 156:1–156:12. External Links: ISBN 9781450359702, Link, Document Cited by: §2.
 Multilevel decisionmaking: a survey. Information Sciences 346, pp. 463–487. Cited by: §2, §3.2.
 VDAC: volume decomposeandcarve for subtractive manufacturing. ACM Transactions on Graphics (TOG) 39 (6), pp. 1–15. Cited by: §2.
 LayerCode: optical barcodes for 3d printed shapes. ACM Transactions on Graphics (TOG) 38 (4), pp. 1–14. Cited by: §2.
 Synthesizing structured CAD models with equality saturation and inverse transformations. In Proceedings of the 41st ACM SIGPLAN International Conference on Programming Language Design and Implementation, PLDI 2020, London, UK, June 1520, 2020, A. F. Donaldson and E. Torlak (Eds.), pp. 31–44. External Links: Link, Document Cited by: §2, §2, §6.4.
 Techniques for program verification. Ph.D. Thesis, Stanford University, Stanford, CA, USA. Note: AAI8011683 Cited by: §1, §2, §3.3.
 Automatically improving accuracy for floating point expressions. SIGPLAN Not. 50 (6), pp. 1–11. External Links: ISSN 03621340, Link, Document Cited by: §2, §6.4.
 Semantic code search via equational reasoning. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2020, New York, NY, USA, pp. 1066–1082. External Links: ISBN 9781450376136, Link, Document Cited by: §2.
 Fabricationaware design with intersecting planar pieces. In Computer Graphics Forum, Vol. 32, pp. 317–326. Cited by: §2.
 Model and interactive algorithm of bilevel multiobjective decisionmaking with multiple interconnected decision makers. Journal of MultiCriteria Decision Analysis 10 (1), pp. 27–34. Cited by: §2.
 A review on bilevel optimization: from classical to evolutionary approaches and applications. IEEE Transactions on Evolutionary Computation 22 (2), pp. 276–295. Cited by: §2.
 Reconfigurable interlocking furniture. ACM Trans. Graph. 36 (6), pp. 174:1–174:14. External Links: ISSN 07300301, Link, Document Cited by: §2.
 Equalitybased translation validator for llvm. In Proceedings of the 23rd International Conference on Computer Aided Verification, CAV’11, Berlin, Heidelberg, pp. 737–742. External Links: ISBN 9783642221095 Cited by: §2.
 A harmonic balance approach for designing compliant mechanical systems with nonlinear periodic motions. ACM Transactions on Graphics (TOG) 39 (6), pp. 1–14. Cited by: §2.
 Equality saturation: a new approach to optimization. In Proceedings of the 36th Annual ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, POPL ’09, New York, NY, USA, pp. 264–276. External Links: ISBN 9781605583792, Link, Document Cited by: §2.
 Guided exploration of physically valid shapes for furniture design. ACM Trans. Graph. 31 (4), pp. 86:1–86:11. External Links: ISSN 07300301, Link, Document Cited by: §2.
 SPORES: sumproduct optimization via relational equality saturation for large scale linear algebra. Proc. VLDB Endow. 13 (12), pp. 1919–1932. External Links: ISSN 21508097, Link, Document Cited by: §2.
 Design and structural optimization of topological interlocking assemblies. ACM Transactions on Graphics (TOG) 38 (6), pp. 1–13. Cited by: §2.
 Egg: fast and extensible equality saturation. Proc. ACM Program. Lang. 5 (POPL). External Links: Link, Document Cited by: §2.
 Carpentry compiler. ACM Transactions on Graphics (TOG) 38 (6), pp. 1–14. Cited by: §1, §2, §2, §2, §4.1, §4.3.3, §4.3.4, §4, §5.1, §5.3, §5.5, Table 3, §6.3, §6.3.
 DHFSlicer: double heightfield slicing for milling fixedheight materials. ACM Transactions on Graphics (TOG) 39 (6), pp. 1–17. Cited by: §2.
 Reforming shapes for materialaware fabrication. In Computer Graphics Forum, Vol. 34, pp. 53–64. Cited by: §2.
 Geneticalgorithmsbased approach for bilevel programming models. Journal of transportation engineering 126 (2), pp. 115–120. Cited by: §2.
 Computational design of fabric formwork. Cited by: §2.
 Connected fermat spirals for layered fabrication. ACM Transactions on Graphics (TOG) 35 (4), pp. 1–10. Cited by: §2.