Skip to main content
. 2024 Nov 15;17(22):5596. doi: 10.3390/ma17225596
Algorithm 1 Corrugated infill pattern algorithm.
 1: Initialize the preferred type of infill pattern and calculate the position of anchor points (seeds)
 2: l,i,c,o0 ▹ layer, interfaces, contact, old seeds
 3: if infill type is corrugated then
 4:   infill, seeds ←corrugated infill(l,i,c,o))
 5: end if
 6: function corrugated infill(l,i,c,o)
 7:   sfind closest points(l,o) ▹ seeds
 8:   p[0,0,0] ▹ points
 9:   while n<i do
10:     rn/i ▹ ratio
11:     if c is even then ▹ inside contour
12:       bP on contour(l.in,s.in,r-c/2)
13:       eP on contour(l.in,s.in,r+c/2)
14:       tpoints between(b,e)
15:     else ▹ outside contour
16:       bP on contour(l.out,s.out,r-c/2)
17:       eP on contour(l.out,s.out,r+c/2)
18:       tpoints between(b,e)
19:     end if
20:     nn+1
21:     pp+[b,e,t]
22:   end while
23:   fcreate line segments(p)
24: return   f
25: end function
26: function P on contour(k,s,r)
27:   kreorder(k,s)
28:   gcircumference(k)+r
29:   m,d0 ▹ segment, distance
30:   while h<g do
31:     hdistance(k[m],k[m+1]) ▹ length
32:     dd+h
33:     mm+1
34:   end while
35:   wgd
36:   uw/h
37:   pInterpolate(k[m],k[m1],u)
38: return  p
39: end function