## Appendix A MATLAB Implementation of the Optimization Algorithm
Lines 14-15:
```
1 Boundary=setdiff(unique([1:1:nely+1,nNode-nely:1:nNode,...  
nely+1:nely+1:nNode,1:nely+1:nNode-nely]),
2[(nely+1),nNode,0.4:nelx*(nely+1)+1,0.6:nelx*(nely+1)+1]);
```
Lines 31-32:
```
1F=sparse([2*(nely+1),2*nNode],[1,1],[-100,-100],2*nNode,1);
2 fixeddofs=[2*0.4*nelx*(nely+1)+2,2*0.6*nelx*(nely+1)+2];
```
There are changes to achieve model Figure 7c. Line 1:
```
1 nelx=120;nely=60;volfrac=0.5;
```
Lines 14-15:
```
1 Boundary=setdiff(unique([1:1:nely+1,nNode-nely:1:nNode,...  
nely+1:nely+1:nNode,1:nely+1:nNode-nely]),
2[(nely+1)*nelx+ceil(nely/2)+1));
```
Lines 31-32:
```
1F=sparse(2*((nely+1)*nelx+ceil(nely/2)+1),1,-100,2*nNode,1);
2 fixeddofs=1:1:2*(nely+1);
```
There are changes to achieve model Figure 7d. Line 1:
```
1 Boundary=setdiff(unique([1:1:nely+1,nNode-nely:1:nNode,...  
nely+1:nely+1:nNode,1:nely+1:nNode-nely]),
2[(1:1:(nely+1)),[1:((nely+1)+2):(nNode-(nely+1)+2+1)]]);
```
Lines 31-32:
```
1F=sparse([2*[1:1:(nely+1)]-1],ones(1,numel([1:1:(nely+1)])),...
2[1:1:numel([1:1:(nely+1)])],2*nNode,1);
3 fixeddofs=[[1:((nely+1)+2):(nNode-(nely+1)+2+1)],...
4[1:((nely+1)+2):(nNode-(nely+1)+2+1)]+1];
```
There are changes to achieve model Figure 7e. Line 1:
```
1 nelx=60;nely=120;volfrac=0.5;
```
Lines 14-15:
```
1 Boundary=setdiff(unique([1:1:nely+1,nNode-nely:1:nNode,...  
nely+1:nely+1:nNode,1:nely+1:nNode-nely]),
2[(nely+1),nNode,0.4*nelx*(nely+1)+1,0.6*nelx*(nely+1)+1]);
```

Lines 31-32:

## References

* (1)
* (2) [PERSON]; [PERSON]; [PERSON]; [PERSON] CAD-based design and pre-processing tools for additive manufacturing. _J. Manuf. Syst._**2019**, _52_, 227-241. [CrossRef]
* (3) [PERSON]; [PERSON]; [PERSON]; [PERSON] Metal additive manufacturing in the commercial aviation industry: A review. _J. Manuf. Syst._**2019**, _53_, 124-149. [CrossRef]
* (4) [PERSON]; [PERSON] An assessment of data formats for layered manufacturing. _Adv. Eng. Softw._**1997**, _28_, 151-164. [CrossRef]
* (5) [PERSON]; [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] Microstructures to Control Elasticity in 3D Printing. _ACM Trans. Graph._**2015**, _34_. [CrossRef]
* (6) [PERSON]; [PERSON]; [PERSON] [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Cultural Heritage Preservation Using Constructive Shape Modeling. _Comput. Graph. Forum_**2004**, _23_, 25-41. [CrossRef]
* (7) [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON] Function representation in geometric modeling: Concepts, implementation and applications. _Vis. Comput._**1995**, _11_, 429-446. [CrossRef]
* (8) [PERSON] Method of R-functions in boundary-value problems. _Sov. Appl. Mech._**1975**, _11_, 345-354. [CrossRef]
* (9) [PERSON]; [PERSON] Function representation for sweeping by a moving solid. _IEEE Trans. Vis. Comput. Graph._**1996**, \(2\), 11-18. [CrossRef]
* (10) [PERSON]; [PERSON] Trimming implicit surfaces. _Vis. Comput._**2004**, _20_, 437-447. [CrossRef]
* (11) [PERSON]; [PERSON]; [PERSON] Space-time blending. _Comput. Animat. Virtual Worlds_**2004**, _15_, 109-121. [CrossRef]
* (12) [PERSON]; [PERSON]; [PERSON] Application of the method of R-functions to integration of differential equations with partial derivatives. _Cybern. Syst. Anal._**1999**, _35_, 1-18. [CrossRef]
* (13) [PERSON]; [PERSON]; [PERSON]; [PERSON] Shape optimization with topological changes and parametric control. _Int. J. Numer. Methods Eng._**2007**, _71_, 313-346. [CrossRef]
* (14) [PERSON]; [PERSON]; [PERSON] A review of level-set methods and some recent applications. _J. Comput. Phys._**2018**, _353_, 82-109. [CrossRef]
* (15) [PERSON]; [PERSON]; [PERSON]; [PERSON] Level-set methods for structural topology optimization: A review. _Struct. Multidiscip. Optim._**2013**, _48_, 437-472. [CrossRef]
* (16) [PERSON]; [PERSON]; [PERSON]; [PERSON] A multi-material level set-based topology and shape optimization method. _Comput. Methods Appl. Mech. Eng._**2015**, _283_, 1570-1586. [CrossRef]
* (17) [PERSON] 3D topology optimization of continuous fiber-reinforced structures via natural evolution method. _Compos.