-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgcodepreview.scad
152 lines (118 loc) · 3.8 KB
/
gcodepreview.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//!OpenSCAD
//gcodepreview version 0.8
//
//used via include <gcodepreview.scad>;
//
use <gcodepreview.py>
module gcpversion(){
echo(pygcpversion());
}
//function myfunc(var) = gcp.myfunc(var);
//
//function getvv() = gcp.getvv();
//
//module makecube(xdim, ydim, zdim){
//gcp.makecube(xdim, ydim, zdim);
//}
//
//module placecube(){
//gcp.placecube();
//}
//
//module instantiatecube(){
//gcp.instantiatecube();
//}
//
function xpos() = gcp.xpos();
function ypos() = gcp.ypos();
function zpos() = gcp.zpos();
module setupstock(stockXwidth, stockYheight, stockZthickness, zeroheight, stockzero, retractheight) {
gcp.setupstock(stockXwidth, stockYheight, stockZthickness, zeroheight, stockzero, retractheight);
}
module cutroundover(bx, by, bz, ex, ey, ez, radiustn) {
if (radiustn == 56125) {
cutroundovertool(bx, by, bz, ex, ey, ez, 0.508/2, 1.531);
} else if (radiustn == 56142) {
cutroundovertool(bx, by, bz, ex, ey, ez, 0.508/2, 2.921);
// } else if (radiustn == 312) {
// cutroundovertool(bx, by, bz, ex, ey, ez, 1.524/2, 3.175);
} else if (radiustn == 1570) {
cutroundovertool(bx, by, bz, ex, ey, ez, 0.507/2, 4.509);
}
}
module toolchange(tool_number, speed){
gcp.toolchange(tool_number, speed);
}
function tool_diameter(td_tool, td_depth) = otool_diameter(td_tool, td_depth);
module movetosafeZ(){
gcp.rapid(gcp.xpos(), gcp.ypos(), retractheight);
}
module rapid(ex, ey, ez) {
gcp.rapid(ex, ey, ez);
}
module rapidXY(ex, ey) {
gcp.rapid(ex, ey, gcp.zpos());
}
module rapidZ(ez) {
gcp.rapid(gcp.xpos(), gcp.ypos(), ez);
}
module cutline(ex, ey, ez){
gcp.cutline(ex, ey, ez);
}
module cutlinedxfgc(ex, ey, ez){
gcp.cutlinedxfgc(ex, ey, ez);
}
module cutZgcfeed(ez, feed){
gcp.cutZgcfeed(ez, feed);
}
module cutarcCC(barc, earc, xcenter, ycenter, radius, tpzreldim){
gcp.cutarcCC(barc, earc, xcenter, ycenter, radius, tpzreldim);
}
module cutarcCW(barc, earc, xcenter, ycenter, radius, tpzreldim){
gcp.cutarcCW(barc, earc, xcenter, ycenter, radius, tpzreldim);
}
module cutkeyholegcdxf(kh_tool_num, kh_start_depth, kh_max_depth, kht_direction, kh_distance){
gcp.cutkeyholegcdxf(kh_tool_num, kh_start_depth, kh_max_depth, kht_direction, kh_distance);
}
module stockandtoolpaths(){
gcp.stockandtoolpaths();
}
module stockwotoolpaths(){
gcp.stockandtoolpaths("stock");
}
module outputtoolpaths(){
gcp.stockandtoolpaths("toolpaths");
}
module outputrapids(){
gcp.stockandtoolpaths("rapids");
}
module opendxffile(basefilename){
gcp.opendxffile(basefilename);
}
module opendxffiles(Base_filename, large_square_tool_num, small_square_tool_num, large_ball_tool_num, small_ball_tool_num, large_V_tool_num, small_V_tool_num, DT_tool_num, KH_tool_num, Roundover_tool_num, MISC_tool_num) {
gcp.opendxffiles(Base_filename, large_square_tool_num, small_square_tool_num, large_ball_tool_num, small_ball_tool_num, large_V_tool_num, small_V_tool_num, DT_tool_num, KH_tool_num, Roundover_tool_num, MISC_tool_num);
}
module opengcodefile(basefilename, currenttoolnum, toolradius, plunge, feed, speed) {
gcp.opengcodefile(basefilename, currenttoolnum, toolradius, plunge, feed, speed);
}
module cutarcNECCdxfgc(ex, ey, ez, xcenter, ycenter, radius){
gcp.cutarcNECCdxfgc(ex, ey, ez, xcenter, ycenter, radius);
}
module cutarcNWCCdxfgc(ex, ey, ez, xcenter, ycenter, radius){
gcp.cutarcNWCCdxfgc(ex, ey, ez, xcenter, ycenter, radius);
}
module cutarcSWCCdxfgc(ex, ey, ez, xcenter, ycenter, radius){
gcp.cutarcSWCCdxfgc(ex, ey, ez, xcenter, ycenter, radius);
}
module cutarcSECCdxfgc(ex, ey, ez, xcenter, ycenter, radius){
gcp.cutarcSECCdxfgc(ex, ey, ez, xcenter, ycenter, radius);
}
module closegcodefile(){
gcp.closegcodefile();
}
module closedxffiles(){
gcp.closedxffiles();
}
module closedxffile(){
gcp.closedxffile();
}