last few months of work
[mirrors/Designs.git] / cnc / 3D / g-code.scad
1 module tool() {
2 //simulate 1/8'' flat end mill
3 cylinder(20,1.5875,1.5875, $fn=10);
4 }
5
6 /*
7 module tool() {
8 //show toolpaths as thin lines or simulate 3d printer
9 sphere(0.1, $fn=10);
10 }
11 */
12
13 module path(a, b) {
14 hull() {
15 translate(a) tool();
16 translate(b) tool();
17 }
18 }
19
20 module gcode(vec) {
21 for(i = [0:len(vec)]) path(vec[i-2],vec[i-1]);
22 }
23
24 //vector generated from g-code
25 vec = [
26 [0,0,0],
27 [0,0,-10],
28 [10,20,-10],
29 [20,10,-10],
30 [30,10,-10],
31 [30,10,0],
32 ];
33
34 difference() {
35 //stock material
36 %translate([-10,-10,-20]) cube([50,40,20]);
37 //object generated from g-code
38 gcode(vec);
39 }
This page took 0.270354 seconds and 4 git commands to generate.