├── .DS_Store ├── .classpath ├── .gitignore ├── .project ├── README.md ├── examples ├── .DS_Store ├── Hello │ └── Hello.pde └── simpleCube │ ├── code01.txt │ └── simpleCube.pde ├── library └── .DS_Store ├── reference ├── .DS_Store ├── allclasses-frame.html ├── allclasses-noframe.html ├── codeThreadLib │ └── library │ │ ├── CodeThread.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html ├── constant-values.html ├── deprecated-list.html ├── help-doc.html ├── index-all.html ├── index.html ├── overview-tree.html ├── package-list ├── resources │ └── inherit.gif └── stylesheet.css └── src ├── .DS_Store └── codeThreadLib ├── .DS_Store └── library ├── .DS_Store ├── CodeThread.java └── ThreadCommands.java /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiatomStudio/CodeThread/3403985d7e9a71e1758abcfaa0486cf76fa7ccfa/.DS_Store -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Package Files # 4 | *.jar 5 | *.war 6 | *.ear 7 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | codeThreadLib 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CodeThread 2 | ---------- 3 | 4 | CodeThread is libary for processing that lets you create g-code as you calculate coordinates for a toolpath. One of the things we love about makerbot in contrast to commercial printers is that you have complete control over every aspect of the print technique. We think there is a lot of opportunity to develop new printing styles with makerbots, beyond traditional solid prints. We wanted to experiment with the materiality of makerbot prints by working directly in gcode with processing, so we made this small library that provides some simple functions for generating gcode commands, and prints a gcode file. 5 | 6 | 7 | ****For example, here is some code for a 30mm thin-walled cube:**** 8 | ```java 9 | CodeThread codeThread= new CodeThread(); 10 | 11 | int feed = 1200; 12 | 13 | codeThread.setDefaults(); 14 | codeThread.extruderOnFwd(); 15 | 16 | codeThread.generateRaft(40, 40, 560, 1500, 2.5, 1.5); 17 | 18 | for(float i=0; i<30; i+=0.35) { 19 | codeThread.moveTo(15, 15, 1.27+i, feed); 20 | codeThread.moveTo(-15, 15, 1.27+i, feed); 21 | codeThread.moveTo(-15, -15, 1.27+i, feed); 22 | codeThread.moveTo(15, -15, 1.27+i, feed); 23 | } 24 | 25 | codeThread.extruderOff(); 26 | codeThread.writeToFile(sketchPath + "30mmbox.gcode"); 27 | ``` 28 | -------------------------------------------------------------------------------- /examples/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiatomStudio/CodeThread/3403985d7e9a71e1758abcfaa0486cf76fa7ccfa/examples/.DS_Store -------------------------------------------------------------------------------- /examples/Hello/Hello.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * codeThread - simple cube example 3 | * by: Diatom Studio (diatom.cc) 4 | * 5 | * A simple example of using codeThread to generate tool paths or printing a simple cube and raft on makerbot 6 | * 7 | * 8 | */ 9 | 10 | import codeThreadLib.library.*; 11 | 12 | CodeThread codeThread = new CodeThread(this); 13 | 14 | void setup() { 15 | size(300,300,P3D); 16 | 17 | codeThread.setDefault(); // set your craft robo to default settings 18 | 19 | //generate a cube 20 | float sideLen = 30; // lenght of the cubes side 21 | float headSpeed = 1556.0f; // speed that the extruder head will travel at whilst printing 22 | float zPos = 0; // keep track of the z pos of the extruder head 23 | float zStep = 0.35f; // the amount to move up each step on the z axis 24 | 25 | //generate a raft 26 | codeThread.generateRaft(sideLen +5, sideLen + 5, 560,1500, 2.5f,1.5f); // generate a raft generateRaft(raftWidth,raftLength, headSpeedBottomLayer,headSpeedTopLayer, distanceBetweenSlatsBottomLayer,DistanceBetweenSlatsTopLayer) 27 | zPos = 1.27;// after drawing the raft our new zheight is 1.27(mm) 28 | 29 | for(zPos = 1.27; zPos < sideLen ; zPos+=zStep) { 30 | 31 | //move the extruder head to each corner of the box 32 | codeThread.moveTo(-(sideLen/2),-(sideLen/2),zPos,headSpeed); 33 | 34 | codeThread.extruderOnFwd(); // start extruding, now we're at the start point 35 | 36 | codeThread.moveTo((sideLen/2),-(sideLen/2),zPos,headSpeed); //whilst extruding move extruder to 2nd corner 37 | codeThread.moveTo((sideLen/2),(sideLen/2),zPos,headSpeed); 38 | codeThread.moveTo(-(sideLen/2),(sideLen/2),zPos,headSpeed); 39 | codeThread.moveTo(-(sideLen/2),-(sideLen/2),zPos,headSpeed); //back to the start, 40 | 41 | //now we have a square, step up in the z direction and start all over again 42 | codeThread.extruderOff(); // stop extruding 43 | } 44 | 45 | codeThread.printToConsole(); // print to console 46 | codeThread.writeToFile(sketchPath +"/code01.txt"); 47 | } 48 | 49 | 50 | 51 | 52 | void draw() { 53 | 54 | //make things pretty, rotate and zoom to see cube 55 | smooth(); 56 | background(255); 57 | pushMatrix(); 58 | translate(width/2,height/2);//center at 0,0 59 | rotateX(PI/4); 60 | rotateZ(PI/4); 61 | scale(3.5f); 62 | 63 | //draw the platform 64 | noStroke(); 65 | fill(220,220,220); 66 | rect(-(80/2),-(80/2),(80),(80)); // draw the makerbot platform for reference 67 | stroke(255,0,0); 68 | 69 | 70 | codeThread.render(); //render the tool paths 71 | 72 | 73 | popMatrix(); 74 | } 75 | 76 | -------------------------------------------------------------------------------- /examples/simpleCube/code01.txt: -------------------------------------------------------------------------------- 1 | M104 S220 T0 2 | M109 S110 T0 3 | G21 4 | G90 5 | G92 X0 Y0 Z0 6 | M108 S240 7 | M6 T0 8 | G1 X-17.5 Y-27.5 Z0.35 F1500.0 9 | M101 10 | G1 X-17.5 Y-17.5 Z0.35 F560.0 11 | G1 X-17.5 Y17.5 Z0.35 F560.0 12 | G1 X-15.0 Y17.5 Z0.35 F560.0 13 | G1 X-15.0 Y-17.5 Z0.35 F560.0 14 | G1 X-12.5 Y-17.5 Z0.35 F560.0 15 | G1 X-12.5 Y17.5 Z0.35 F560.0 16 | G1 X-10.0 Y17.5 Z0.35 F560.0 17 | G1 X-10.0 Y-17.5 Z0.35 F560.0 18 | G1 X-7.5 Y-17.5 Z0.35 F560.0 19 | G1 X-7.5 Y17.5 Z0.35 F560.0 20 | G1 X-5.0 Y17.5 Z0.35 F560.0 21 | G1 X-5.0 Y-17.5 Z0.35 F560.0 22 | G1 X-2.5 Y-17.5 Z0.35 F560.0 23 | G1 X-2.5 Y17.5 Z0.35 F560.0 24 | G1 X0.0 Y17.5 Z0.35 F560.0 25 | G1 X0.0 Y-17.5 Z0.35 F560.0 26 | G1 X2.5 Y-17.5 Z0.35 F560.0 27 | G1 X2.5 Y17.5 Z0.35 F560.0 28 | G1 X5.0 Y17.5 Z0.35 F560.0 29 | G1 X5.0 Y-17.5 Z0.35 F560.0 30 | G1 X7.5 Y-17.5 Z0.35 F560.0 31 | G1 X7.5 Y17.5 Z0.35 F560.0 32 | G1 X10.0 Y17.5 Z0.35 F560.0 33 | G1 X10.0 Y-17.5 Z0.35 F560.0 34 | G1 X12.5 Y-17.5 Z0.35 F560.0 35 | G1 X12.5 Y17.5 Z0.35 F560.0 36 | G1 X15.0 Y17.5 Z0.35 F560.0 37 | G1 X15.0 Y-17.5 Z0.35 F560.0 38 | M103 39 | G1 X17.5 Y18.5 Z0.35 F1500.0 40 | M101 41 | G1 X17.5 Y17.5 Z0.81 F1500.0 42 | G1 X-17.5 Y17.5 Z0.81 F1500.0 43 | G1 X-17.5 Y16.0 Z0.81 F1500.0 44 | G1 X17.5 Y16.0 Z0.81 F1500.0 45 | G1 X17.5 Y14.5 Z0.81 F1500.0 46 | G1 X-17.5 Y14.5 Z0.81 F1500.0 47 | G1 X-17.5 Y13.0 Z0.81 F1500.0 48 | G1 X17.5 Y13.0 Z0.81 F1500.0 49 | G1 X17.5 Y11.5 Z0.81 F1500.0 50 | G1 X-17.5 Y11.5 Z0.81 F1500.0 51 | G1 X-17.5 Y10.0 Z0.81 F1500.0 52 | G1 X17.5 Y10.0 Z0.81 F1500.0 53 | G1 X17.5 Y8.5 Z0.81 F1500.0 54 | G1 X-17.5 Y8.5 Z0.81 F1500.0 55 | G1 X-17.5 Y7.0 Z0.81 F1500.0 56 | G1 X17.5 Y7.0 Z0.81 F1500.0 57 | G1 X17.5 Y5.5 Z0.81 F1500.0 58 | G1 X-17.5 Y5.5 Z0.81 F1500.0 59 | G1 X-17.5 Y4.0 Z0.81 F1500.0 60 | G1 X17.5 Y4.0 Z0.81 F1500.0 61 | G1 X17.5 Y2.5 Z0.81 F1500.0 62 | G1 X-17.5 Y2.5 Z0.81 F1500.0 63 | G1 X-17.5 Y1.0 Z0.81 F1500.0 64 | G1 X17.5 Y1.0 Z0.81 F1500.0 65 | G1 X17.5 Y-0.5 Z0.81 F1500.0 66 | G1 X-17.5 Y-0.5 Z0.81 F1500.0 67 | G1 X-17.5 Y-2.0 Z0.81 F1500.0 68 | G1 X17.5 Y-2.0 Z0.81 F1500.0 69 | G1 X17.5 Y-3.5 Z0.81 F1500.0 70 | G1 X-17.5 Y-3.5 Z0.81 F1500.0 71 | G1 X-17.5 Y-5.0 Z0.81 F1500.0 72 | G1 X17.5 Y-5.0 Z0.81 F1500.0 73 | G1 X17.5 Y-6.5 Z0.81 F1500.0 74 | G1 X-17.5 Y-6.5 Z0.81 F1500.0 75 | G1 X-17.5 Y-8.0 Z0.81 F1500.0 76 | G1 X17.5 Y-8.0 Z0.81 F1500.0 77 | G1 X17.5 Y-9.5 Z0.81 F1500.0 78 | G1 X-17.5 Y-9.5 Z0.81 F1500.0 79 | G1 X-17.5 Y-11.0 Z0.81 F1500.0 80 | G1 X17.5 Y-11.0 Z0.81 F1500.0 81 | G1 X17.5 Y-12.5 Z0.81 F1500.0 82 | G1 X-17.5 Y-12.5 Z0.81 F1500.0 83 | G1 X-17.5 Y-14.0 Z0.81 F1500.0 84 | G1 X17.5 Y-14.0 Z0.81 F1500.0 85 | G1 X17.5 Y-15.5 Z0.81 F1500.0 86 | G1 X-17.5 Y-15.5 Z0.81 F1500.0 87 | G1 X-17.5 Y-17.0 Z0.81 F1500.0 88 | G1 X17.5 Y-17.0 Z0.81 F1500.0 89 | M103 90 | G1 X-15.0 Y-15.0 Z1.27 F1556.0 91 | M101 92 | G1 X15.0 Y-15.0 Z1.27 F1556.0 93 | G1 X15.0 Y15.0 Z1.27 F1556.0 94 | G1 X-15.0 Y15.0 Z1.27 F1556.0 95 | G1 X-15.0 Y-15.0 Z1.27 F1556.0 96 | M103 97 | G1 X-15.0 Y-15.0 Z1.62 F1556.0 98 | M101 99 | G1 X15.0 Y-15.0 Z1.62 F1556.0 100 | G1 X15.0 Y15.0 Z1.62 F1556.0 101 | G1 X-15.0 Y15.0 Z1.62 F1556.0 102 | G1 X-15.0 Y-15.0 Z1.62 F1556.0 103 | M103 104 | G1 X-15.0 Y-15.0 Z1.97 F1556.0 105 | M101 106 | G1 X15.0 Y-15.0 Z1.97 F1556.0 107 | G1 X15.0 Y15.0 Z1.97 F1556.0 108 | G1 X-15.0 Y15.0 Z1.97 F1556.0 109 | G1 X-15.0 Y-15.0 Z1.97 F1556.0 110 | M103 111 | G1 X-15.0 Y-15.0 Z2.32 F1556.0 112 | M101 113 | G1 X15.0 Y-15.0 Z2.32 F1556.0 114 | G1 X15.0 Y15.0 Z2.32 F1556.0 115 | G1 X-15.0 Y15.0 Z2.32 F1556.0 116 | G1 X-15.0 Y-15.0 Z2.32 F1556.0 117 | M103 118 | G1 X-15.0 Y-15.0 Z2.6699998 F1556.0 119 | M101 120 | G1 X15.0 Y-15.0 Z2.6699998 F1556.0 121 | G1 X15.0 Y15.0 Z2.6699998 F1556.0 122 | G1 X-15.0 Y15.0 Z2.6699998 F1556.0 123 | G1 X-15.0 Y-15.0 Z2.6699998 F1556.0 124 | M103 125 | G1 X-15.0 Y-15.0 Z3.0199997 F1556.0 126 | M101 127 | G1 X15.0 Y-15.0 Z3.0199997 F1556.0 128 | G1 X15.0 Y15.0 Z3.0199997 F1556.0 129 | G1 X-15.0 Y15.0 Z3.0199997 F1556.0 130 | G1 X-15.0 Y-15.0 Z3.0199997 F1556.0 131 | M103 132 | G1 X-15.0 Y-15.0 Z3.3699996 F1556.0 133 | M101 134 | G1 X15.0 Y-15.0 Z3.3699996 F1556.0 135 | G1 X15.0 Y15.0 Z3.3699996 F1556.0 136 | G1 X-15.0 Y15.0 Z3.3699996 F1556.0 137 | G1 X-15.0 Y-15.0 Z3.3699996 F1556.0 138 | M103 139 | G1 X-15.0 Y-15.0 Z3.7199996 F1556.0 140 | M101 141 | G1 X15.0 Y-15.0 Z3.7199996 F1556.0 142 | G1 X15.0 Y15.0 Z3.7199996 F1556.0 143 | G1 X-15.0 Y15.0 Z3.7199996 F1556.0 144 | G1 X-15.0 Y-15.0 Z3.7199996 F1556.0 145 | M103 146 | G1 X-15.0 Y-15.0 Z4.0699997 F1556.0 147 | M101 148 | G1 X15.0 Y-15.0 Z4.0699997 F1556.0 149 | G1 X15.0 Y15.0 Z4.0699997 F1556.0 150 | G1 X-15.0 Y15.0 Z4.0699997 F1556.0 151 | G1 X-15.0 Y-15.0 Z4.0699997 F1556.0 152 | M103 153 | G1 X-15.0 Y-15.0 Z4.4199996 F1556.0 154 | M101 155 | G1 X15.0 Y-15.0 Z4.4199996 F1556.0 156 | G1 X15.0 Y15.0 Z4.4199996 F1556.0 157 | G1 X-15.0 Y15.0 Z4.4199996 F1556.0 158 | G1 X-15.0 Y-15.0 Z4.4199996 F1556.0 159 | M103 160 | G1 X-15.0 Y-15.0 Z4.7699995 F1556.0 161 | M101 162 | G1 X15.0 Y-15.0 Z4.7699995 F1556.0 163 | G1 X15.0 Y15.0 Z4.7699995 F1556.0 164 | G1 X-15.0 Y15.0 Z4.7699995 F1556.0 165 | G1 X-15.0 Y-15.0 Z4.7699995 F1556.0 166 | M103 167 | G1 X-15.0 Y-15.0 Z5.1199994 F1556.0 168 | M101 169 | G1 X15.0 Y-15.0 Z5.1199994 F1556.0 170 | G1 X15.0 Y15.0 Z5.1199994 F1556.0 171 | G1 X-15.0 Y15.0 Z5.1199994 F1556.0 172 | G1 X-15.0 Y-15.0 Z5.1199994 F1556.0 173 | M103 174 | G1 X-15.0 Y-15.0 Z5.4699993 F1556.0 175 | M101 176 | G1 X15.0 Y-15.0 Z5.4699993 F1556.0 177 | G1 X15.0 Y15.0 Z5.4699993 F1556.0 178 | G1 X-15.0 Y15.0 Z5.4699993 F1556.0 179 | G1 X-15.0 Y-15.0 Z5.4699993 F1556.0 180 | M103 181 | G1 X-15.0 Y-15.0 Z5.819999 F1556.0 182 | M101 183 | G1 X15.0 Y-15.0 Z5.819999 F1556.0 184 | G1 X15.0 Y15.0 Z5.819999 F1556.0 185 | G1 X-15.0 Y15.0 Z5.819999 F1556.0 186 | G1 X-15.0 Y-15.0 Z5.819999 F1556.0 187 | M103 188 | G1 X-15.0 Y-15.0 Z6.169999 F1556.0 189 | M101 190 | G1 X15.0 Y-15.0 Z6.169999 F1556.0 191 | G1 X15.0 Y15.0 Z6.169999 F1556.0 192 | G1 X-15.0 Y15.0 Z6.169999 F1556.0 193 | G1 X-15.0 Y-15.0 Z6.169999 F1556.0 194 | M103 195 | G1 X-15.0 Y-15.0 Z6.519999 F1556.0 196 | M101 197 | G1 X15.0 Y-15.0 Z6.519999 F1556.0 198 | G1 X15.0 Y15.0 Z6.519999 F1556.0 199 | G1 X-15.0 Y15.0 Z6.519999 F1556.0 200 | G1 X-15.0 Y-15.0 Z6.519999 F1556.0 201 | M103 202 | G1 X-15.0 Y-15.0 Z6.869999 F1556.0 203 | M101 204 | G1 X15.0 Y-15.0 Z6.869999 F1556.0 205 | G1 X15.0 Y15.0 Z6.869999 F1556.0 206 | G1 X-15.0 Y15.0 Z6.869999 F1556.0 207 | G1 X-15.0 Y-15.0 Z6.869999 F1556.0 208 | M103 209 | G1 X-15.0 Y-15.0 Z7.219999 F1556.0 210 | M101 211 | G1 X15.0 Y-15.0 Z7.219999 F1556.0 212 | G1 X15.0 Y15.0 Z7.219999 F1556.0 213 | G1 X-15.0 Y15.0 Z7.219999 F1556.0 214 | G1 X-15.0 Y-15.0 Z7.219999 F1556.0 215 | M103 216 | G1 X-15.0 Y-15.0 Z7.5699987 F1556.0 217 | M101 218 | G1 X15.0 Y-15.0 Z7.5699987 F1556.0 219 | G1 X15.0 Y15.0 Z7.5699987 F1556.0 220 | G1 X-15.0 Y15.0 Z7.5699987 F1556.0 221 | G1 X-15.0 Y-15.0 Z7.5699987 F1556.0 222 | M103 223 | G1 X-15.0 Y-15.0 Z7.9199986 F1556.0 224 | M101 225 | G1 X15.0 Y-15.0 Z7.9199986 F1556.0 226 | G1 X15.0 Y15.0 Z7.9199986 F1556.0 227 | G1 X-15.0 Y15.0 Z7.9199986 F1556.0 228 | G1 X-15.0 Y-15.0 Z7.9199986 F1556.0 229 | M103 230 | G1 X-15.0 Y-15.0 Z8.269999 F1556.0 231 | M101 232 | G1 X15.0 Y-15.0 Z8.269999 F1556.0 233 | G1 X15.0 Y15.0 Z8.269999 F1556.0 234 | G1 X-15.0 Y15.0 Z8.269999 F1556.0 235 | G1 X-15.0 Y-15.0 Z8.269999 F1556.0 236 | M103 237 | G1 X-15.0 Y-15.0 Z8.619999 F1556.0 238 | M101 239 | G1 X15.0 Y-15.0 Z8.619999 F1556.0 240 | G1 X15.0 Y15.0 Z8.619999 F1556.0 241 | G1 X-15.0 Y15.0 Z8.619999 F1556.0 242 | G1 X-15.0 Y-15.0 Z8.619999 F1556.0 243 | M103 244 | G1 X-15.0 Y-15.0 Z8.969999 F1556.0 245 | M101 246 | G1 X15.0 Y-15.0 Z8.969999 F1556.0 247 | G1 X15.0 Y15.0 Z8.969999 F1556.0 248 | G1 X-15.0 Y15.0 Z8.969999 F1556.0 249 | G1 X-15.0 Y-15.0 Z8.969999 F1556.0 250 | M103 251 | G1 X-15.0 Y-15.0 Z9.32 F1556.0 252 | M101 253 | G1 X15.0 Y-15.0 Z9.32 F1556.0 254 | G1 X15.0 Y15.0 Z9.32 F1556.0 255 | G1 X-15.0 Y15.0 Z9.32 F1556.0 256 | G1 X-15.0 Y-15.0 Z9.32 F1556.0 257 | M103 258 | G1 X-15.0 Y-15.0 Z9.67 F1556.0 259 | M101 260 | G1 X15.0 Y-15.0 Z9.67 F1556.0 261 | G1 X15.0 Y15.0 Z9.67 F1556.0 262 | G1 X-15.0 Y15.0 Z9.67 F1556.0 263 | G1 X-15.0 Y-15.0 Z9.67 F1556.0 264 | M103 265 | G1 X-15.0 Y-15.0 Z10.02 F1556.0 266 | M101 267 | G1 X15.0 Y-15.0 Z10.02 F1556.0 268 | G1 X15.0 Y15.0 Z10.02 F1556.0 269 | G1 X-15.0 Y15.0 Z10.02 F1556.0 270 | G1 X-15.0 Y-15.0 Z10.02 F1556.0 271 | M103 272 | G1 X-15.0 Y-15.0 Z10.370001 F1556.0 273 | M101 274 | G1 X15.0 Y-15.0 Z10.370001 F1556.0 275 | G1 X15.0 Y15.0 Z10.370001 F1556.0 276 | G1 X-15.0 Y15.0 Z10.370001 F1556.0 277 | G1 X-15.0 Y-15.0 Z10.370001 F1556.0 278 | M103 279 | G1 X-15.0 Y-15.0 Z10.720001 F1556.0 280 | M101 281 | G1 X15.0 Y-15.0 Z10.720001 F1556.0 282 | G1 X15.0 Y15.0 Z10.720001 F1556.0 283 | G1 X-15.0 Y15.0 Z10.720001 F1556.0 284 | G1 X-15.0 Y-15.0 Z10.720001 F1556.0 285 | M103 286 | G1 X-15.0 Y-15.0 Z11.070002 F1556.0 287 | M101 288 | G1 X15.0 Y-15.0 Z11.070002 F1556.0 289 | G1 X15.0 Y15.0 Z11.070002 F1556.0 290 | G1 X-15.0 Y15.0 Z11.070002 F1556.0 291 | G1 X-15.0 Y-15.0 Z11.070002 F1556.0 292 | M103 293 | G1 X-15.0 Y-15.0 Z11.420002 F1556.0 294 | M101 295 | G1 X15.0 Y-15.0 Z11.420002 F1556.0 296 | G1 X15.0 Y15.0 Z11.420002 F1556.0 297 | G1 X-15.0 Y15.0 Z11.420002 F1556.0 298 | G1 X-15.0 Y-15.0 Z11.420002 F1556.0 299 | M103 300 | G1 X-15.0 Y-15.0 Z11.770002 F1556.0 301 | M101 302 | G1 X15.0 Y-15.0 Z11.770002 F1556.0 303 | G1 X15.0 Y15.0 Z11.770002 F1556.0 304 | G1 X-15.0 Y15.0 Z11.770002 F1556.0 305 | G1 X-15.0 Y-15.0 Z11.770002 F1556.0 306 | M103 307 | G1 X-15.0 Y-15.0 Z12.120003 F1556.0 308 | M101 309 | G1 X15.0 Y-15.0 Z12.120003 F1556.0 310 | G1 X15.0 Y15.0 Z12.120003 F1556.0 311 | G1 X-15.0 Y15.0 Z12.120003 F1556.0 312 | G1 X-15.0 Y-15.0 Z12.120003 F1556.0 313 | M103 314 | G1 X-15.0 Y-15.0 Z12.470003 F1556.0 315 | M101 316 | G1 X15.0 Y-15.0 Z12.470003 F1556.0 317 | G1 X15.0 Y15.0 Z12.470003 F1556.0 318 | G1 X-15.0 Y15.0 Z12.470003 F1556.0 319 | G1 X-15.0 Y-15.0 Z12.470003 F1556.0 320 | M103 321 | G1 X-15.0 Y-15.0 Z12.8200035 F1556.0 322 | M101 323 | G1 X15.0 Y-15.0 Z12.8200035 F1556.0 324 | G1 X15.0 Y15.0 Z12.8200035 F1556.0 325 | G1 X-15.0 Y15.0 Z12.8200035 F1556.0 326 | G1 X-15.0 Y-15.0 Z12.8200035 F1556.0 327 | M103 328 | G1 X-15.0 Y-15.0 Z13.170004 F1556.0 329 | M101 330 | G1 X15.0 Y-15.0 Z13.170004 F1556.0 331 | G1 X15.0 Y15.0 Z13.170004 F1556.0 332 | G1 X-15.0 Y15.0 Z13.170004 F1556.0 333 | G1 X-15.0 Y-15.0 Z13.170004 F1556.0 334 | M103 335 | G1 X-15.0 Y-15.0 Z13.520004 F1556.0 336 | M101 337 | G1 X15.0 Y-15.0 Z13.520004 F1556.0 338 | G1 X15.0 Y15.0 Z13.520004 F1556.0 339 | G1 X-15.0 Y15.0 Z13.520004 F1556.0 340 | G1 X-15.0 Y-15.0 Z13.520004 F1556.0 341 | M103 342 | G1 X-15.0 Y-15.0 Z13.870005 F1556.0 343 | M101 344 | G1 X15.0 Y-15.0 Z13.870005 F1556.0 345 | G1 X15.0 Y15.0 Z13.870005 F1556.0 346 | G1 X-15.0 Y15.0 Z13.870005 F1556.0 347 | G1 X-15.0 Y-15.0 Z13.870005 F1556.0 348 | M103 349 | G1 X-15.0 Y-15.0 Z14.220005 F1556.0 350 | M101 351 | G1 X15.0 Y-15.0 Z14.220005 F1556.0 352 | G1 X15.0 Y15.0 Z14.220005 F1556.0 353 | G1 X-15.0 Y15.0 Z14.220005 F1556.0 354 | G1 X-15.0 Y-15.0 Z14.220005 F1556.0 355 | M103 356 | G1 X-15.0 Y-15.0 Z14.570005 F1556.0 357 | M101 358 | G1 X15.0 Y-15.0 Z14.570005 F1556.0 359 | G1 X15.0 Y15.0 Z14.570005 F1556.0 360 | G1 X-15.0 Y15.0 Z14.570005 F1556.0 361 | G1 X-15.0 Y-15.0 Z14.570005 F1556.0 362 | M103 363 | G1 X-15.0 Y-15.0 Z14.920006 F1556.0 364 | M101 365 | G1 X15.0 Y-15.0 Z14.920006 F1556.0 366 | G1 X15.0 Y15.0 Z14.920006 F1556.0 367 | G1 X-15.0 Y15.0 Z14.920006 F1556.0 368 | G1 X-15.0 Y-15.0 Z14.920006 F1556.0 369 | M103 370 | G1 X-15.0 Y-15.0 Z15.270006 F1556.0 371 | M101 372 | G1 X15.0 Y-15.0 Z15.270006 F1556.0 373 | G1 X15.0 Y15.0 Z15.270006 F1556.0 374 | G1 X-15.0 Y15.0 Z15.270006 F1556.0 375 | G1 X-15.0 Y-15.0 Z15.270006 F1556.0 376 | M103 377 | G1 X-15.0 Y-15.0 Z15.620007 F1556.0 378 | M101 379 | G1 X15.0 Y-15.0 Z15.620007 F1556.0 380 | G1 X15.0 Y15.0 Z15.620007 F1556.0 381 | G1 X-15.0 Y15.0 Z15.620007 F1556.0 382 | G1 X-15.0 Y-15.0 Z15.620007 F1556.0 383 | M103 384 | G1 X-15.0 Y-15.0 Z15.970007 F1556.0 385 | M101 386 | G1 X15.0 Y-15.0 Z15.970007 F1556.0 387 | G1 X15.0 Y15.0 Z15.970007 F1556.0 388 | G1 X-15.0 Y15.0 Z15.970007 F1556.0 389 | G1 X-15.0 Y-15.0 Z15.970007 F1556.0 390 | M103 391 | G1 X-15.0 Y-15.0 Z16.320007 F1556.0 392 | M101 393 | G1 X15.0 Y-15.0 Z16.320007 F1556.0 394 | G1 X15.0 Y15.0 Z16.320007 F1556.0 395 | G1 X-15.0 Y15.0 Z16.320007 F1556.0 396 | G1 X-15.0 Y-15.0 Z16.320007 F1556.0 397 | M103 398 | G1 X-15.0 Y-15.0 Z16.670008 F1556.0 399 | M101 400 | G1 X15.0 Y-15.0 Z16.670008 F1556.0 401 | G1 X15.0 Y15.0 Z16.670008 F1556.0 402 | G1 X-15.0 Y15.0 Z16.670008 F1556.0 403 | G1 X-15.0 Y-15.0 Z16.670008 F1556.0 404 | M103 405 | G1 X-15.0 Y-15.0 Z17.020008 F1556.0 406 | M101 407 | G1 X15.0 Y-15.0 Z17.020008 F1556.0 408 | G1 X15.0 Y15.0 Z17.020008 F1556.0 409 | G1 X-15.0 Y15.0 Z17.020008 F1556.0 410 | G1 X-15.0 Y-15.0 Z17.020008 F1556.0 411 | M103 412 | G1 X-15.0 Y-15.0 Z17.370008 F1556.0 413 | M101 414 | G1 X15.0 Y-15.0 Z17.370008 F1556.0 415 | G1 X15.0 Y15.0 Z17.370008 F1556.0 416 | G1 X-15.0 Y15.0 Z17.370008 F1556.0 417 | G1 X-15.0 Y-15.0 Z17.370008 F1556.0 418 | M103 419 | G1 X-15.0 Y-15.0 Z17.720009 F1556.0 420 | M101 421 | G1 X15.0 Y-15.0 Z17.720009 F1556.0 422 | G1 X15.0 Y15.0 Z17.720009 F1556.0 423 | G1 X-15.0 Y15.0 Z17.720009 F1556.0 424 | G1 X-15.0 Y-15.0 Z17.720009 F1556.0 425 | M103 426 | G1 X-15.0 Y-15.0 Z18.07001 F1556.0 427 | M101 428 | G1 X15.0 Y-15.0 Z18.07001 F1556.0 429 | G1 X15.0 Y15.0 Z18.07001 F1556.0 430 | G1 X-15.0 Y15.0 Z18.07001 F1556.0 431 | G1 X-15.0 Y-15.0 Z18.07001 F1556.0 432 | M103 433 | G1 X-15.0 Y-15.0 Z18.42001 F1556.0 434 | M101 435 | G1 X15.0 Y-15.0 Z18.42001 F1556.0 436 | G1 X15.0 Y15.0 Z18.42001 F1556.0 437 | G1 X-15.0 Y15.0 Z18.42001 F1556.0 438 | G1 X-15.0 Y-15.0 Z18.42001 F1556.0 439 | M103 440 | G1 X-15.0 Y-15.0 Z18.77001 F1556.0 441 | M101 442 | G1 X15.0 Y-15.0 Z18.77001 F1556.0 443 | G1 X15.0 Y15.0 Z18.77001 F1556.0 444 | G1 X-15.0 Y15.0 Z18.77001 F1556.0 445 | G1 X-15.0 Y-15.0 Z18.77001 F1556.0 446 | M103 447 | G1 X-15.0 Y-15.0 Z19.12001 F1556.0 448 | M101 449 | G1 X15.0 Y-15.0 Z19.12001 F1556.0 450 | G1 X15.0 Y15.0 Z19.12001 F1556.0 451 | G1 X-15.0 Y15.0 Z19.12001 F1556.0 452 | G1 X-15.0 Y-15.0 Z19.12001 F1556.0 453 | M103 454 | G1 X-15.0 Y-15.0 Z19.47001 F1556.0 455 | M101 456 | G1 X15.0 Y-15.0 Z19.47001 F1556.0 457 | G1 X15.0 Y15.0 Z19.47001 F1556.0 458 | G1 X-15.0 Y15.0 Z19.47001 F1556.0 459 | G1 X-15.0 Y-15.0 Z19.47001 F1556.0 460 | M103 461 | G1 X-15.0 Y-15.0 Z19.820011 F1556.0 462 | M101 463 | G1 X15.0 Y-15.0 Z19.820011 F1556.0 464 | G1 X15.0 Y15.0 Z19.820011 F1556.0 465 | G1 X-15.0 Y15.0 Z19.820011 F1556.0 466 | G1 X-15.0 Y-15.0 Z19.820011 F1556.0 467 | M103 468 | G1 X-15.0 Y-15.0 Z20.170012 F1556.0 469 | M101 470 | G1 X15.0 Y-15.0 Z20.170012 F1556.0 471 | G1 X15.0 Y15.0 Z20.170012 F1556.0 472 | G1 X-15.0 Y15.0 Z20.170012 F1556.0 473 | G1 X-15.0 Y-15.0 Z20.170012 F1556.0 474 | M103 475 | G1 X-15.0 Y-15.0 Z20.520012 F1556.0 476 | M101 477 | G1 X15.0 Y-15.0 Z20.520012 F1556.0 478 | G1 X15.0 Y15.0 Z20.520012 F1556.0 479 | G1 X-15.0 Y15.0 Z20.520012 F1556.0 480 | G1 X-15.0 Y-15.0 Z20.520012 F1556.0 481 | M103 482 | G1 X-15.0 Y-15.0 Z20.870012 F1556.0 483 | M101 484 | G1 X15.0 Y-15.0 Z20.870012 F1556.0 485 | G1 X15.0 Y15.0 Z20.870012 F1556.0 486 | G1 X-15.0 Y15.0 Z20.870012 F1556.0 487 | G1 X-15.0 Y-15.0 Z20.870012 F1556.0 488 | M103 489 | G1 X-15.0 Y-15.0 Z21.220013 F1556.0 490 | M101 491 | G1 X15.0 Y-15.0 Z21.220013 F1556.0 492 | G1 X15.0 Y15.0 Z21.220013 F1556.0 493 | G1 X-15.0 Y15.0 Z21.220013 F1556.0 494 | G1 X-15.0 Y-15.0 Z21.220013 F1556.0 495 | M103 496 | G1 X-15.0 Y-15.0 Z21.570013 F1556.0 497 | M101 498 | G1 X15.0 Y-15.0 Z21.570013 F1556.0 499 | G1 X15.0 Y15.0 Z21.570013 F1556.0 500 | G1 X-15.0 Y15.0 Z21.570013 F1556.0 501 | G1 X-15.0 Y-15.0 Z21.570013 F1556.0 502 | M103 503 | G1 X-15.0 Y-15.0 Z21.920013 F1556.0 504 | M101 505 | G1 X15.0 Y-15.0 Z21.920013 F1556.0 506 | G1 X15.0 Y15.0 Z21.920013 F1556.0 507 | G1 X-15.0 Y15.0 Z21.920013 F1556.0 508 | G1 X-15.0 Y-15.0 Z21.920013 F1556.0 509 | M103 510 | G1 X-15.0 Y-15.0 Z22.270014 F1556.0 511 | M101 512 | G1 X15.0 Y-15.0 Z22.270014 F1556.0 513 | G1 X15.0 Y15.0 Z22.270014 F1556.0 514 | G1 X-15.0 Y15.0 Z22.270014 F1556.0 515 | G1 X-15.0 Y-15.0 Z22.270014 F1556.0 516 | M103 517 | G1 X-15.0 Y-15.0 Z22.620014 F1556.0 518 | M101 519 | G1 X15.0 Y-15.0 Z22.620014 F1556.0 520 | G1 X15.0 Y15.0 Z22.620014 F1556.0 521 | G1 X-15.0 Y15.0 Z22.620014 F1556.0 522 | G1 X-15.0 Y-15.0 Z22.620014 F1556.0 523 | M103 524 | G1 X-15.0 Y-15.0 Z22.970015 F1556.0 525 | M101 526 | G1 X15.0 Y-15.0 Z22.970015 F1556.0 527 | G1 X15.0 Y15.0 Z22.970015 F1556.0 528 | G1 X-15.0 Y15.0 Z22.970015 F1556.0 529 | G1 X-15.0 Y-15.0 Z22.970015 F1556.0 530 | M103 531 | G1 X-15.0 Y-15.0 Z23.320015 F1556.0 532 | M101 533 | G1 X15.0 Y-15.0 Z23.320015 F1556.0 534 | G1 X15.0 Y15.0 Z23.320015 F1556.0 535 | G1 X-15.0 Y15.0 Z23.320015 F1556.0 536 | G1 X-15.0 Y-15.0 Z23.320015 F1556.0 537 | M103 538 | G1 X-15.0 Y-15.0 Z23.670015 F1556.0 539 | M101 540 | G1 X15.0 Y-15.0 Z23.670015 F1556.0 541 | G1 X15.0 Y15.0 Z23.670015 F1556.0 542 | G1 X-15.0 Y15.0 Z23.670015 F1556.0 543 | G1 X-15.0 Y-15.0 Z23.670015 F1556.0 544 | M103 545 | G1 X-15.0 Y-15.0 Z24.020016 F1556.0 546 | M101 547 | G1 X15.0 Y-15.0 Z24.020016 F1556.0 548 | G1 X15.0 Y15.0 Z24.020016 F1556.0 549 | G1 X-15.0 Y15.0 Z24.020016 F1556.0 550 | G1 X-15.0 Y-15.0 Z24.020016 F1556.0 551 | M103 552 | G1 X-15.0 Y-15.0 Z24.370016 F1556.0 553 | M101 554 | G1 X15.0 Y-15.0 Z24.370016 F1556.0 555 | G1 X15.0 Y15.0 Z24.370016 F1556.0 556 | G1 X-15.0 Y15.0 Z24.370016 F1556.0 557 | G1 X-15.0 Y-15.0 Z24.370016 F1556.0 558 | M103 559 | G1 X-15.0 Y-15.0 Z24.720016 F1556.0 560 | M101 561 | G1 X15.0 Y-15.0 Z24.720016 F1556.0 562 | G1 X15.0 Y15.0 Z24.720016 F1556.0 563 | G1 X-15.0 Y15.0 Z24.720016 F1556.0 564 | G1 X-15.0 Y-15.0 Z24.720016 F1556.0 565 | M103 566 | G1 X-15.0 Y-15.0 Z25.070017 F1556.0 567 | M101 568 | G1 X15.0 Y-15.0 Z25.070017 F1556.0 569 | G1 X15.0 Y15.0 Z25.070017 F1556.0 570 | G1 X-15.0 Y15.0 Z25.070017 F1556.0 571 | G1 X-15.0 Y-15.0 Z25.070017 F1556.0 572 | M103 573 | G1 X-15.0 Y-15.0 Z25.420017 F1556.0 574 | M101 575 | G1 X15.0 Y-15.0 Z25.420017 F1556.0 576 | G1 X15.0 Y15.0 Z25.420017 F1556.0 577 | G1 X-15.0 Y15.0 Z25.420017 F1556.0 578 | G1 X-15.0 Y-15.0 Z25.420017 F1556.0 579 | M103 580 | G1 X-15.0 Y-15.0 Z25.770018 F1556.0 581 | M101 582 | G1 X15.0 Y-15.0 Z25.770018 F1556.0 583 | G1 X15.0 Y15.0 Z25.770018 F1556.0 584 | G1 X-15.0 Y15.0 Z25.770018 F1556.0 585 | G1 X-15.0 Y-15.0 Z25.770018 F1556.0 586 | M103 587 | G1 X-15.0 Y-15.0 Z26.120018 F1556.0 588 | M101 589 | G1 X15.0 Y-15.0 Z26.120018 F1556.0 590 | G1 X15.0 Y15.0 Z26.120018 F1556.0 591 | G1 X-15.0 Y15.0 Z26.120018 F1556.0 592 | G1 X-15.0 Y-15.0 Z26.120018 F1556.0 593 | M103 594 | G1 X-15.0 Y-15.0 Z26.470018 F1556.0 595 | M101 596 | G1 X15.0 Y-15.0 Z26.470018 F1556.0 597 | G1 X15.0 Y15.0 Z26.470018 F1556.0 598 | G1 X-15.0 Y15.0 Z26.470018 F1556.0 599 | G1 X-15.0 Y-15.0 Z26.470018 F1556.0 600 | M103 601 | G1 X-15.0 Y-15.0 Z26.820019 F1556.0 602 | M101 603 | G1 X15.0 Y-15.0 Z26.820019 F1556.0 604 | G1 X15.0 Y15.0 Z26.820019 F1556.0 605 | G1 X-15.0 Y15.0 Z26.820019 F1556.0 606 | G1 X-15.0 Y-15.0 Z26.820019 F1556.0 607 | M103 608 | G1 X-15.0 Y-15.0 Z27.17002 F1556.0 609 | M101 610 | G1 X15.0 Y-15.0 Z27.17002 F1556.0 611 | G1 X15.0 Y15.0 Z27.17002 F1556.0 612 | G1 X-15.0 Y15.0 Z27.17002 F1556.0 613 | G1 X-15.0 Y-15.0 Z27.17002 F1556.0 614 | M103 615 | G1 X-15.0 Y-15.0 Z27.52002 F1556.0 616 | M101 617 | G1 X15.0 Y-15.0 Z27.52002 F1556.0 618 | G1 X15.0 Y15.0 Z27.52002 F1556.0 619 | G1 X-15.0 Y15.0 Z27.52002 F1556.0 620 | G1 X-15.0 Y-15.0 Z27.52002 F1556.0 621 | M103 622 | G1 X-15.0 Y-15.0 Z27.87002 F1556.0 623 | M101 624 | G1 X15.0 Y-15.0 Z27.87002 F1556.0 625 | G1 X15.0 Y15.0 Z27.87002 F1556.0 626 | G1 X-15.0 Y15.0 Z27.87002 F1556.0 627 | G1 X-15.0 Y-15.0 Z27.87002 F1556.0 628 | M103 629 | G1 X-15.0 Y-15.0 Z28.22002 F1556.0 630 | M101 631 | G1 X15.0 Y-15.0 Z28.22002 F1556.0 632 | G1 X15.0 Y15.0 Z28.22002 F1556.0 633 | G1 X-15.0 Y15.0 Z28.22002 F1556.0 634 | G1 X-15.0 Y-15.0 Z28.22002 F1556.0 635 | M103 636 | G1 X-15.0 Y-15.0 Z28.57002 F1556.0 637 | M101 638 | G1 X15.0 Y-15.0 Z28.57002 F1556.0 639 | G1 X15.0 Y15.0 Z28.57002 F1556.0 640 | G1 X-15.0 Y15.0 Z28.57002 F1556.0 641 | G1 X-15.0 Y-15.0 Z28.57002 F1556.0 642 | M103 643 | G1 X-15.0 Y-15.0 Z28.920021 F1556.0 644 | M101 645 | G1 X15.0 Y-15.0 Z28.920021 F1556.0 646 | G1 X15.0 Y15.0 Z28.920021 F1556.0 647 | G1 X-15.0 Y15.0 Z28.920021 F1556.0 648 | G1 X-15.0 Y-15.0 Z28.920021 F1556.0 649 | M103 650 | G1 X-15.0 Y-15.0 Z29.270021 F1556.0 651 | M101 652 | G1 X15.0 Y-15.0 Z29.270021 F1556.0 653 | G1 X15.0 Y15.0 Z29.270021 F1556.0 654 | G1 X-15.0 Y15.0 Z29.270021 F1556.0 655 | G1 X-15.0 Y-15.0 Z29.270021 F1556.0 656 | M103 657 | G1 X-15.0 Y-15.0 Z29.620022 F1556.0 658 | M101 659 | G1 X15.0 Y-15.0 Z29.620022 F1556.0 660 | G1 X15.0 Y15.0 Z29.620022 F1556.0 661 | G1 X-15.0 Y15.0 Z29.620022 F1556.0 662 | G1 X-15.0 Y-15.0 Z29.620022 F1556.0 663 | M103 664 | G1 X-15.0 Y-15.0 Z29.970022 F1556.0 665 | M101 666 | G1 X15.0 Y-15.0 Z29.970022 F1556.0 667 | G1 X15.0 Y15.0 Z29.970022 F1556.0 668 | G1 X-15.0 Y15.0 Z29.970022 F1556.0 669 | G1 X-15.0 Y-15.0 Z29.970022 F1556.0 670 | M103 671 | -------------------------------------------------------------------------------- /examples/simpleCube/simpleCube.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * codeThread - simple cube example 3 | * by: Diatom Studio (diatom.cc) 4 | * 5 | * A simple example of using codeThread to generate tool paths or printing a simple cube and raft on makerbot 6 | * 7 | * 8 | */ 9 | 10 | import codeThreadLib.library.*; 11 | 12 | CodeThread codeThread = new CodeThread(this); 13 | 14 | void setup() { 15 | size(300,300,P3D); 16 | 17 | codeThread.setDefaults(); // set your craft robo to default settings. note- these may not be the same for every machine, see javadoc 18 | 19 | //generate a cube 20 | float sideLen = 30; // lenght of the cubes side 21 | float headSpeed = 1556.0f; // speed that the extruder head will travel at whilst printing 22 | float zPos = 0; // keep track of the z pos of the extruder head 23 | float zStep = 0.35f; // the amount to move up each step on the z axis 24 | 25 | //generate a raft 26 | codeThread.generateRaft(sideLen +5, sideLen + 5, 560,1500, 2.5f,1.5f); // generate a raft generateRaft(raftWidth,raftLength, headSpeedBottomLayer,headSpeedTopLayer, distanceBetweenSlatsBottomLayer,DistanceBetweenSlatsTopLayer) 27 | zPos = 1.27;// after drawing the raft our new zheight is 1.27(mm) 28 | 29 | for(zPos = 1.27; zPos < sideLen ; zPos+=zStep) { 30 | 31 | //move the extruder head to each corner of the box 32 | codeThread.moveTo(-(sideLen/2),-(sideLen/2),zPos,headSpeed); 33 | 34 | codeThread.extruderOnFwd(); // start extruding, now we're at the start point 35 | 36 | codeThread.moveTo((sideLen/2),-(sideLen/2),zPos,headSpeed); //whilst extruding move extruder to 2nd corner 37 | codeThread.moveTo((sideLen/2),(sideLen/2),zPos,headSpeed); 38 | codeThread.moveTo(-(sideLen/2),(sideLen/2),zPos,headSpeed); 39 | codeThread.moveTo(-(sideLen/2),-(sideLen/2),zPos,headSpeed); //back to the start, 40 | 41 | //now we have a square, step up in the z direction and start all over again 42 | codeThread.extruderOff(); // stop extruding 43 | } 44 | 45 | codeThread.printToConsole(); // print to console 46 | codeThread.writeToFile(sketchPath +"/code01.txt"); 47 | 48 | } 49 | 50 | 51 | 52 | 53 | void draw() { 54 | 55 | //make things pretty, rotate and zoom to see cube 56 | smooth(); 57 | background(255); 58 | pushMatrix(); 59 | translate(width/2,height/2);//center at 0,0 60 | rotateX(PI/4); 61 | rotateZ(PI/4); 62 | scale(3.5f); 63 | 64 | //draw the platform 65 | noStroke(); 66 | fill(220,220,220); 67 | rect(-(80/2),-(80/2),(80),(80)); // draw the makerbot platform for reference 68 | stroke(255,0,0); 69 | 70 | 71 | codeThread.render(); //render the tool paths 72 | 73 | 74 | popMatrix(); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /library/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiatomStudio/CodeThread/3403985d7e9a71e1758abcfaa0486cf76fa7ccfa/library/.DS_Store -------------------------------------------------------------------------------- /reference/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiatomStudio/CodeThread/3403985d7e9a71e1758abcfaa0486cf76fa7ccfa/reference/.DS_Store -------------------------------------------------------------------------------- /reference/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 27 | 28 |
CodeThread 25 |
26 |
29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /reference/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 27 | 28 |
CodeThread 25 |
26 |
29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /reference/codeThreadLib/library/CodeThread.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | CodeThread (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 | 76 | 78 | 80 | 81 |
50 | 51 |
82 | 83 | 84 | 85 |
86 | 87 |

88 | 89 | codeThreadLib.library 90 |
91 | Class CodeThread

92 |
 93 | java.lang.Object
 94 |   extended by codeThreadLib.library.CodeThread
 95 | 
96 |
97 |
98 |
public class CodeThread
extends java.lang.Object
99 | 100 | 101 |

102 |


103 | 104 |

105 | 106 | 107 | 108 | 109 | 110 | 112 | 113 | 114 | 116 | 120 | 121 |
111 | Field Summary
115 | static java.lang.StringVERSION 117 | 118 |
119 |            
122 |   123 | 124 | 125 | 126 | 127 | 128 | 130 | 131 | 132 | 136 | 137 |
129 | Constructor Summary
CodeThread(processing.core.PApplet theParent) 133 | 134 |
135 |           a library for generating tool paths for makerbot and other cnc tools
138 |   139 | 140 | 141 | 142 | 143 | 144 | 146 | 147 | 148 | 150 | 154 | 155 | 156 | 158 | 162 | 163 | 164 | 166 | 170 | 171 | 172 | 174 | 178 | 179 | 180 | 182 | 186 | 187 | 188 | 190 | 199 | 200 | 201 | 203 | 210 | 211 | 212 | 214 | 218 | 219 | 220 | 222 | 226 | 227 | 228 | 230 | 234 | 235 | 236 | 238 | 242 | 243 | 244 | 246 | 251 | 252 | 253 | 255 | 261 | 262 | 263 | 265 | 276 | 277 | 278 | 280 | 285 | 286 | 287 | 289 | 294 | 295 | 296 | 298 | 302 | 303 | 304 | 306 | 310 | 311 | 312 | 314 | 318 | 319 | 320 | 322 | 326 | 327 | 328 | 330 | 334 | 335 | 336 | 338 | 342 | 343 |
145 | Method Summary
149 |  voidclear() 151 | 152 |
153 |           clear the list of commands
157 |  voidextruderOff() 159 | 160 |
161 |           turn extruder off
165 |  voidextruderOnFwd() 167 | 168 |
169 |           turn extruder on fwd
173 |  voidextruderOnRev() 175 | 176 |
177 |           turn extruder on rev
181 |  voidfinishPrint() 183 | 184 |
185 |           finish the print and cooldown the machine
189 |  voidgenerateRaft(float raftWidth, 191 | float raftHeight, 192 | int baseFeed, 193 | int interfaceFeed, 194 | float baseStep, 195 | float interfaceStep) 196 | 197 |
198 |           generate a raft for your print
202 |  voidmoveTo(float x, 204 | float y, 205 | float z, 206 | float speed) 207 | 208 |
209 |           move head to absolute position
213 |  voidpause(int millis) 215 | 216 |
217 |           pause extruding head
221 |  voidprintToConsole() 223 | 224 |
225 |           print all commands to the console
229 |  voidrender() 231 | 232 |
233 |           render thread commands gcode to the screen
237 |  voidsetAbsolutePositioning() 239 | 240 |
241 |           set machine to absolute positioning
245 |  voidsetBuildPlatformTemp(int toolNum, 247 | int temp) 248 | 249 |
250 |           set build platform temp
254 |  voidsetCurrentHome(int x, 256 | int y, 257 | int z) 258 | 259 |
260 |           set current postion as home
264 |  voidsetDefaults() 266 | 267 |
268 |           set the machine to it's default settings 269 | tool temp 220 degrees 270 | build platform temp 110 degrees 271 | units (mm) 272 | set machine to absolute positioning 273 | set current position to home, 0,0,0 274 | set tool speed to 255 275 | wait for the tool to heat
279 |  voidsetExtrusionSpeed(int toolNum, 281 | int speed) 282 | 283 |
284 |           set extrusion speed
288 |  voidsetToolTemp(int toolNum, 290 | int temp) 291 | 292 |
293 |           set tool temp
297 |  voidsetUnitInch() 299 | 300 |
301 |           set units to inches
305 |  voidsetUnitmm() 307 | 308 |
309 |           set units to millimeters
313 |  voidturnOffSteppers() 315 | 316 |
317 |           turn off machines stepper motors
321 | static java.lang.Stringversion() 323 | 324 |
325 |           returns the version of the library.
329 |  voidwaitForToolToHeat(int toolNum) 331 | 332 |
333 |           wait for tool to heat
337 |  voidwriteToFile(java.lang.String path) 339 | 340 |
341 |           write g-code file for printing on your machine
344 |   345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 |
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
353 |   354 |

355 | 356 | 357 | 358 | 359 | 360 | 361 | 363 | 364 |
362 | Field Detail
365 | 366 |

367 | VERSION

368 |
369 | public static final java.lang.String VERSION
370 |
371 |
372 |
See Also:
Constant Field Values
373 |
374 | 375 | 376 | 377 | 378 | 379 | 380 | 382 | 383 |
381 | Constructor Detail
384 | 385 |

386 | CodeThread

387 |
388 | public CodeThread(processing.core.PApplet theParent)
389 |
390 |
a library for generating tool paths for makerbot and other cnc tools 391 |

392 |

393 | 394 | 395 | 396 | 397 | 398 | 399 | 401 | 402 |
400 | Method Detail
403 | 404 |

405 | version

406 |
407 | public static java.lang.String version()
408 |
409 |
returns the version of the library. 410 |

411 |

412 | 413 |
Returns:
String
414 |
415 |
416 |
417 | 418 |

419 | setUnitmm

420 |
421 | public void setUnitmm()
422 |
423 |
set units to millimeters 424 |

425 |

426 |
427 |
428 |
429 |
430 | 431 |

432 | setUnitInch

433 |
434 | public void setUnitInch()
435 |
436 |
set units to inches 437 |

438 |

439 |
440 |
441 |
442 |
443 | 444 |

445 | moveTo

446 |
447 | public void moveTo(float x,
448 |                    float y,
449 |                    float z,
450 |                    float speed)
451 |
452 |
move head to absolute position 453 |

454 |

455 |
456 |
457 |
458 |
459 | 460 |

461 | extruderOnFwd

462 |
463 | public void extruderOnFwd()
464 |
465 |
turn extruder on fwd 466 |

467 |

468 |
469 |
470 |
471 |
472 | 473 |

474 | extruderOnRev

475 |
476 | public void extruderOnRev()
477 |
478 |
turn extruder on rev 479 |

480 |

481 |
482 |
483 |
484 |
485 | 486 |

487 | extruderOff

488 |
489 | public void extruderOff()
490 |
491 |
turn extruder off 492 |

493 |

494 |
495 |
496 |
497 |
498 | 499 |

500 | setToolTemp

501 |
502 | public void setToolTemp(int toolNum,
503 |                         int temp)
504 |
505 |
set tool temp 506 |

507 |

508 |
509 |
510 |
511 |
512 | 513 |

514 | setBuildPlatformTemp

515 |
516 | public void setBuildPlatformTemp(int toolNum,
517 |                                  int temp)
518 |
519 |
set build platform temp 520 |

521 |

522 |
523 |
524 |
525 |
526 | 527 |

528 | setExtrusionSpeed

529 |
530 | public void setExtrusionSpeed(int toolNum,
531 |                               int speed)
532 |
533 |
set extrusion speed 534 |

535 |

536 |
537 |
538 |
539 |
540 | 541 |

542 | setAbsolutePositioning

543 |
544 | public void setAbsolutePositioning()
545 |
546 |
set machine to absolute positioning 547 |

548 |

549 |
550 |
551 |
552 |
553 | 554 |

555 | setCurrentHome

556 |
557 | public void setCurrentHome(int x,
558 |                            int y,
559 |                            int z)
560 |
561 |
set current postion as home 562 |

563 |

564 |
565 |
566 |
567 |
568 | 569 |

570 | waitForToolToHeat

571 |
572 | public void waitForToolToHeat(int toolNum)
573 |
574 |
wait for tool to heat 575 |

576 |

577 |
Parameters:
toolNum -
578 |
579 |
580 |
581 | 582 |

583 | pause

584 |
585 | public void pause(int millis)
586 |
587 |
pause extruding head 588 |

589 |

590 |
Parameters:
secs -
591 |
592 |
593 |
594 | 595 |

596 | turnOffSteppers

597 |
598 | public void turnOffSteppers()
599 |
600 |
turn off machines stepper motors 601 |

602 |

603 |
604 |
605 |
606 |
607 | 608 |

609 | finishPrint

610 |
611 | public void finishPrint()
612 |
613 |
finish the print and cooldown the machine 614 |

615 |

616 |
617 |
618 |
619 |
620 | 621 |

622 | clear

623 |
624 | public void clear()
625 |
626 |
clear the list of commands 627 |

628 |

629 |
630 |
631 |
632 |
633 | 634 |

635 | generateRaft

636 |
637 | public void generateRaft(float raftWidth,
638 |                          float raftHeight,
639 |                          int baseFeed,
640 |                          int interfaceFeed,
641 |                          float baseStep,
642 |                          float interfaceStep)
643 |
644 |
generate a raft for your print 645 |

646 |

647 |
648 |
649 |
650 |
651 | 652 |

653 | setDefaults

654 |
655 | public void setDefaults()
656 |
657 |
set the machine to it's default settings 658 | tool temp 220 degrees 659 | build platform temp 110 degrees 660 | units (mm) 661 | set machine to absolute positioning 662 | set current position to home, 0,0,0 663 | set tool speed to 255 664 | wait for the tool to heat 665 |

666 |

667 |
668 |
669 |
670 |
671 | 672 |

673 | printToConsole

674 |
675 | public void printToConsole()
676 |
677 |
print all commands to the console 678 |

679 |

680 |
681 |
682 |
683 |
684 | 685 |

686 | render

687 |
688 | public void render()
689 |
690 |
render thread commands gcode to the screen 691 |

692 |

693 |
694 |
695 |
696 |
697 | 698 |

699 | writeToFile

700 |
701 | public void writeToFile(java.lang.String path)
702 |
703 |
write g-code file for printing on your machine 704 |

705 |

706 |
Parameters:
path -
707 |
708 |
709 | 710 |
711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 731 | 734 | 735 | 736 | 737 | 740 | 756 | 757 | 758 | 760 | 762 | 763 |
732 | 733 |
764 | 765 | 766 | 767 |
768 | processing library codethread by Diatom Studio. (c) 2011 769 | 770 | 771 | -------------------------------------------------------------------------------- /reference/codeThreadLib/library/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeThreadLib.library (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | codeThreadLib.library 20 | 21 | 22 | 27 | 28 |
23 | Classes  24 | 25 |
26 | CodeThread
29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /reference/codeThreadLib/library/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeThreadLib.library (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |

81 | Package codeThreadLib.library 82 |

83 | 84 | 85 | 86 | 88 | 89 | 90 | 91 | 92 | 93 |
87 | Class Summary
CodeThread 
94 |   95 | 96 |

97 |

98 |
99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 120 | 123 | 124 | 125 | 126 | 129 | 145 | 146 |
121 | 122 |
147 | 148 | 149 | 150 |
151 | processing library codethread by Diatom Studio. (c) 2011 152 | 153 | 154 | -------------------------------------------------------------------------------- /reference/codeThreadLib/library/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | codeThreadLib.library Class Hierarchy (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | Hierarchy For Package codeThreadLib.library 83 |

84 |
85 |

86 | Class Hierarchy 87 |

88 | 92 |
93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 113 | 116 | 117 | 118 | 119 | 122 | 138 | 139 |
114 | 115 |
140 | 141 | 142 | 143 |
144 | processing library codethread by Diatom Studio. (c) 2011 145 | 146 | 147 | -------------------------------------------------------------------------------- /reference/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Constant Field Values (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | Constant Field Values

83 |
84 |
85 | Contents 88 | 89 | 90 | 91 | 92 | 94 | 95 |
93 | codeThreadLib.library.*
96 | 97 |

98 | 99 | 100 | 101 | 102 | 103 | 104 | 106 | 107 | 108 | 109 | 110 | 111 |
codeThreadLib.library.CodeThread
105 | public static final java.lang.StringVERSION"0.1.2"
112 | 113 |

114 | 115 |

116 |


117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 137 | 140 | 141 | 142 | 143 | 146 | 162 | 163 |
138 | 139 |
164 | 165 | 166 | 167 |
168 | processing library codethread by Diatom Studio. (c) 2011 169 | 170 | 171 | -------------------------------------------------------------------------------- /reference/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deprecated List (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | Deprecated API

83 |
84 |
85 | Contents 87 | 88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 109 | 112 | 113 | 114 | 115 | 118 | 134 | 135 |
110 | 111 |
136 | 137 | 138 | 139 |
140 | processing library codethread by Diatom Studio. (c) 2011 141 | 142 | 143 | -------------------------------------------------------------------------------- /reference/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | API Help (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | How This API Document Is Organized

83 |
84 | This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

85 | Package

86 |
87 | 88 |

89 | Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

91 |
92 |

93 | Class/Interface

94 |
95 | 96 |

97 | Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

103 | Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
104 | 105 |

106 | Annotation Type

107 |
108 | 109 |

110 | Each annotation type has its own separate page with the following sections:

112 |
113 | 114 |

115 | Enum

116 |
117 | 118 |

119 | Each enum has its own separate page with the following sections:

121 |
122 |

123 | Tree (Class Hierarchy)

124 |
125 | There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object. 127 |
128 |

129 | Deprecated API

130 |
131 | The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
132 |

133 | Index

134 |
135 | The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
136 |

137 | Prev/Next

138 | These links take you to the next or previous class, interface, package, or related page.

139 | Frames/No Frames

140 | These links show and hide the HTML frames. All pages are available with or without frames. 141 |

142 |

143 | Serialized Form

144 | Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. 145 |

146 |

147 | Constant Field Values

148 | The Constant Field Values page lists the static final fields and their values. 149 |

150 | 151 | 152 | This help file applies to API documentation generated using the standard doclet. 153 | 154 |
155 |


156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 176 | 179 | 180 | 181 | 182 | 185 | 201 | 202 |
177 | 178 |
203 | 204 | 205 | 206 |
207 | processing library codethread by Diatom Studio. (c) 2011 208 | 209 | 210 | -------------------------------------------------------------------------------- /reference/index-all.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Index (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 | C E F G M P R S T V W
80 |

81 | C

82 |
83 |
clear() - 84 | Method in class codeThreadLib.library.CodeThread 85 |
clear the list of commands 86 |
CodeThread - Class in codeThreadLib.library
 
CodeThread(PApplet) - 87 | Constructor for class codeThreadLib.library.CodeThread 88 |
a library for generating tool paths for makerbot and other cnc tools 89 |
codeThreadLib.library - package codeThreadLib.library
 
90 |
91 |

92 | E

93 |
94 |
extruderOff() - 95 | Method in class codeThreadLib.library.CodeThread 96 |
turn extruder off 97 |
extruderOnFwd() - 98 | Method in class codeThreadLib.library.CodeThread 99 |
turn extruder on fwd 100 |
extruderOnRev() - 101 | Method in class codeThreadLib.library.CodeThread 102 |
turn extruder on rev 103 |
104 |
105 |

106 | F

107 |
108 |
finishPrint() - 109 | Method in class codeThreadLib.library.CodeThread 110 |
finish the print and cooldown the machine 111 |
112 |
113 |

114 | G

115 |
116 |
generateRaft(float, float, int, int, float, float) - 117 | Method in class codeThreadLib.library.CodeThread 118 |
generate a raft for your print 119 |
120 |
121 |

122 | M

123 |
124 |
moveTo(float, float, float, float) - 125 | Method in class codeThreadLib.library.CodeThread 126 |
move head to absolute position 127 |
128 |
129 |

130 | P

131 |
132 |
pause(int) - 133 | Method in class codeThreadLib.library.CodeThread 134 |
pause extruding head 135 |
printToConsole() - 136 | Method in class codeThreadLib.library.CodeThread 137 |
print all commands to the console 138 |
139 |
140 |

141 | R

142 |
143 |
render() - 144 | Method in class codeThreadLib.library.CodeThread 145 |
render thread commands gcode to the screen 146 |
147 |
148 |

149 | S

150 |
151 |
setAbsolutePositioning() - 152 | Method in class codeThreadLib.library.CodeThread 153 |
set machine to absolute positioning 154 |
setBuildPlatformTemp(int, int) - 155 | Method in class codeThreadLib.library.CodeThread 156 |
set build platform temp 157 |
setCurrentHome(int, int, int) - 158 | Method in class codeThreadLib.library.CodeThread 159 |
set current postion as home 160 |
setDefaults() - 161 | Method in class codeThreadLib.library.CodeThread 162 |
set the machine to it's default settings 163 | tool temp 220 degrees 164 | build platform temp 110 degrees 165 | units (mm) 166 | set machine to absolute positioning 167 | set current position to home, 0,0,0 168 | set tool speed to 255 169 | wait for the tool to heat 170 |
setExtrusionSpeed(int, int) - 171 | Method in class codeThreadLib.library.CodeThread 172 |
set extrusion speed 173 |
setToolTemp(int, int) - 174 | Method in class codeThreadLib.library.CodeThread 175 |
set tool temp 176 |
setUnitInch() - 177 | Method in class codeThreadLib.library.CodeThread 178 |
set units to inches 179 |
setUnitmm() - 180 | Method in class codeThreadLib.library.CodeThread 181 |
set units to millimeters 182 |
183 |
184 |

185 | T

186 |
187 |
turnOffSteppers() - 188 | Method in class codeThreadLib.library.CodeThread 189 |
turn off machines stepper motors 190 |
191 |
192 |

193 | V

194 |
195 |
VERSION - 196 | Static variable in class codeThreadLib.library.CodeThread 197 |
  198 |
version() - 199 | Static method in class codeThreadLib.library.CodeThread 200 |
returns the version of the library. 201 |
202 |
203 |

204 | W

205 |
206 |
waitForToolToHeat(int) - 207 | Method in class codeThreadLib.library.CodeThread 208 |
wait for tool to heat 209 |
writeToFile(String) - 210 | Method in class codeThreadLib.library.CodeThread 211 |
write g-code file for printing on your machine 212 |
213 |
214 | C E F G M P R S T V W 215 | 216 | 217 | 218 | 219 | 220 | 221 | 234 | 237 | 238 | 239 | 240 | 243 | 259 | 260 |
235 | 236 |
261 | 262 | 263 | 264 |
265 | processing library codethread by Diatom Studio. (c) 2011 266 | 267 | 268 | -------------------------------------------------------------------------------- /reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Javadocs: codethread 8 | 9 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | <H2> 28 | Frame Alert</H2> 29 | 30 | <P> 31 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 32 | <BR> 33 | Link to<A HREF="codeThreadLib/library/package-summary.html">Non-frame version.</A> 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /reference/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Class Hierarchy (Javadocs: codethread) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | Hierarchy For All Packages

83 |
84 |
85 |
Package Hierarchies:
codeThreadLib.library
86 |
87 |

88 | Class Hierarchy 89 |

90 | 94 |
95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 115 | 118 | 119 | 120 | 121 | 124 | 140 | 141 |
116 | 117 |
142 | 143 | 144 | 145 |
146 | processing library codethread by Diatom Studio. (c) 2011 147 | 148 | 149 | -------------------------------------------------------------------------------- /reference/package-list: -------------------------------------------------------------------------------- 1 | codeThreadLib.library 2 | -------------------------------------------------------------------------------- /reference/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiatomStudio/CodeThread/3403985d7e9a71e1758abcfaa0486cf76fa7ccfa/reference/resources/inherit.gif -------------------------------------------------------------------------------- /reference/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | /* Define colors, fonts and other style attributes here to override the defaults */ 3 | /* processingLibs style by andreas schlegel, sojamo */ 4 | 5 | 6 | body { 7 | margin : 0; 8 | padding : 0; 9 | padding-left : 10px; 10 | padding-right : 8px; 11 | background-color : #FFFFFF; 12 | font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; 13 | font-size : 100%; 14 | font-size : 0.7em; 15 | font-weight : normal; 16 | line-height : normal; 17 | margin-bottom:30px; 18 | } 19 | 20 | 21 | 22 | 23 | /* Headings */ 24 | h1, h2, h3, h4, h5, th { 25 | font-family :Arial, Helvetica, sans-serif; 26 | font-size:1.2em; 27 | } 28 | 29 | 30 | p { 31 | font-size : 1em; 32 | width:80%; 33 | } 34 | 35 | pre, code { 36 | font-family : "Courier New", Courier, monospace; 37 | font-size : 12px; 38 | line-height : normal; 39 | } 40 | 41 | 42 | 43 | table { 44 | border:0; 45 | margin-bottom:10px; 46 | margin-top:10px; 47 | } 48 | 49 | 50 | tr, td { 51 | border-top: 0px solid; 52 | border-left: 0px solid; 53 | padding-top:8px; 54 | padding-bottom:8px; 55 | } 56 | 57 | 58 | 59 | hr { 60 | border:0; 61 | height:1px; 62 | padding:0; 63 | margin:0; 64 | margin-bottom:4px; 65 | 66 | } 67 | 68 | 69 | 70 | dd, th, td, font { 71 | font-size:1.0em; 72 | line-height:1.0em; 73 | } 74 | 75 | 76 | 77 | dt { 78 | margin-bottom:0px; 79 | } 80 | 81 | 82 | 83 | dd { 84 | margin-top:2px; 85 | margin-bottom:4px; 86 | } 87 | 88 | 89 | 90 | a { 91 | text-decoration: underline; 92 | font-weight: normal; 93 | } 94 | 95 | a:hover, 96 | a:active { 97 | text-decoration: underline; 98 | font-weight: normal; 99 | } 100 | 101 | a:visited, 102 | a:link:visited { 103 | text-decoration: underline; 104 | font-weight: normal; 105 | } 106 | 107 | 108 | img { 109 | border: 0px solid #000000; 110 | } 111 | 112 | 113 | 114 | /* Navigation bar fonts */ 115 | .NavBarCell1 { 116 | border:0; 117 | } 118 | 119 | .NavBarCell1Rev { 120 | border:0; 121 | } 122 | 123 | .NavBarFont1 { 124 | font-family: Arial, Helvetica, sans-serif; 125 | font-size:1.1em; 126 | } 127 | 128 | 129 | .NavBarFont1 b { 130 | font-weight:normal; 131 | } 132 | 133 | 134 | 135 | .NavBarFont1:after, .NavBarFont1Rev:after { 136 | font-weight:normal; 137 | content: " \\"; 138 | } 139 | 140 | 141 | .NavBarFont1Rev { 142 | font-family: Arial, Helvetica, sans-serif; 143 | font-size:1.1em; 144 | } 145 | 146 | .NavBarFont1Rev b { 147 | font-family: Arial, Helvetica, sans-serif; 148 | font-size:1.1em; 149 | font-weight:normal; 150 | } 151 | 152 | .NavBarCell2 { 153 | font-family: Arial, Helvetica, sans-serif; 154 | } 155 | 156 | .NavBarCell3 { 157 | font-family: Arial, Helvetica, sans-serif; 158 | } 159 | 160 | 161 | 162 | font.FrameItemFont { 163 | font-family: Helvetica, Arial, sans-serif; 164 | font-size:1.1em; 165 | line-height:1.1em; 166 | } 167 | 168 | font.FrameHeadingFont { 169 | font-family: Helvetica, Arial, sans-serif; 170 | line-height:32px; 171 | } 172 | 173 | /* Font used in left-hand frame lists */ 174 | .FrameTitleFont { 175 | font-family: Helvetica, Arial, sans-serif 176 | } 177 | 178 | 179 | .toggleList { 180 | padding:0; 181 | margin:0; 182 | margin-top:12px; 183 | } 184 | 185 | .toggleList dt { 186 | font-weight:bold; 187 | font-size:12px; 188 | font-family:arial,sans-serif; 189 | padding:0px; 190 | margin:10px 0px 10px 0px; 191 | } 192 | 193 | .toggleList dt span { 194 | font-family: monospace; 195 | padding:0; 196 | margin:0; 197 | } 198 | 199 | 200 | .toggleList dd { 201 | margin:0; 202 | padding:0; 203 | } 204 | 205 | html.isjs .toggleList dd { 206 | display: none; 207 | } 208 | 209 | .toggleList pre { 210 | padding: 4px 4px 4px 4px; 211 | } 212 | 213 | 214 | 215 | 216 | 217 | /* COLORS */ 218 | 219 | pre, code { 220 | color: #000000; 221 | } 222 | 223 | 224 | body { 225 | color : #333333; 226 | background-color :#FFFFFF; 227 | } 228 | 229 | 230 | h1, h2, h3, h4, h5, h6 { 231 | color:#555; 232 | } 233 | 234 | a, 235 | .toggleList dt { 236 | color: #1a7eb0; 237 | } 238 | 239 | a:hover, 240 | a:active { 241 | color: #1a7eb0; 242 | } 243 | 244 | a:visited, 245 | a:link:visited { 246 | color: #1a7eb0; 247 | } 248 | 249 | td,tr { 250 | border-color: #999999; 251 | } 252 | 253 | hr { 254 | color:#999999; 255 | background:#999999; 256 | } 257 | 258 | 259 | .TableHeadingColor { 260 | background: #dcdcdc; 261 | color: #555; 262 | } 263 | 264 | 265 | .TableSubHeadingColor { 266 | background: #EEEEFF 267 | } 268 | 269 | .TableRowColor { 270 | background: #FFFFFF 271 | } 272 | 273 | 274 | .NavBarCell1 { 275 | background-color:#dcdcdc; 276 | color:#000; 277 | } 278 | 279 | .NavBarCell1 a { 280 | color:#333; 281 | } 282 | 283 | 284 | .NavBarCell1Rev { 285 | background-color:transparent; 286 | } 287 | 288 | .NavBarFont1 { 289 | color:#333; 290 | } 291 | 292 | 293 | .NavBarFont1Rev { 294 | color:#fff; 295 | } 296 | 297 | .NavBarCell2 { 298 | background-color:#999; 299 | } 300 | 301 | .NavBarCell2 a { 302 | color:#fff; 303 | } 304 | 305 | 306 | 307 | .NavBarCell3 { 308 | background-color:#dcdcdc; 309 | } 310 | 311 | -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiatomStudio/CodeThread/3403985d7e9a71e1758abcfaa0486cf76fa7ccfa/src/.DS_Store -------------------------------------------------------------------------------- /src/codeThreadLib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiatomStudio/CodeThread/3403985d7e9a71e1758abcfaa0486cf76fa7ccfa/src/codeThreadLib/.DS_Store -------------------------------------------------------------------------------- /src/codeThreadLib/library/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DiatomStudio/CodeThread/3403985d7e9a71e1758abcfaa0486cf76fa7ccfa/src/codeThreadLib/library/.DS_Store -------------------------------------------------------------------------------- /src/codeThreadLib/library/CodeThread.java: -------------------------------------------------------------------------------- 1 | package codeThreadLib.library; 2 | 3 | import java.io.BufferedWriter; 4 | import java.io.FileWriter; 5 | import java.io.IOException; 6 | import java.util.ArrayList; 7 | 8 | import processing.core.PApplet; 9 | 10 | public class CodeThread { 11 | 12 | 13 | 14 | // myParent is a reference to the parent sketch 15 | PApplet myParent; 16 | 17 | int myVariable = 0; 18 | 19 | public final static String VERSION = "0.1.2"; 20 | 21 | 22 | /** 23 | * a library for generating tool paths for makerbot and other cnc tools 24 | */ 25 | public CodeThread(PApplet theParent) { 26 | myParent = theParent; 27 | } 28 | 29 | 30 | 31 | /** 32 | * returns the version of the library. 33 | * 34 | * @return String 35 | */ 36 | public static String version() { 37 | return VERSION; 38 | } 39 | 40 | 41 | 42 | String codeString = ""; 43 | String endChar = "\n"; 44 | 45 | int defaultToolTemp = 220; 46 | int defaultBuildPlatformTemp = 110; 47 | int defaultExtruderSpeed = 240; 48 | 49 | ArrayList commands = new ArrayList(); 50 | 51 | /** 52 | *set units to millimeters 53 | */ 54 | public void setUnitmm() { 55 | commands.add( new MillimeterCommand()); 56 | } 57 | 58 | /** 59 | *set units to inches 60 | */ 61 | public void setUnitInch() { 62 | commands.add( new InchCommand()); 63 | } 64 | 65 | /** 66 | *move head to absolute position 67 | */ 68 | public void moveTo(float x, float y, float z, float speed) { 69 | commands.add( new MoveCommand(x,y,z,speed)); 70 | } 71 | 72 | /** 73 | *turn extruder on fwd 74 | */ 75 | public void extruderOnFwd() { 76 | commands.add( new ExtruderOnFwdCommand()); 77 | } 78 | /** 79 | *turn extruder on rev 80 | */ 81 | public void extruderOnRev() { 82 | commands.add( new ExtruderOnRevCommand()); 83 | } 84 | 85 | /** 86 | *turn extruder off 87 | */ 88 | public void extruderOff() { 89 | commands.add( new ExtruderOffCommand()); 90 | } 91 | 92 | /** 93 | *set tool temp 94 | */ 95 | public void setToolTemp(int toolNum, int temp) { 96 | commands.add( new ToolTempCommand( toolNum, temp)); 97 | } 98 | 99 | /** 100 | *set build platform temp 101 | */ 102 | public void setBuildPlatformTemp(int toolNum, int temp) { 103 | commands.add( new BuildPlatformTempCommand( toolNum, temp)); 104 | } 105 | 106 | /** 107 | *set extrusion speed 108 | */ 109 | public void setExtrusionSpeed(int toolNum, int speed) { 110 | commands.add( new ToolSpeedCommand( toolNum, speed)); 111 | } 112 | /** 113 | * set machine to absolute positioning 114 | */ 115 | public void setAbsolutePositioning() { 116 | commands.add( new setAbsolutePositioningCommand()); 117 | } 118 | 119 | /** 120 | * set current postion as home 121 | */ 122 | public void setCurrentHome(int x, int y, int z){ 123 | commands.add( new setCurrentHomeCommand(x,y,z)); 124 | } 125 | 126 | /** 127 | * wait for tool to heat 128 | @param toolNum 129 | */ 130 | public void waitForToolToHeat(int toolNum ){ 131 | commands.add( new waitForToolToHeatCommand(toolNum)); 132 | } 133 | 134 | /** 135 | * pause extruding head 136 | * @param secs 137 | */ 138 | public void pause(int millis ){ 139 | commands.add( new PauseCommand(millis)); 140 | } 141 | 142 | 143 | /** 144 | * turn off machines stepper motors 145 | */ 146 | public void turnOffSteppers(){ 147 | commands.add( new TurnOffSteppersCommand()); 148 | 149 | } 150 | 151 | /** 152 | * finish the print and cooldown the machine 153 | */ 154 | public void finishPrint(){ 155 | setCurrentHome(0,0,0); 156 | moveTo(0.0f,0.0f,10.0f,1000); 157 | turnOffSteppers(); 158 | } 159 | 160 | /** 161 | * clear the list of commands 162 | */ 163 | public void clear(){ 164 | commands.clear(); 165 | 166 | } 167 | 168 | 169 | /** 170 | * generate a raft for your print 171 | */ 172 | public void generateRaft(float raftWidth, float raftHeight, int baseFeed, int interfaceFeed, float baseStep, float interfaceStep) { 173 | 174 | int numBaseLines = (int) (raftWidth/baseStep); 175 | int numInterfaceLines = (int) (raftHeight/interfaceStep); 176 | 177 | moveTo(-raftWidth/2, -raftWidth/2 + -10, 0.35f, interfaceFeed); 178 | extruderOnFwd(); 179 | 180 | for (int i=0; i) 240 | 241 | ( 0.805 ) 242 | 243 | G1 X17 Y17 Z0.81 F3000 244 | 245 | M101 246 | 247 | G1 X-17 Y17 Z0.81 F3000 248 | 249 | G1 X-17 Y15.5 Z0.81 F3000 250 | 251 | G1 X17 Y15.5 Z0.81 F3000 252 | 253 | G1 X17 Y14 Z0.81 F3000 254 | 255 | G1 X-17 Y14 Z0.81 F3000 256 | 257 | G1 X-17 Y12.5 Z0.81 F3000 258 | 259 | G1 X17 Y12.5 Z0.81 F3000 260 | 261 | G1 X17 Y11 Z0.81 F3000 262 | 263 | G1 X-17 Y11 Z0.81 F3000 264 | 265 | G1 X-17 Y9.5 Z0.81 F3000 266 | 267 | G1 X17 Y9.5 Z0.81 F3000 268 | 269 | G1 X17 Y8 Z0.81 F3000 270 | 271 | G1 X-17 Y8 Z0.81 F3000 272 | 273 | G1 X-17 Y6.5 Z0.81 F3000 274 | 275 | G1 X17 Y6.5 Z0.81 F3000 276 | 277 | G1 X17 Y5 Z0.81 F3000 278 | 279 | G1 X-17 Y5 Z0.81 F3000 280 | 281 | G1 X-17 Y3.5 Z0.81 F3000 282 | 283 | G1 X17 Y3.5 Z0.81 F3000 284 | 285 | G1 X17 Y2 Z0.81 F3000 286 | 287 | G1 X-17 Y2 Z0.81 F3000 288 | 289 | G1 X-17 Y0.5 Z0.81 F3000 290 | 291 | G1 X17 Y0.5 Z0.81 F3000 292 | 293 | G1 X17 Y-1 Z0.81 F3000 294 | 295 | G1 X-17 Y-1 Z0.81 F3000 296 | 297 | G1 X-17 Y-2.5 Z0.81 F3000 298 | 299 | G1 X17 Y-2.5 Z0.81 F3000 300 | 301 | G1 X17 Y-4 Z0.81 F3000 302 | 303 | G1 X-17 Y-4 Z0.81 F3000 304 | 305 | G1 X-17 Y-5.5 Z0.81 F3000 306 | 307 | G1 X17 Y-5.5 Z0.81 F3000 308 | 309 | G1 X17 Y-7 Z0.81 F3000 310 | 311 | G1 X-17 Y-7 Z0.81 F3000 312 | 313 | G1 X-17 Y-8.5 Z0.81 F3000 314 | 315 | G1 X17 Y-8.5 Z0.81 F3000 316 | 317 | G1 X17 Y-10 Z0.81 F3000 318 | 319 | G1 X-17 Y-10 Z0.81 F3000 320 | 321 | G1 X-17 Y-11.5 Z0.81 F3000 322 | 323 | G1 X17 Y-11.5 Z0.81 F3000 324 | 325 | G1 X17 Y-13 Z0.81 F3000 326 | 327 | G1 X-17 Y-13 Z0.81 F3000 328 | 329 | G1 X-17 Y-14.5 Z0.81 F3000 330 | 331 | G1 X17 Y-14.5 Z0.81 F3000 332 | 333 | G1 X17 Y-16 Z0.81 F3000 334 | 335 | G1 X-17 Y-16 Z0.81 F3000 336 | 337 | G1 X-17 Y-17.5 Z0.81 F3000 338 | 339 | M103 340 | 341 | */ 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | --------------------------------------------------------------------------------