A Bayesian sampling framework for constrained optimisation of build layouts in additive manufacturing

In additive manufacturing processes such as laser powder bed fusion, the build orientation and packing of components affect the required support structures, the number of parts in each build, and the surface roughness of the printed parts, among other factors. Maximising the packing density while minimising the build height can increase effective machine utilisation and decrease per-part cost. Yet, the build layout optimisation problem is highly nonlinear and difficult to solve using human intuition, so a systematic algorithm approach is required. Here, we present and demonstrate a voxel-based analysis method with Bayesian optimisation for determining component build orientation in additive manufacturing. We introduce selected case studies incorporating exemplary process attributes of laser powder bed fusion, including the determination of orientation and packing configurations based on support removal and tool-accessibility constraints.


Introduction
Additive manufacturing (AM) is no longer limited to prototyping and is becoming an established method for volume production of high-value components.With this, AM can be cost-effective compared to conventional forming techniques including CNC machining, casting, or injection moulding based on the desired production quantity, the degree of complexity in the part geometry (Quinlan et al. 2017), and other factors.Yet, in many cases, AM is still expensive compared to conventional methods, and increasing the throughput and utilisation of AM machines is widely sought to reduce production cost.Many recent studies have focused on process innovations as a means of increasing throughput.For instance, use of a liquid interface in photopolymerization AM was shown to enable higher throughput by improving heat transfer (Walker, Hedrick, and Mirkin 2019).Use of multiple lasers in powder bed fusion can scale the maximum throughput limited by melt-pool stability.Other advances include a volumetric printing process in a rotating vat inspired by CT image processing (Kelly et al. 2019); an area-wide printing process for metal using a high-power diode laser and optically-addressable light valve (Matthews et al. 2017); and use of a screw-based filament feed and laser heating in desktop thermoplastic extrusion (Go and Hart 2017).
Optimisation of the build layout is also essential to throughput of AM and must consider design rules such as support structure requirements.For processes such as Laser Powder Bed Fusion (LPBF), which is categorised to powder bed fusion according to the ISO/ASTM 52900:2021 standard, a nested packing strategy can maximise the number of printed parts per build (BMW Group 2020; Haeckel, Meixlsperger, and Burkert 2017).The LPBF process steers lasers over the powder in a cross-section of part geometry, spreads new powders on the laser scanning area, and repeats these processes to print the part layer by layer.Because of the fixed time for starting and exchanging each build, and the limited speed of interlayer powder spreading (Meier et al. 2019), reducing the number of layers and recoating time per part can help maximise effective build rate.Meanwhile, the build orientation in LPBF also directly affects the total build rate and cost because the requisite supports depend on the build orientation.Generally, the LPBF process requires supports when printing overhanging or bridge-shaped features with orientation and/or length exceeding process-and material-specific critical values.The supports mechanically constrain the part and aid heat dissipation (Lee and Yun 2022).However, supports incur additional printing time, surface quality, and post-processing concerns.So, the build orientation must be selected considering the required supports, their locations relative to critical areas on the part, and support removability (Kranz, Herzog, and Emmelmann 2015).The build orientation also influences the machining process after printing.Generally, the support attachment points have low surface quality, so machining can be required to achieve good surface quality and adequate fatigue durability at the support removed areas.Low surface quality can induce crack and fatigue-life problems (Greitemeier et al. 2016;Wycisk et al. 2014).Therefore, it is of great interest to find an optimal build layout that maximises the effective build rate while satisfying the support removability and/or machining requirements.
Several studies have focused on optimising part orientation in LPBF, considering manufacturability issues or packing strategies.For example, Oh et al. first determine the build orientation, and then establish a 2D packing arrangement (Oh, Zhou, and Behdad 2018;2020).However, only two orientations, laying and standing, were considered.Cheng and To studied how the build orientation relates to minimise residual stresses and support volume (Cheng and To 2019), and Allaire et al. considered several criteria, e.g.area of the part projected on the build plate, for determining the build orientation of a single part (Allaire, Bihr, and Bogosel 2020).Commercial software, such as Materialise Magics, usually handles the build orientation as an initial input chosen manually.Then, the support design and slicing algorithms are applied to calculate the support material and build time for the given build orientation.However, it requires sequential analysis, and packing strategy and manufacturability constraints are not considered at once.Although several candidate build orientations are provided by several indices, such as the XY-plane area or Z height, these criteria are too simple to consider the complex behaviour of build time and manufacturability constraints.The co-optimisation of the build orientation and packing strategy is critical in deriving the best solution in terms of printing time, cost, and manufacturability.However, it is still challenging to solve the layout optimisation problem with manufacturability constraints due to the inherent nonlinearity and non-convexity of the problem.For example, the necessity for support structures, determined by several criteria, such as critical angle, can be a step function that discontinuously changes with the build orientation.This is one of the main causes of the high nonlinearity in build orientation optimisation.Likewise, the maximum number of parts that can be packed on a print bed is also an integer value changing discontinuously with the build orientation and packing strategy variables.So, a gradient-based optimisation algorithm prone to converge to a local solution depending on the initial guess is not suitable for the problem.Additionally, meta-heuristic global optimisation algorithms, such as a particle swarm optimisation (Kennedy and Eberhart 1995) requiring many iterations, are not suitable for our layout optimisation problem based on time-consuming geometry-based analysis methods.The high computational cost of these methods precludes agile decisionmaking in AM-based manufacturing.Meanwhile, the sampling-based approach, called Bayesian optimisation, has shown effectiveness in finding the solutions in AM part design problems (Bessa, Glowacki, and Houlder 2019;Gongora et al. 2020).Recent research has shown that Bayesian optimisation can handle constrained optimisation efficiently (Gardner et al. 2014).
In this paper, we present a method for optimisation of the LPBF build orientation and packing strategy at once, considering manufacturability constraints.To this end, we apply geometry-based analysis methods: a rule-based support design algorithm, a packing strategy algorithm based on the part collision test, support removability estimation based on a ray-tracing algorithm, and morphology filters for detecting the areas the machining tool cannot access.Integrated with the geometry-based analysis methods, a Bayesian optimisation framework can automatically handle the optimisation process by sampling a build orientation, evaluating the performance of the tested build orientation, and modelling the response to predict the performances at the undiscovered area.Here, the performance can be the printing time, support material, surface quality factor, etc.With the model built based on the accumulated data set, i.e. the test results for the previously sampled build orientations, our algorithm can also recommend a new sample that will improve the target metric while taking into account the specified constraints.Consequently, our fully automated and integrated analysis and optimisation framework can efficiently derive the best build orientation with low computational cost, even with the nonlinear objective/constraint functions.

Methods
Our sampling-based optimisation algorithm automatically selects a new build orientation based on analysis of the previously sampled orientations until it finds an optimal build layout satisfying the specified target metrics.The algorithm considers one uniform orientation, i.e. each part is oriented identically relative to the build platform yet nested configurations are permitted.To test the sampled build orientations, we begin with a three-dimensional part geometry, converted to a voxel mesh (Kroon 2019), and first generate required support structures.

Support structure design
Figure 1 (a,b) show two examples of the voxel-type mesh and supports.Generally, the supports can be designed by a rule-based method or a structural design algorithm.The rule-based approach determines the support area by specific geometry information (e.g.overhang angle of the printing surface), and the structural design algorithm approach applies optimisation methods such as topology optimisation (Allaire, Bihr, and Bogosel 2020;Zhang et al. 2020).We apply the rule-based approach with two parameters, critical angle (θ c , the maximum overhang angle of surface printable without supports), and critical length (L c , the maximum length of unsupported feature).Figure 1(a) shows representative supports applied to the downskin surfaces based on the critical angle condition.A horizontal overhanging surface can be printed without a supporting structure if its span is less than a critical length L c (Figure 1(b)).To create the supported part geometry, we apply two criteria sequentially as follows: (i) generate supports based on the critical angle criterion and then (ii) remove the supports in locations that satisfy the critical length condition.
The input STL file contains normal vector information of each surface.Thus, we can detect the facets having an angle larger than 90 • + θ c with respect to the build direction.Based on the detecting results, 0 or 1 will be assigned to λ i as in equation (1).
In equation ( 1), b is the unit vector in the build direction, n i is the unit normal vector of the facet i, and N f corresponds to the number of facets composing the input STL file.The voxel mesh located at the surface with λ i equal to 0 is categorised as a self-supported voxel.We define λ (e) for the voxel mesh j, where λ (e) j equals 1 if the voxel is located on the facet with λ i equal to 1. Otherwise, λ (e)  j equals 0. N e is the number of voxel mesh elements.
A support structure will be placed below voxels with λ (e) j = 1, as shown in Figure 1(c).For example, when a voxel located at (p, q, r2 + 1) corresponds to the voxel requiring a support structure, we build a column-shaped support from (p, q, r1 ) to (p, q, r2 ).Here, the voxel at (p, q, r1 ) is the first voxel touching the base plate or another surface of the part.When r1 = 1, the support touches the base plate.Otherwise, i.e. when r1 > 1, the support is a self-intersecting structure that takes root at another surface of the part.
Figure 1(d) shows a support generation rule combined with the critical length criteria.Voxels with λ (e) j = 1 can be printed without a support if there is a selfsupported voxel within distance L c .When searching the neighbour voxels, we consider the self-supported voxels below the current layer only.For example, element j in Figure 1(d), located at (p, q, r), searches the self-supported structures below layer number r.Because there is element k corresponding to the selfsupported structure (λ (e)  k = 0) within distance L c , element j can be printed without supports.One can also set L c as a function of θ c (Mirzendehdel and Suresh 2016) based on machine or process-specific design guidelines.
After determining where supports are needed, we apply a voxel-based lattice generation algorithm introduced in (Aremu et al. 2017) for lattice-type support structures as shown in Figure 2. First, we select a unit pattern for the lattice structure and apply a Boolean operation projecting the user-defined unit pattern to the voxels for the supports.The lattice-type structure obtained from the Boolean operation is the same as depicted on the right side of Figure 2.Then, we apply one more projection operation to avoid an open endpoint of the unit pattern or a gap between the lattice supports and the input part.Here, a Z-directional projection scheme is applied.The details of the algorithm, including projection to the curved surface, can be found in (Aremu et al. 2017).Although the lattice structure used in the supports was chosen as a representative example, other designs improving the structural performance (Seharing, Azman, and Abdullah 2020) could be employed according to user preferences.

Packing strategy analysis
For a given part geometry and two build orientation angles, φ X and φ Y , the support design algorithm introduced in Section 2.1 can provide a voxel mesh that integrates the input part geometry with computationally designed supports.The rotation angle with respect to the Z-axis, φ Z , is not considered as it does not affect the support geometry.
A nominal packing strategy analysis can find a combination of the packing layout variables that maximises the number of parts on the print bed, i.e. in one batch of the AM machine, or minimises the height of the build (i.e. the number of layers).Here, the packing layout variables are φ Z , the distance between adjacent parts in X and Y-directions, and the degree of offset between adjacent rows/columns in the batch.The degree of offset can be controlled from 0 to 1, where 0 means the bounding boxes of the adjacent parts are aligned the same row/column.On the other hand, if the offset variable equals 1, the part will be located in the next row/column.To reach the optimal packing strategy, we need to check for collision between adjacent part-support integrated structures for all combinations of the packing layout parameters.Figure 3 presents a workflow based on the support design algorithm and packing strategy analysis.For the two build orientation variables, φ X and φ Y , recommended by the sampling-based optimisation algorithm, we can obtain the supports and the optimally batched part layout, including the optimal Z-axis rotation.The final AM part orientation in 3D space based on three angular variables can be calculated using the transformation matrix T.
The approach ensures a minimum gap between adjacent parts and does not allow supports connecting adjacent parts in the build.

Support accessibility
To ensure the removability of all support structures, we must select a build orientation that can avoid support structures within areas defined as inaccessible.To address this, we apply a ray-tracing algorithm for a voxel-type mesh (Amanatides and Woo 1987) to detect inaccessible supports, as shown in Figure 4(a,b).Similar approaches can be found in recent studies considering manufacturability criteria in designing parts/supports for additive manufacturing (Allaire, Bihr, and Bogosel 2020), injection moulding (Sato et al. 2017), and machining processes (Hur et al. 2020).We apply the ray casting algorithm for each support voxel until we find a path that does not touch a part voxel.For that, we test multiple starting points evenly distributed a spherical shell centred at the support voxel in question.The total number of testing points is 1226, distributed with 10 degree intervals on the sphere surface.If the ray-tracing algorithm succeeds in finding a path that does not touch a part voxel, the simulation for the corresponding support voxel is terminated.Then, we start the same procedure for the next support voxel.The simulation is repeated until all support voxels have been tested, and therefore represents a limiting case where direct-line visibility is required for support removal.
This ray-tracing algorithm can find inaccessible supports inside the part, but it does not ensure the accessibility of machining tools for post-processing.Also, parts made by AM may have relatively poor surface quality on down-skins, i.e. surfaces with the normal vector heading downward.Yet, for instance, a machining tool of a certain size and/or shape may not be able to access some surfaces due to interference with other part features.Therefore, if a particular location is inaccessible to a machining tool, one must select a build orientation that can avoid supports touching that location, if the roughness after support removal is unacceptable.
Several recent studies proposed tool accessibility analysis methods for voxelated models (Langelaar 2019;Mirzendehdel, Behandish, and Nelaturi 2020).These approaches required iterative tests to consider all candidate directions, like the ray-tracing approach applied for support accessibility analysis herein.However, tool accessibility tests can require much more computational cost due to the geometry of the considered tool.Therefore, we convert the tool-accessibility estimation problem to another problem finding pocket regions within the AM part under consideration.We define the pocket area as a region inside a 'gate' where a spherical probe with a predefined radius cannot pass through, as shown in Figure 4(c).Kawabata (Kawabata 2019) used a morphology filter to detect such pocket areas in the context of 3D protein analysis.Equations (3-5) describe the filter designed to detect the pockets.

X.pocket(P, S) = ((X
Here, X is a voxel mesh of a given 3D structure, P and S are spherical-shaped probes with different radius applied to detect the pocket (Kawabata 2019).Operators in (4,5) are morphology filters called closing and opening, respectively.Dilation and erosion operators are represented by ⊕ and .We applied the morphology filters provided in the MATLAB image processing toolbox (R2019b).To mimic machining of an AM parts, we set the radius of the probe P to the minimum tool size and the radius of the probe S to a unit voxel size.The greencoloured regions in Figure 4(d) correspond to the pocket areas detected by (3).We can also reflect a tool size effect by changing the radius of the probe P.

Bayesian optimisation
In a nominal case, it is necessary to select a build orientation that maximises/minimises the target objective function, while maintaining desired support accessibility.However, finding the best build orientation is not straightforward due to the nonlinearity and constraints, e.g.build time is bounded by support accessibility.We apply Bayesian optimisation to derive the best build orientation with less computational time.Our algorithm can suggest a new candidate solution, i.e. the build orientation defined by the two variables (φ X , φ Y ), based on a surrogate model predicting the objective/constraint function values based on the previously estimated build orientations.The process of recommending a new solution most likely to improve the objective function is called the sampling process, and the iterative sampling process is continued until finding the best solution or reaching a limited number of iterations.
In our optimisation problem, the sampling variable space is two-dimensional (φ X ,φ Y ).Accordingly, each sample point corresponds to a set of two build orientation variables.As introduced in the packing strategy analysis, the rest of the layout variables, including φ Z , become the dependent variables for the build orientation; the layout variables are obtained by maximising the number of parts that can be packed in a build volume.
To predict the response for the sample points not yet tested, we apply Gaussian Process (GP) regression, (6).After applying the GP regression to learn the functional space using the accumulated data set, we need to select the best sample point expected to improve the objective function.The next sample point can be selected within the region not yet discovered (exploration) or the region already tested (exploitation).Active learning algorithms calculate an expected improvement (EI) to adequately balance exploration and exploitation.
This is called the acquisition function.Details of the EI calculation method are in Appendix B. In (7), ε f specifies the user preference of exploration versus exploitation as explained in Appendix C. Bayesian optimisation can also employ a modified EI to solve constrained optimisation problems.Equation ( 8) is an optimisation problem with inequality constraints.
In this case, the acquisition function needs to involve a probability of feasibility (PF).The PF of each constraint function can be calculated by ( 9), where N c is the number of constraints.
The PF is defined for each constraint, where the parameter ε c i is applied to reflect the preferences on exploration and exploitation.The probability in (9) can be directly calculated from a GP regression model for the constraint function c i .Equation ( 10) represents the final acquisition function obtained by multiplying all PF's for constraints to EI.In this study, we call it the constrained EI, or simply cEI (Gardner et al. 2014).
Consequently, the Bayesian optimisation algorithm selects the next testing point having the largest cEI value.We apply N init initial sampling points to explore a solution space before testing N adpt points adaptively selected by the Bayesian optimisation algorithm.We can distribute initial samples uniformly without an excessive computational burden as the variable space dimension is low; when the space dimension increases, the required number of initial samples may increase exponentially.Alternatively, one can consider a Latin Hypercube sampling (LHS) method; for example one may use 3p initial samples, where p is the dimension of the solution space, i.e. x ∈ R p (Ha et al. 2019;Jones, Schonlau, and Welch 1998).The number of initial sample points and adaptively selected points is specified for each case study presented later.
Last, we explain how we address the periodicity and non-uniqueness of the orientation (angle) parameters.To reflect the periodicity to the model, our algorithm duplicates the tested sample points by adding/subtracting the period.For example, a response estimated at an orientation of 10 degrees is copied and pasted to the point at 370 degrees.This enables the Gaussian process regression model to naturally involve the function periodicity at the boundary of the optimisation variable space, i.e. near 0 or 360 degrees, without a specially designed kernel for handling the periodicity.We apply this rule to both initially sampled points and adaptively sampled points.In addition, a rotated configuration can have the same configuration after the rotation.For example, two rotations with {φ X , φ Y , φ Z } = {45, 0 • , 0 • }, and {φ X , φ Y , φ Z } = {135 • , 180 • , 180 • } result in the same configuration.We do not add a specific module to handle the special cases generating the same configuration, but the algorithm can search for a proper solution without prior knowledge.
We programmed in-house codes for the analysisoptimisation modules by using MATLAB (2019b version), except for the ray-casting algorithm.

Determining optimal build orientation
We first demonstrate the application of our algorithm to find optimal packing layouts for arrays of identical parts in AM, by applying the Bayesian optimisation algorithm integrated with the geometry-based analysis methods.We do so for a variety of use cases, considering different objective functions that govern the outcome.

Minimisation of support volume
As the first example, Figure 5(a) shows a 3D model of a vehicle suspension knuckle, for which we formulate the optimisation to minimise the volume of required support structures.Equation ( 11) is an unconstrained optimisation formulation for finding the optimal build layout, where we apply EI (Expected Improvement) as an acquisition function to Bayesian optimisation.
Initially, we only consider a single part layout, so that the packing strategy analysis is not applied.The specified critical angle and critical length are 50 degrees and 2 mm, respectively.
Figure 5(b) shows the optimum build orientation obtained from 130 iterations.Figure 5(c) is the iteration history for the objective function, and Figure 5(d) represents the location of the sampled points.The contour plots are the prediction maps based on Gaussian process regression using the accumulated data set for each successive number of iterations indicated.The red-coloured asterisks on Figure 5(d) represent the duplicated sampled points reflecting the periodicity of the build orientation variables.We found the optimal solution at the 91st sampled point (iteration).The more sampled points tested, the more detailed map can be obtained, as shown in Figure 5(d).We applied the lattice structure shown in Figure 2 to calculate the support volume fraction.The volume fraction of the lattice is 0.32.The optimised support volume ratio is 2.46%, while the initial random sample values average 43.15%.We applied a single lattice support type for all case studies.However, the support lattice shape/pattern can also gradually change along the build direction or the location of the support area to ensure enough stiffness at the vulnerable points likely to deform due to residual stress.Our algorithm can also be adjusted to accommodate the given support design criteria depending on AM processes, such as the maximum allowed aspect ratio of support columns in practice.
In Figure 5(b), we can see vertical support structures with a high aspect ratio, which may be impractical due to their low rigidity.Where generated by the rulebased approach, these supports can be modified by a secondary algorithm (see Appendix D) to adapt their geometry according to process-or machine-specific constraints.For instance, the supports could be thickened or tapered to improve mechanical stability.However, we do not apply the reinforcement algorithm in other examples herein.

Minimisation of build time
We can also set the objective function to minimise the estimated build time as.
In equation ( 12 Our algorithm slices the part-support structure with a specified layer height (here 80 μm).The scan vector length assumes a fixed hatch spacing (80 μm for a zigzag infill), and a single contour scan is added.Before slicing and calculating the scan length, the unit pattern presented in Figure 2 is applied to the supports to convert them into lattices.The scanning time in t scan,tot is obtained from the total scan length divided by an average scanning speed, 300 mm/s.The total recoating time in t recoat,tot is calculated by multiplying the number of layers and recoating time.In this study, we assume the recoating time to be 5 sec for each layer.The processes in build exchange time, heating time, and cooling time are set to 0.25, and 0.50, and 0.50 hr, respectively.While this is a highly simplified representation of the scanning dynamics that influence the build time, more advanced algorithms that may consider part-specific layouts and scanning dynamics can be adopted in the same manner.Figure 6(a) shows the result obtained by applying f BT as an objective function (f obj ) in equation ( 11), instead of f SV .In this study, the build volume size applied to the packing strategy analysis equals 400mm × 400mm × 400mm.For the given printing process parameters, the optimal solution minimising f PT in Figure 6(a) is the same as a result obtained from the minimisation of f SV in Figure 5(b).Two maps for f SV and f BT in Appendix E show a similar outcome.
The solution to the optimisation improves the build rate by about 16.4% compared to the average of initially chosen sample points.Generally, productivity improvement can profoundly affect the per-part cost.For example, according to our recent work, the machine cost (depreciation) can be up to 66.7% of the per-part cost, for a case study of a small AlSi10Mg bracket using a machine configuration representative of current industrial LPBF technology (K Gee et al. 2023).Thus, packing optimisation in this example is estimated to reduce the per-part cost by about 10.9%, through improved productivity.The details can change according to the machine type, part geometry, material types, and laser scanning strategies.Future work can integrate the packing optimisation with a process-based cost model to directly assess economic effects of our approach.

Maximisation of packing density
We also conduct an optimisation for maximum packing density.The detailed objective function and optimisation formulation can be found in Appendix F. Figure 6(c) corresponds to the results from two different cases: Case A for minimising f BT and Case B for maximising the packing efficiency.N part and N layers are the number of parts and printing layers of the optimal results, respectively.The last index, A proj , is the area of the part projected onto the build platform for a given build orientation; minimising this area can give an initial guess for maximising the number of parts in a single build (Allaire, Bihr, and Bogosel 2020).The ground truth map for each objective function tested for 37 by 37 grid points in the design variable space can be found in Appendix E. For the vehicle knuckle geometry, the difference between the case studies demonstrates a key tradeoff in build packing design: minimising build time per part (or support volume) results in less densely packed builds (Case A), while maximising packing efficiency results in more parts per build and greater support requirements (Case B).The per-part build time f BT is slightly higher in Case B due to the increased number of layers (due to the orientation of the part) and total scan length (due to the increased volume of the supports).The build time depends on both the scanning speed and recoating time, and therefore different process parameters affect the relative performance of the exemplary cases.A further example is introduced in Appendix G.
The support design criteria can also vary according to the process parameters, scan strategy, material, and other variables.As a simplified embodiment, Figure 7 predicts how build time changes with the specified critical angle and unsupported length.For implementation of this work, practitioners can experimentally determine support design parameters and apply these values to our algorithm.
The objective functions considered in this section are highly nonlinear.Particularly, the support design criteria can cause a discontinuity of the objective functions in the design variable space.For example, a small change in the part orientation can substantially change the required support volume when a local angle of a key surface is close to the critical angle requiring support.Also, the allowed maximum number of parts packed in the build chamber is an integer that discontinuously changes with the build orientation.The number of parts can be especially crucial in packing a small number of parts (e.g. less than five) as the printing time per part can significantly increase/decrease accordingly.For example, the number of parts in a single build can change from eight to four, as shown in Figure 6, even with a slight build orientation change.Thus, build orientation cannot be determined by simple indices, such as the projected part area to the build platform (A proj ), and all factors should be concurrently considered in the optimisation.Our approach has shown that an iterative sampling procedure can optimise the build orientation by incorporating the support design algorithm, packing layout design algorithm, build time analysis tool with slicing and tool path planning, and even manufacturability constraint analysis.It is a key feature that differentiates our platform from the previous studies introduced by (Qin et al. 2021) or current commercial packages for AM build preparation.Other tools determine each build parameter in sequence after fixing the build orientation, which is not capable of addressing the simultaneous considerations presented in this study.

Perspectives on thermo-mechanical deformations and residual stresses
Another key factor highly related to build orientation and support structure design in LPBF is thermo-mechanical deformation and residual stress caused by shrinkage during cooling.Although the residual stress is not directly considered in this study, the support structure designed for specific features, such as overhanging structures, can prevent excessive deformation that could compromise the accuracy of the printed part.
Since we did not directly apply a physical simulation, such as the inherent strain method (Zhang et al. 2020), to estimate the part deformation accompanied by the printing process, an alternative solution for finding the build orientation is to minimise the support volume.Generally, the less support, the lower chance of inducing residual stresses.Besides the support minimisation, we can also consider other objective functions.For example, minimising the part height, i.e. the number of layers, can be an effective solution.The residual stress could increase when printing a tall structure as the shrinkage effect accumulates layer by layer.So, laying the part horizontally can in some cases mitigate the stress issue.On the other hand, a large cross-section at a specific layer can also be undesirable because printing the corresponding layer requires high energy input.Thus, an objective function, such as the standard deviation of the cross-section of each sliced layer, could present an interesting candidate for optimisation.By doing this, we can derive the build orientation that evenly distributes the thermal energy along the build direction.

Consideration of post-processing constraints
We now demonstrate how our sampling-based optimisation framework can incorporate considerations of tool accessibility and surface quality.As such, Figure 8 shows a square hollow duct; supports cannot be removed from certain areas of the duct interior.We employ the raytracing algorithm introduced in Section 2.3, as formulated in (14).
Here, is a very small value (0.01), chosen as such to relax the optimisation problem.The support requirements and LPBF parameters are the same as the previous case studies.
The optimisation algorithm evaluated 130 samples, including 25 initial samples uniformly distributed on the solution space.Figures 8 (c,d) show the iteration history of the objective and constraint functions, where the feasibility is represented by 0 (infeasible) or 1 (feasible).The optimisation algorithm achieved the best solution at the 71st sampling point (Figure 8(e)); the minimum f BT equals 528.1 sec/cc.The optimum build orientation obtained by Bayesian optimisation is 2.1% better in the build rate than the other feasible solution in Figure 8(b), an example of the intuitively designed solution to minimise the supports and avoid inaccessible support structures.The iteration history in Figure 8(d) shows the effectiveness of our approach in the constrained problem.The probability of selecting a feasible solution, calculated from the number of feasible solutions divided by the number of samples at each iteration, exceeds 50% at the end of the optimisation.This represents that the model prediction becomes more and more accurate with the accumulation of the data set, so the algorithm can select a solution satisfying the constraint with a higher probability.Figure 8(e) show the sampling points plotted on the ground truth map for objective and constraint functions.The ground truth map was obtained by testing 37 by 37 grid points.In Figure 8(e), the blue-coloured region corresponds to the feasible region.Here, we applied 0.1 to ε c i in ( 9).If we increase ε c i , the algorithm will spend more effort on exploration rather than exploitation.Exploitation prefers sampling in predictable regions i.e. near the already explored area, while exploration prefers sampling in unpredictable and unexplored regions.
The sampling-based approach can also incorporate constraints that specific surfaces should remain unsupported and upward-facing, if desired for maximum as-printed surface quality.The staircase effect and adherence of partially sintered powder affect the quality of sloped surfaces in LPBF (Strano et al. 2013).Particularly, downward-facing surfaces (downskins) of the AM part, have higher surface roughness than upward facing surfaces (upskins).An example of optimisation considering surface quality constraints is in Appendix H.
pt The proposed Bayesian optimisation approach with manufacturability constraints can be extended to estimate other decision-making factors.For example, we can apply a physics-based simulation, such as distortion FEanalysis or micro-scale melt pool analysis, to estimate the part accuracy, surface quality, or porosity caused by keyhole formation.This information can be used to determine the desired build orientation, packing strategy, and support placement.Additionally, the algorithm can also assist agile decision-making by providing a prediction model for objective functions after the optimisation.For example, it is possible to predict the trade-off between the manufacturability or quality constraints and throughput rate; details of such an example are described in Appendix H.The prediction map obtained through optimisation can also be utilised in modifying detailed features of the studied AM part, considering build time and manufacturability.For example, the part geometry can be adjusted to avoid a specific feature with a shallow angle that requires support structures.During that procedure, the prediction map could estimate in advance the rate/cost advantages of the local geometry modification.In addition to the design modification, the obtained prediction map can also be applied to derive the best factory operation solution.For example, the optimal production planning of the AM factory would minimise the bottleneck of the whole production process from printing to postprocessing and quality tests, considering the number of given machines and production orders.When deriving the most efficient batch production strategies, a relation between the per-part printing time and the number of parts in a single batch, involved in the prediction model, can be utilised to estimate the printer running time and waiting time in the following steps after the printing.By doing this, we can reduce the work-in-progress and improve productivity when producing the given orders.
To summarise, our framework is flexible to incorporate AM (support) design and process into the production planning phase, so build orientation can be optimised while considering printing time and manufacturability at once.Also, the framework can efficiently handle highly nonlinear responses.Thus, we expect the algorithm can connect multi-scale decision-making problems in production planning, from part design and build configuration to AM factory scheduling, in the future.

Conclusion
We proposed a sampling-based optimisation framework that can be applied to AM build layout problems with manufacturability constraints.The geometry-based analyses for satisfying support structure requirements, support accessibility, machine tool accessibility, and surface finish specifications, are coupled with an adaptively sampled optimisation framework.The approach confronts the complex interdependencies of part geometry, machine capability, build orientation and throughput, and demonstrates the need for advanced computational approaches to design effectively in non-linear AM parameter spaces.Future work may extend the sampling-based optimisation framework to address: (1) material-process-layout co-optimisation for mitigating defects such as thermally induced distortion; (2) design of support structures using topology optimisation; (3) coupled consideration of AM process planning with requirements for machining (e.g.assessing how machining time and/or cost vary with the amount and geometry of supports).Our study is based on the LPBF process, but the geometry-based analysis and sampling-based optimisation can be adapted to other AM processes such as photopolymerization.Gaussian Process Regression can suffer from a data sparsity issue or require exhaustive training effort when presented with a high dimensional design space.Therefore, we will need a more rigorous algorithmic study, such as testing various acquisition functions (i.e.sample point recommendation functions) suitable for multi-variable and multi-objective optimisation problems, to extend the Bayesian sampling framework to AM design-manufacturing optimisation problems in future work.For example, the AM problem scale can be extended to simultaneously optimise part design attributes, AM process control parameters, and factorylevel production planning.being processed by the opening operation.Last, we apply a dilation filter to the detected slender supports to increase the thickness/width and union the fortified support structures with the original support.Figure D1 shows the three-step applied to improve the support design quality.The final result has the support structure of the same topology as the original support, yet it does not have a too slender member.The threshold detecting the slender member could be adjusted by controlling the threshold value, determined by the filter size in the opening operation.Likewise, the degree of reinforcement in Step 3 can also be decided by the filter size applied to dilation in Step 3.

Appendix H. Optimisation with constraints for surface quality
The optimisation problem in (H1-H4) minimises the total printing time while constraining the upskin ratio of the critical surfaces and inaccessible area ratio for a given post-machining tool.
Find φ X , φ Y (H1) Minimize t print,tot (H2) Subject to V support,pocket /V pocket ≤ 0.05 (H3) S crit,downskin /S crit ≤ 0.25 (H4) The pocket area in (H3) is estimated by a morphologybased filter introduced in Section 2.3, where V support,pocket is the volume of supports located inside cavities, and V pocket is the total volume of pocket areas.In this case study, we assume a probe radius (r p ) of 5 mm, corresponding to the tool radius.In (H4), S crit is the total area of the critical surface (here, bunny's face), and S crit,downskin is the downskin surface area among the critical surfaces.After optimisation, less than 25% of the critical surface becomes the downskin (see Figure H1  the critical surface constraint will be dominant in this example.To optimise the build orientation, we sampled 25 initial samples and 35 additional samples adaptively.Among 35 actively sampled points, seven points are located inside the feasible region, and the probability of picking a feasible sample is four times higher than the uniform grid sampling (62 feasible points among 1296 grid points).It demonstrates how active learning (adaptive sampling) stands to bolster our ability to navigate complex design spaces, compared to the uniform grid search approach.
At the end of optimisation, we can also get prediction models for each objective/constraint function, i.e. the GP regression model.false positive rate and the false negative rate for the given constraint function.It corresponds to a ratio of the samples in the coloured region in Figure H1(c).The prediction models for constraints in (H3) and (H4) answered incorrectly with the probabilities of 15.2% (197/1296) and 1.08% (14/1296), respectively.The accuracy is acceptable to utilise the model in what-if simulations, and Figure H1(d) shows the predicted and actual testing results for AM throughput improved with the surface quality constraint relaxation.Here, we assumed a scenario that increases the upper bound of the constraint in (H4) from 0.2-0.5.The predicted amount of improvement, i.e.AM throughput increase, has demonstrated good agreement with the patterns appearing in actual testing value.Therefore, one could make a decision quickly, even without repeating the whole optimisation process.

Figure 1 .
Figure 1.Schematic two-dimensional representations of exemplary part features and corresponding voxel meshes.The support structures are designed based on the criteria: (a) critical angle, (b) critical length.(c) An example of the self-intersecting supporting structure.(d) A design case considering the critical angle and length at once.

Figure 2 .
Figure 2. Workflow for a lattice-type supporting structure design.The consecutively applied design steps are (i) voxelization, (ii) rulebased design, and (iii) lattice structure application.

Figure 3 .
Figure 3. Schematic illustration of the support structure design algorithm and packing strategy analysis.For the given build orientation and print bed size, the packing strategy analysis algorithm finds the best layout parameters in the XY-plane to maximise the number of parts packed in a single build.The algorithm tests all combinations of the Z-axis rotation, X-/Y-distance between the adjacent parts, and misalignment between the neighbouring rows/columns.The algorithm preserves the specified minimum gap between adjacent parts.

Figure 4 .
Figure 4. (a) Description of the ray-casting analysis applied to the AM part and supports (b) Schematic illustration of the ray-tracing algorithm in a three-dimensional voxel mesh (c) An example of the part containing supporting structures located inside of the pocket area.The machining tool cannot access the pocket area by passing through the gate due to the tool size/shape.(d) A morphology-based filter can detect inaccessible areas for the given machining tool radius.

Figure 5 .
Figure 5. Orientation optimisation for a single part.(a) A vehicle suspension knuckle (b) The support volume minimisation result (c) Iteration history of the objective function in the support volume minimisation case (d) Sampled points plotted on the prediction map for the support-to-part volume ratio.

Figure 6 .
Figure 6.Layout optimisation results according to (a) build time per part minimisation and (b) packing density maximisation, both for a conceptual single laser machine with a scanning speed of 300 mm/s.(c) Tabulated results for (a) and (b).

Figure 7 .
Figure 7. Application of the optimisation framework to the suspension knuckle case study considering different values of the critical angle and length.(a,b) Calculated build time (sec/cc) and support volume ratio versus critical angle.(c) Representative visualisations of corresponding build layouts.

Figure 8 .
Figure 8. Case study of a hollow duct with a support accessibility constraint.(a) 3D model of the duct.(b) An example of build orientation without supports located inside the duct.(c) Iteration history of the objective and constraint functions.(d) Increase in the probability of selecting a feasible solution with each iteration.(e) The sampled points plotted on the ground truth map for the objective and constraint functions.The purple regions in the constraint feasibility map denote regions of the parameter space that satisfy the constraint that support structures should be accessible.
product development processes, and simulation-driven frameworks for integrating new technologies, such as additive manufacturing, with preexisting engineering workflow.KaitlynGee is a PhD candidate in the Department of Mechanical Engineering at the Massachusetts Institute of Technology.Her research centres on understanding how the value, cost, and environmental burden of additive manufacturing are coupled through the development of computational models for laser powder bed fusion, and exploring how designers could blend conventional manufacturing knowledge with Indigenous ways of knowing to unlock novel approaches to architect sustainable manufacturing systems.She is a National Science Foundation Graduate Research Fellow, a Tau Beta Pi Centennial Fellow, and an MIT Presidential Fellow.Her work has been published and presented in the Rapid Prototyping Journal, the International Conference on Simulation for Additive Manufacturing (SIM-AM), and the International Design Engineering Technical Conferences (IDETC).John Hart is Professor of Mechanical Engineering and Head of the Department of Mechanical Engineering at MIT.He also serves as Director of the Centre for Additive and Digital Advanced Production Technologies and Director of the Laboratory for Manufacturing and Productivity.John's research focuses on additive manufacturing, materials processing, precision engineering, and computational design.He is a co-founder of Desktop Metal and VulcanForms, and a Board Member of Carpenter Technology Corporation.

Figure A1 .
Figure A1.(a) Sample points and the candidate samples plotted in the two-dimensional solution space.(b,c) The probability function of the objective functions at point x i and x j , and the expected improvement value calculated for (b) a zero ε f and (c) a positive ε f .

Figure A2 .
Figure A2.Three-step design algorithm for detecting and reinforcing slender support members.

Figure A3 .
Figure A3.The solution space of the objective functions calculated for the vehicle suspension knuckle in Figure5(a).The objective functions calculated at 37 by 37 uniform grid points.The printing process assumed a single laser scanning process with a 300 mm/s scanning speed.

Figure A4 .
Figure A4.Printing time minimisation result for 16x faster scanning speed scenario.
Figure A5.The printing time per unit part volume calculated at 37 by 37 uniform grid points for the vehicle suspension knuckle problem in Section 3.1.Case studies for printing with scan strategies of (a) 4x faster, (b) 8x faster, and (c) 16x faster than a single laser system with 300 mm/s scan speed.

Figure A6 .
Figure A6.Optimisation when a critical surface is specified to remain upward-facing.(a) Build orientation before and after optimisation (b) sampling points of the objective/constraint functions plotted on the ground truth map (top) and the prediction map obtained after the optimisation (bottom) (c) the prediction accuracy for the objective/constraint functions, and (d) the prediction/testing result of throughput improvement for the scenario of relaxed constraint upper bound in equation (H4).
Figure A7.Support designed and analyzed by Magics, a commercial package by Materialise.(a) original build orientation, (b) our optimisation result, and (c) suggested by Magics.