Commit cc94368a authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

progress towards getting infill working

parent 28e92c3a
...@@ -186,6 +186,40 @@ class solver: ...@@ -186,6 +186,40 @@ class solver:
return contours return contours
def infill_contour(self, n, density):
"""
return one contour for the infill
if n is even, the infill for that layer is parallel to the x-axis
"""
# Get the direction to print in
if n%2 == 0:
main = self.x
other = self.y
else:
main = self.y
other = self.x
# get the list of rows to do
main_vals = np.arange(self.range[main][0],self.range[main][1], density)[1:]
# do the first row
expr1 = self.plane_intersection(main, main_vals[0], layer = n)
os, zs = self.sample(expr1, other)
poses = [Position(self.range[main][0],os[i],zs[i]) for i in range(len(os))]
# loop through th remaining rows, linking them
for row in main_vals[1:]:
# TODO link to the next row
# TODO do the next row (need to reverse directions each time)
expr1 = self.plane_intersection(main, row, layer = n)
os, zs = self.sample(expr1, other)
poses = [Position(self.range[main][0],os[i],zs[i]) for i in range(len(os))]
def show(self): def show(self):
""" """
Show the surface of the layer Show the surface of the layer
...@@ -202,5 +236,6 @@ if __name__ == '__main__': ...@@ -202,5 +236,6 @@ if __name__ == '__main__':
contours = [] contours = []
for i in np.arange(-15,55): for i in np.arange(-15,55):
contours += s.contour_n(i) contours += s.contour_n(i)
contours += s.infill_contour(i, 0.02)
plot_contours(contours) plot_contours(contours)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment