Skip to content

Commit 86f6cf9

Browse files
committed
init
1 parent 27dcaf0 commit 86f6cf9

File tree

5 files changed

+46
-1
lines changed

5 files changed

+46
-1
lines changed

README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
# gcode-arrays
2-
make multiple parts on a 3D printer
2+
This is a repository for making an array of the same part on a 3D printer, by duplicating the gcode.
3+
The parts are printed in one go, one at a time, as opposed to all at once layer by layer.
4+
5+
The advantage of this is that if one of the prints fail, the print can be cancelled and you will still have some parts succeed.
6+
7+
Great for small parts if you need them in high volume, like I did in a recent project. I assume you are using a marlin style gcode printer for using this code.
8+
9+
# Usage
10+
-Start by slicing your stl file in your favorite marlin style slicer!
11+
-Divide the outputted gcode into three files: start.gcode, middle.gcode, and end.gcode
12+
-Enter in main.py your desired parameters: x and y GAP for the distance between each part, x and y items for the quantity of parts in each axis.
13+
-Create a out.gcode file, and run main.py. The program will automatically write in the created out.gcode file.
14+
15+
# licesnse
16+
I applied the MIT open source license to this project.
17+
18+
Thanks, and enjoy!!

end.gcode

Whitespace-only changes.

main.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
X_ITEMS = 3
3+
Y_ITEMS = 2
4+
5+
X_GAP = 70
6+
Y_GAP = 120
7+
8+
f = open("start.gcode")
9+
start = f.read()
10+
11+
f = open("middle.gcode")
12+
middle = f.read()
13+
14+
f = open("end.gcode")
15+
end = f.read()
16+
17+
f = open("out.gcode", 'w')
18+
19+
f.write(start)
20+
for i in range(Y_ITEMS):
21+
for i in range(X_ITEMS):
22+
f.write(middle)
23+
f.write("G1 X"+str(X_GAP)+"\n")
24+
f.write("G92 X0\n")
25+
f.write("G28 X0\n")
26+
f.write("G1 Y"+str(Y_GAP)+"\n")
27+
f.write("G92 X0\n")
28+
f.write(end)
29+
f.close()

middle.gcode

Whitespace-only changes.

start.gcode

Whitespace-only changes.

0 commit comments

Comments
 (0)