├── .gitignore ├── LICENSE ├── README.md ├── doc ├── DXF2GCODE_Beschreibung_b02_tkinter.doc ├── DXF2GCODE_Beschreibung_v01.doc ├── DXF2GCODE_Zusammenh%E4nge_der_Skripts.doc ├── DXF2GCODE_Zusammenh�nge_der_Skripts.doc ├── LKH_REPORT.pdf ├── TSPchapter.pdf ├── acad_dxf2010.pdf ├── arcinterpolation.pdf ├── dxf2002.pdf ├── dxf2ble10b10.zip ├── liu2007_line_arc_offset[1].pdf └── mill.pdf ├── dxf ├── 1.dxf ├── 132_2000.dxf ├── 132_R14.dxf ├── 1997.DXF ├── 1997_simplified.dxf ├── 1997_simplified_doppelte_linien.dxf ├── 2.dxf ├── 2010-06-13 test.dxf ├── 2010-06-13_test_kor.dxf ├── 2011-08-09_test.dxf ├── 3.dxf ├── ADLER.DXF ├── AFluegel Rippen b2 0201.dxf ├── ATT00079.dxf ├── Blocktest.JPG ├── Blocktest.dxf ├── Bogen_Ellipsen_Polylinien_Block.dxf ├── DEMO.DXF ├── DRAAK.dxf ├── DXF_132_-.dxf ├── Ellipsenb%F6gen_Block_gedreht.JPG ├── Ellipsenb%F6gen_Block_gedreht.dxf ├── Ellipsenb%F6gen_Block_kopiert.JPG ├── Ellipsenb%F6gen_Block_kopiert.dxf ├── Ellipsenb%F6gen_Block_radial_60_Grad.JPG ├── Ellipsenb%F6gen_Block_radial_60_Grad.dxf ├── Ellipsenb%F6gen_einfach.JPG ├── Ellipsenb%F6gen_einfach.dxf ├── Ellipsenb�gen_Block_gedreht.JPG ├── Ellipsenb�gen_Block_gedreht.dxf ├── Ellipsenb�gen_Block_kopiert.JPG ├── Ellipsenb�gen_Block_kopiert.dxf ├── Ellipsenb�gen_Block_radial_60_Grad.JPG ├── Ellipsenb�gen_Block_radial_60_Grad.dxf ├── Ellipsenb�gen_einfach.JPG ├── Ellipsenb�gen_einfach.dxf ├── FLH-001.dxf ├── Fl%FCgel Rippen sp2 0201.dxf ├── Fl�gel Rippen sp2 0201.dxf ├── Frontplatte_Texte_aufgebrochen.dxf ├── Hardcopy.pdf ├── IFluegel Rippen b2 0201 a.ngc ├── IFluegel Rippen b2 0201 b.ngc ├── IFluegel Rippen b2 0201.dxf ├── Inkspace_dxf_export_kreis_splines.dxf ├── Kurve_Polylinien.dxf ├── Kurven1-14.dxf ├── LinieBlock.JPG ├── LinieBlock1-Meines.JPG ├── LinieBlock1Turbocad.JPG ├── Linieblock.dxf ├── Linieblock1.dxf ├── Lueftergitter_R14.dxf ├── Polylinie.dxf ├── SchlittenBack.dxf ├── Spline_Problem.dxf ├── Spriale14.dxf ├── Stir_1.dxf ├── Teile.dxf ├── Turbocad_12.5.dxf ├── UAP_212718.dxf ├── beispiel_wordart.doc ├── beispiel_wordart.pdf ├── erin.dxf ├── erin7.ngc ├── ferrari.dxf ├── fr%E4sen_test_02 2004.dxf ├── fr�sen_test_02 2004.dxf ├── lines_through_cutting_depth1.dat ├── lines_through_cutting_depth2.png ├── no_problem_with_arc_alone.dxf ├── numbers.dxf ├── print.pdf ├── print.ps ├── problem_with_arc_and_problem_with_G41-G42_auto_switch.dxf ├── problem_with_arc_and_problem_with_G41-G42_auto_switch_red.dxf ├── problem_with_arc_in_block.dxf ├── problem_with_arc_in_blockqcad.dxf ├── probleme.dxf ├── pstoedit_test.pdf ├── qcad_test_Elements_zero.dxf ├── sector.dxf ├── test.dxf ├── test1.dxf └── vdr_Fraeskontur_Fraesermitte.dxf ├── links └── DXF2GCODE Webpage.URL ├── python_examples ├── Ellipse_BiArc │ ├── BIARC_TEST.py │ ├── clsBiArc.py │ ├── clsEllipse.py │ ├── clsGeometrie.py │ └── test.bat ├── Ellipse_fitting_by_Biarc_curves.py ├── FloatCanvasDemo.py ├── GridDemo.py ├── Kegelstump_Abwicklung_2dxf.py ├── NURBS_fitting_by_Biarc_curves.py ├── NURBS_fitting_by_Biarc_curves_wx.py ├── canvas_sample.py ├── customtreectrl.py ├── gtk │ ├── animationrotation.py │ ├── filesel.py │ ├── make_exe.py │ ├── polyline_hit_inside.py │ └── pygtkcanvas-1.0 │ │ ├── LICENSE │ │ ├── README │ │ ├── __init__.py │ │ ├── canvas.py │ │ ├── canvasitem.py │ │ ├── canvaslayer.py │ │ ├── canvasmath.py │ │ ├── example.py │ │ ├── image1.png │ │ ├── image2.jpeg │ │ ├── pygtkcanvas-design.dia │ │ └── pygtkcanvas.geany ├── make_exe.py ├── menu_test.py ├── qt │ ├── Starte_mein_gui.py │ ├── Starte_mein_gui.spec │ ├── context_menu.py │ ├── demo.py │ ├── demo.ui │ ├── diagramscene.py │ ├── diagramscene.pyw │ ├── diagramscene.qrc │ ├── diagramscene_rc.py │ ├── filedialog.py │ ├── graphicscene_test.py │ ├── images │ │ ├── background1.png │ │ ├── background2.png │ │ ├── background3.png │ │ ├── background4.png │ │ ├── bold.png │ │ ├── bringtofront.png │ │ ├── delete.png │ │ ├── floodfill.png │ │ ├── italic.png │ │ ├── linecolor.png │ │ ├── linepointer.png │ │ ├── pointer.png │ │ ├── sendtoback.png │ │ ├── textpointer.png │ │ └── underline.png │ ├── make_exe.py │ ├── make_py_uic.py │ ├── mein_test.py │ └── warnStarte_mein_gui.txt └── travelling_salesman_problem_2.py └── source ├── Core ├── ArcGeo.py ├── BoundingBox.py ├── Config.py ├── CustomGCode.py ├── EntitieContent.py ├── Globals.py ├── LayerContent.py ├── LineGeo.py ├── Logger.py ├── Point.py ├── Shape.py ├── __init__.py ├── configobj.py ├── constants.py └── validate.py ├── DXF2GCODE-001.ico ├── DxfImport ├── Classes.py ├── GeoentArc.py ├── GeoentCircle.py ├── GeoentEllipse.py ├── GeoentInsert.py ├── GeoentLine.py ├── GeoentLwpolyline.py ├── GeoentPolyline.py ├── GeoentSpline.py ├── Import.py ├── SplineConvert.py ├── __init__.py └── biarc.py ├── Gui ├── AboutDialog.py ├── Arrow.py ├── Dialog.py ├── RouteText.py ├── StMove.py ├── TreeHandling.py ├── WpZero.py ├── __init__.py ├── myCanvasClass.py ├── myMessageBox.py └── myTreeView.py ├── PostPro ├── CutComp.py ├── PostProcessor.py ├── PostProcessorConfig.py ├── TspOptimisation.py └── __init__.py ├── config └── config-grbl2d.cfg ├── d2gexceptions.py ├── dxf2gcode.py ├── dxf2gcode.spec ├── dxf2gcode_pyQt4_ui ├── __init__.py ├── dxf2gcode_images.qrc ├── dxf2gcode_images_rc.py ├── dxf2gcode_pyQt4_ui.py ├── dxf2gcode_pyQt4_ui.ui └── make_py_uic.py ├── epydoc-gen.py ├── epydoc_test.py ├── i18n ├── dxf2gcode_de_DE.qm ├── dxf2gcode_de_DE.ts ├── dxf2gcode_fr.qm └── dxf2gcode_fr.ts ├── images ├── background1.png ├── background2.png ├── background3.png ├── background4.png ├── blocks.png ├── bold.png ├── bringtofront.png ├── collapse-all.png ├── delete.png ├── dxf2gcode_logo.png ├── expand-all.png ├── floodfill.png ├── go-down.png ├── go-up.png ├── italic.png ├── layer.png ├── linecolor.png ├── linepointer.png ├── pause.png ├── pointer.png ├── sendtoback.png ├── shape.png ├── textpointer.png └── underline.png ├── make_exe.py ├── make_pylupdate4_dxf2gcode.py └── postpro_config └── postpro_config-grbl2d.cfg /.gitignore: -------------------------------------------------------------------------------- 1 | postpro_config.cfg 2 | source/config 3 | 4 | *.py[cod] 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Packages 10 | *.egg 11 | *.egg-info 12 | dist 13 | build 14 | eggs 15 | parts 16 | bin 17 | var 18 | sdist 19 | develop-eggs 20 | .installed.cfg 21 | lib 22 | lib64 23 | 24 | # Installer logs 25 | pip-log.txt 26 | 27 | # Unit test / coverage reports 28 | .coverage 29 | .tox 30 | nosetests.xml 31 | 32 | # Translations 33 | *.mo 34 | 35 | # Mr Developer 36 | .mr.developer.cfg 37 | .project 38 | .pydevproject 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | dxf2gcode 2 | ========= 3 | 4 | This is a fork of https://code.google.com/p/dxf2gcode/. 5 | The goal is to make it compatible with https://github.com/grbl/grbl so it can finally feed my laser plotter. 6 | -------------------------------------------------------------------------------- /doc/DXF2GCODE_Beschreibung_b02_tkinter.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/DXF2GCODE_Beschreibung_b02_tkinter.doc -------------------------------------------------------------------------------- /doc/DXF2GCODE_Beschreibung_v01.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/DXF2GCODE_Beschreibung_v01.doc -------------------------------------------------------------------------------- /doc/DXF2GCODE_Zusammenh%E4nge_der_Skripts.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/DXF2GCODE_Zusammenh%E4nge_der_Skripts.doc -------------------------------------------------------------------------------- /doc/DXF2GCODE_Zusammenh�nge_der_Skripts.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/DXF2GCODE_Zusammenh�nge_der_Skripts.doc -------------------------------------------------------------------------------- /doc/LKH_REPORT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/LKH_REPORT.pdf -------------------------------------------------------------------------------- /doc/TSPchapter.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/TSPchapter.pdf -------------------------------------------------------------------------------- /doc/acad_dxf2010.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/acad_dxf2010.pdf -------------------------------------------------------------------------------- /doc/arcinterpolation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/arcinterpolation.pdf -------------------------------------------------------------------------------- /doc/dxf2002.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/dxf2002.pdf -------------------------------------------------------------------------------- /doc/dxf2ble10b10.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/dxf2ble10b10.zip -------------------------------------------------------------------------------- /doc/liu2007_line_arc_offset[1].pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/liu2007_line_arc_offset[1].pdf -------------------------------------------------------------------------------- /doc/mill.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/doc/mill.pdf -------------------------------------------------------------------------------- /dxf/2011-08-09_test.dxf: -------------------------------------------------------------------------------- 1 | 999 2 | DXF created by Inkscape 3 | 0 4 | SECTION 5 | 2 6 | HEADER 7 | 9 8 | $ACADVER 9 | 1 10 | AC1014 11 | 9 12 | $HANDSEED 13 | 5 14 | FFFF 15 | 9 16 | $MEASUREMENT 17 | 70 18 | 1 19 | 0 20 | ENDSEC 21 | 0 22 | SECTION 23 | 2 24 | TABLES 25 | 0 26 | TABLE 27 | 2 28 | VPORT 29 | 5 30 | 8 31 | 330 32 | 0 33 | 100 34 | AcDbSymbolTable 35 | 70 36 | 4 37 | 0 38 | VPORT 39 | 5 40 | 2E 41 | 330 42 | 8 43 | 100 44 | AcDbSymbolTableRecord 45 | 100 46 | AcDbViewportTableRecord 47 | 2 48 | *ACTIVE 49 | 70 50 | 0 51 | 10 52 | 0.0 53 | 20 54 | 0.0 55 | 11 56 | 1.0 57 | 21 58 | 1.0 59 | 12 60 | 210.0 61 | 22 62 | 148.5 63 | 13 64 | 0.0 65 | 23 66 | 0.0 67 | 14 68 | 10.0 69 | 24 70 | 10.0 71 | 15 72 | 10.0 73 | 25 74 | 10.0 75 | 16 76 | 0.0 77 | 26 78 | 0.0 79 | 36 80 | 1.0 81 | 17 82 | 0.0 83 | 27 84 | 0.0 85 | 37 86 | 0.0 87 | 40 88 | 341.0 89 | 41 90 | 1.24 91 | 42 92 | 50.0 93 | 43 94 | 0.0 95 | 44 96 | 0.0 97 | 50 98 | 0.0 99 | 51 100 | 0.0 101 | 71 102 | 0 103 | 72 104 | 100 105 | 73 106 | 1 107 | 74 108 | 3 109 | 75 110 | 0 111 | 76 112 | 0 113 | 77 114 | 0 115 | 78 116 | 0 117 | 0 118 | ENDTAB 119 | 0 120 | TABLE 121 | 2 122 | LTYPE 123 | 5 124 | 5 125 | 330 126 | 0 127 | 100 128 | AcDbSymbolTable 129 | 70 130 | 1 131 | 0 132 | LTYPE 133 | 5 134 | 14 135 | 330 136 | 5 137 | 100 138 | AcDbSymbolTableRecord 139 | 100 140 | AcDbLinetypeTableRecord 141 | 2 142 | BYBLOCK 143 | 70 144 | 0 145 | 3 146 | 147 | 72 148 | 65 149 | 73 150 | 0 151 | 40 152 | 0.0 153 | 0 154 | LTYPE 155 | 5 156 | 15 157 | 330 158 | 5 159 | 100 160 | AcDbSymbolTableRecord 161 | 100 162 | AcDbLinetypeTableRecord 163 | 2 164 | BYLAYER 165 | 70 166 | 0 167 | 3 168 | 169 | 72 170 | 65 171 | 73 172 | 0 173 | 40 174 | 0.0 175 | 0 176 | LTYPE 177 | 5 178 | 16 179 | 330 180 | 5 181 | 100 182 | AcDbSymbolTableRecord 183 | 100 184 | AcDbLinetypeTableRecord 185 | 2 186 | CONTINUOUS 187 | 70 188 | 0 189 | 3 190 | Solid line 191 | 72 192 | 65 193 | 73 194 | 0 195 | 40 196 | 0.0 197 | 0 198 | ENDTAB 199 | 0 200 | TABLE 201 | 2 202 | LAYER 203 | 5 204 | 2 205 | 100 206 | AcDbSymbolTable 207 | 70 208 | 2 209 | 0 210 | LAYER 211 | 5 212 | 50 213 | 100 214 | AcDbSymbolTableRecord 215 | 100 216 | AcDbLayerTableRecord 217 | 2 218 | 0 219 | 70 220 | 0 221 | 6 222 | CONTINUOUS 223 | 0 224 | LAYER 225 | 5 226 | 51 227 | 100 228 | AcDbSymbolTableRecord 229 | 100 230 | AcDbLayerTableRecord 231 | 2 232 | Layer_1 233 | 70 234 | 0 235 | 6 236 | CONTINUOUS 237 | 0 238 | ENDTAB 239 | 0 240 | TABLE 241 | 2 242 | STYLE 243 | 5 244 | 3 245 | 330 246 | 0 247 | 100 248 | AcDbSymbolTable 249 | 70 250 | 1 251 | 0 252 | STYLE 253 | 5 254 | 11 255 | 330 256 | 3 257 | 100 258 | AcDbSymbolTableRecord 259 | 100 260 | AcDbTextStyleTableRecord 261 | 2 262 | STANDARD 263 | 70 264 | 0 265 | 40 266 | 0.0 267 | 41 268 | 1.0 269 | 50 270 | 0.0 271 | 71 272 | 0 273 | 42 274 | 2.5 275 | 3 276 | txt 277 | 4 278 | 279 | 0 280 | ENDTAB 281 | 0 282 | TABLE 283 | 2 284 | VIEW 285 | 5 286 | 6 287 | 330 288 | 0 289 | 100 290 | AcDbSymbolTable 291 | 70 292 | 0 293 | 0 294 | ENDTAB 295 | 0 296 | TABLE 297 | 2 298 | UCS 299 | 5 300 | 7 301 | 330 302 | 0 303 | 100 304 | AcDbSymbolTable 305 | 70 306 | 0 307 | 0 308 | ENDTAB 309 | 0 310 | TABLE 311 | 2 312 | APPID 313 | 5 314 | 9 315 | 330 316 | 0 317 | 100 318 | AcDbSymbolTable 319 | 70 320 | 2 321 | 0 322 | APPID 323 | 5 324 | 12 325 | 330 326 | 9 327 | 100 328 | AcDbSymbolTableRecord 329 | 100 330 | AcDbRegAppTableRecord 331 | 2 332 | ACAD 333 | 70 334 | 0 335 | 0 336 | ENDTAB 337 | 0 338 | TABLE 339 | 2 340 | DIMSTYLE 341 | 5 342 | A 343 | 330 344 | 0 345 | 100 346 | AcDbSymbolTable 347 | 70 348 | 1 349 | 0 350 | DIMSTYLE 351 | 105 352 | 27 353 | 330 354 | A 355 | 100 356 | AcDbSymbolTableRecord 357 | 100 358 | AcDbDimStyleTableRecord 359 | 2 360 | ISO-25 361 | 70 362 | 0 363 | 3 364 | 365 | 4 366 | 367 | 5 368 | 369 | 6 370 | 371 | 7 372 | 373 | 40 374 | 1.0 375 | 41 376 | 2.5 377 | 42 378 | 0.625 379 | 43 380 | 3.75 381 | 44 382 | 1.25 383 | 45 384 | 0.0 385 | 46 386 | 0.0 387 | 47 388 | 0.0 389 | 48 390 | 0.0 391 | 140 392 | 2.5 393 | 141 394 | 2.5 395 | 142 396 | 0.0 397 | 143 398 | 0.03937007874016 399 | 144 400 | 1.0 401 | 145 402 | 0.0 403 | 146 404 | 1.0 405 | 147 406 | 0.625 407 | 71 408 | 0 409 | 72 410 | 0 411 | 73 412 | 0 413 | 74 414 | 0 415 | 75 416 | 0 417 | 76 418 | 0 419 | 77 420 | 1 421 | 78 422 | 8 423 | 170 424 | 0 425 | 171 426 | 3 427 | 172 428 | 1 429 | 173 430 | 0 431 | 174 432 | 0 433 | 175 434 | 0 435 | 176 436 | 0 437 | 177 438 | 0 439 | 178 440 | 0 441 | 270 442 | 2 443 | 271 444 | 2 445 | 272 446 | 2 447 | 273 448 | 2 449 | 274 450 | 3 451 | 340 452 | 11 453 | 275 454 | 0 455 | 280 456 | 0 457 | 281 458 | 0 459 | 282 460 | 0 461 | 283 462 | 0 463 | 284 464 | 8 465 | 285 466 | 0 467 | 286 468 | 0 469 | 287 470 | 3 471 | 288 472 | 0 473 | 0 474 | ENDTAB 475 | 0 476 | TABLE 477 | 2 478 | BLOCK_RECORD 479 | 5 480 | 1 481 | 330 482 | 0 483 | 100 484 | AcDbSymbolTable 485 | 70 486 | 1 487 | 0 488 | BLOCK_RECORD 489 | 5 490 | 1F 491 | 330 492 | 1 493 | 100 494 | AcDbSymbolTableRecord 495 | 100 496 | AcDbBlockTableRecord 497 | 2 498 | *MODEL_SPACE 499 | 0 500 | BLOCK_RECORD 501 | 5 502 | 1B 503 | 330 504 | 1 505 | 100 506 | AcDbSymbolTableRecord 507 | 100 508 | AcDbBlockTableRecord 509 | 2 510 | *PAPER_SPACE 511 | 0 512 | ENDTAB 513 | 0 514 | ENDSEC 515 | 0 516 | SECTION 517 | 2 518 | BLOCKS 519 | 0 520 | BLOCK 521 | 5 522 | 20 523 | 330 524 | 1F 525 | 100 526 | AcDbEntity 527 | 8 528 | 0 529 | 100 530 | AcDbBlockBegin 531 | 2 532 | *MODEL_SPACE 533 | 70 534 | 0 535 | 10 536 | 0.0 537 | 20 538 | 0.0 539 | 30 540 | 0.0 541 | 3 542 | *MODEL_SPACE 543 | 1 544 | 545 | 0 546 | ENDBLK 547 | 5 548 | 21 549 | 330 550 | 1F 551 | 100 552 | AcDbEntity 553 | 8 554 | 0 555 | 100 556 | AcDbBlockEnd 557 | 0 558 | BLOCK 559 | 5 560 | 1C 561 | 330 562 | 1B 563 | 100 564 | AcDbEntity 565 | 67 566 | 1 567 | 8 568 | 0 569 | 100 570 | AcDbBlockBegin 571 | 2 572 | *PAPER_SPACE 573 | 1 574 | 575 | 0 576 | ENDBLK 577 | 5 578 | 1D 579 | 330 580 | 1B 581 | 100 582 | AcDbEntity 583 | 67 584 | 1 585 | 8 586 | 0 587 | 100 588 | AcDbBlockEnd 589 | 0 590 | ENDSEC 591 | 0 592 | SECTION 593 | 2 594 | ENTITIES 595 | 0 596 | LWPOLYLINE 597 | 5 598 | 100 599 | 100 600 | AcDbEntity 601 | 8 602 | Layer_1 603 | 62 604 | 7 605 | 100 606 | AcDbPolyline 607 | 90 608 | 2 609 | 70 610 | 0 611 | 10 612 | 33.866667 613 | 20 614 | 183.847626 615 | 30 616 | 0.0 617 | 10 618 | 71.765078 619 | 20 620 | 235.453974 621 | 30 622 | 0.0 623 | 0 624 | LWPOLYLINE 625 | 5 626 | 101 627 | 100 628 | AcDbEntity 629 | 8 630 | Layer_1 631 | 62 632 | 7 633 | 100 634 | AcDbPolyline 635 | 90 636 | 2 637 | 70 638 | 0 639 | 10 640 | 163.688889 641 | 20 642 | 237.066674 643 | 30 644 | 0.0 645 | 10 646 | 100.793652 647 | 20 648 | 124.984133 649 | 30 650 | 0.0 651 | 0 652 | ENDSEC 653 | 0 654 | SECTION 655 | 2 656 | OBJECTS 657 | 0 658 | DICTIONARY 659 | 5 660 | C 661 | 330 662 | 0 663 | 100 664 | AcDbDictionary 665 | 3 666 | ACAD_GROUP 667 | 350 668 | D 669 | 3 670 | ACAD_MLINESTYLE 671 | 350 672 | 17 673 | 0 674 | DICTIONARY 675 | 5 676 | D 677 | 330 678 | C 679 | 100 680 | AcDbDictionary 681 | 0 682 | DICTIONARY 683 | 5 684 | 1A 685 | 330 686 | C 687 | 100 688 | AcDbDictionary 689 | 0 690 | DICTIONARY 691 | 5 692 | 17 693 | 330 694 | C 695 | 100 696 | AcDbDictionary 697 | 3 698 | STANDARD 699 | 350 700 | 18 701 | 0 702 | DICTIONARY 703 | 5 704 | 19 705 | 330 706 | C 707 | 100 708 | AcDbDictionary 709 | 0 710 | ENDSEC 711 | 0 712 | EOF 713 | -------------------------------------------------------------------------------- /dxf/AFluegel Rippen b2 0201.dxf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/AFluegel Rippen b2 0201.dxf -------------------------------------------------------------------------------- /dxf/Blocktest.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Blocktest.JPG -------------------------------------------------------------------------------- /dxf/Ellipsenb%F6gen_Block_gedreht.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Ellipsenb%F6gen_Block_gedreht.JPG -------------------------------------------------------------------------------- /dxf/Ellipsenb%F6gen_Block_kopiert.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Ellipsenb%F6gen_Block_kopiert.JPG -------------------------------------------------------------------------------- /dxf/Ellipsenb%F6gen_Block_radial_60_Grad.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Ellipsenb%F6gen_Block_radial_60_Grad.JPG -------------------------------------------------------------------------------- /dxf/Ellipsenb%F6gen_einfach.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Ellipsenb%F6gen_einfach.JPG -------------------------------------------------------------------------------- /dxf/Ellipsenb�gen_Block_gedreht.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Ellipsenb�gen_Block_gedreht.JPG -------------------------------------------------------------------------------- /dxf/Ellipsenb�gen_Block_kopiert.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Ellipsenb�gen_Block_kopiert.JPG -------------------------------------------------------------------------------- /dxf/Ellipsenb�gen_Block_radial_60_Grad.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Ellipsenb�gen_Block_radial_60_Grad.JPG -------------------------------------------------------------------------------- /dxf/Ellipsenb�gen_einfach.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Ellipsenb�gen_einfach.JPG -------------------------------------------------------------------------------- /dxf/FLH-001.dxf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/FLH-001.dxf -------------------------------------------------------------------------------- /dxf/Fl%FCgel Rippen sp2 0201.dxf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Fl%FCgel Rippen sp2 0201.dxf -------------------------------------------------------------------------------- /dxf/Fl�gel Rippen sp2 0201.dxf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Fl�gel Rippen sp2 0201.dxf -------------------------------------------------------------------------------- /dxf/Hardcopy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/Hardcopy.pdf -------------------------------------------------------------------------------- /dxf/IFluegel Rippen b2 0201 a.ngc: -------------------------------------------------------------------------------- 1 | (Generated with: dxf2gcode_b02, Version: TKINTER Beta 02, Date: 2010-03-30) 2 | (Time: Sun Apr 25 09:39:59 2010) 3 | (Created from file: C:/Dokumente und Einstellungen/llihab1/Eigene Dateien/Hauber/allg/hauber/Fliegen/Modellfliegen/marabu/Fräsen/Balsaholz/Fluegel/Baustand 02/IFluegel Rippen b2 0201.dxf) 4 | G21 (Unit in mm) 5 | G90 (Absolute distance mode) 6 | G64 P0.01 (Exact Path 0.001 tol.) 7 | G17 8 | G40 (Cancel diameter comp.) 9 | G49 (Cancel length comp.) 10 | T1M6 (Tool change to T1) 11 | M8 (Coolant flood on) 12 | S5000M03 (Spindle 5000rpm cw) 13 | G0 Z 5.000 14 | G0 X 27.180 Y 33.643 15 | G0 Z 2.000 16 | F150 17 | G1 Z -2.500 18 | F400 19 | G42 20 | G1 X 27.321 Y 33.219 21 | G2 X 26.473 Y 33.219 I -0.424 J 0.424 22 | G2 X 30.008 Y 36.754 I 1.768 J 1.768 23 | G2 X 26.473 Y 33.219 I -1.768 J -1.768 24 | G1 Z 2.000 25 | G0 Z 5.000 26 | G40 27 | G0 X 27.197 Y 54.393 28 | G0 Z 2.000 29 | F150 30 | G1 Z -2.500 31 | F400 32 | G42 33 | G1 X 27.338 Y 53.969 34 | G2 X 26.490 Y 53.969 I -0.424 J 0.424 35 | G2 X 30.025 Y 57.505 I 1.768 J 1.768 36 | G2 X 26.490 Y 53.969 I -1.768 J -1.768 37 | G1 Z 2.000 38 | G0 Z 5.000 39 | G40 40 | G0 X 25.734 Y 76.130 41 | G0 Z 2.000 42 | F150 43 | G1 Z -2.500 44 | F400 45 | G42 46 | G1 X 25.876 Y 75.706 47 | G2 X 25.027 Y 75.706 I -0.424 J 0.424 48 | G2 X 28.563 Y 79.241 I 1.768 J 1.768 49 | G2 X 25.027 Y 75.706 I -1.768 J -1.768 50 | G1 Z 2.000 51 | G0 Z 5.000 52 | G40 53 | G0 X 74.288 Y 81.693 54 | G0 Z 2.000 55 | F150 56 | G1 Z -2.500 57 | F400 58 | G42 59 | G1 X 74.429 Y 81.269 60 | G2 X 73.580 Y 81.269 I -0.424 J 0.424 61 | G2 X 77.151 Y 84.840 I 1.785 J 1.785 62 | G2 X 73.580 Y 81.269 I -1.785 J -1.785 63 | G1 Z 2.000 64 | G0 Z 5.000 65 | G40 66 | G0 X 178.470 Y 62.091 67 | G0 Z 2.000 68 | F150 69 | G1 Z -2.500 70 | F400 71 | G42 72 | G1 X 178.611 Y 61.667 73 | G2 X 177.763 Y 61.667 I -0.424 J 0.424 74 | G2 X 181.298 Y 65.202 I 1.768 J 1.768 75 | G2 X 177.763 Y 61.667 I -1.768 J -1.768 76 | G1 Z 2.000 77 | G0 Z 5.000 78 | G40 79 | G0 X 180.984 Y 82.150 80 | G0 Z 2.000 81 | F150 82 | G1 Z -2.500 83 | F400 84 | G42 85 | G1 X 181.126 Y 81.726 86 | G2 X 180.277 Y 81.726 I -0.424 J 0.424 87 | G2 X 183.813 Y 85.262 I 1.768 J 1.768 88 | G2 X 180.277 Y 81.726 I -1.768 J -1.768 89 | G1 Z 2.000 90 | G0 Z 5.000 91 | G40 92 | G0 X 229.782 Y 67.864 93 | G0 Z 2.000 94 | F150 95 | G1 Z -2.500 96 | F400 97 | G42 98 | G1 X 229.923 Y 67.440 99 | G2 X 229.075 Y 67.440 I -0.424 J 0.424 100 | G2 X 232.964 Y 71.329 I 1.945 J 1.945 101 | G2 X 229.075 Y 67.440 I -1.945 J -1.945 102 | G1 Z 2.000 103 | G0 Z 5.000 104 | G40 105 | G0 X 233.428 Y 88.200 106 | G0 Z 2.000 107 | F150 108 | G1 Z -2.500 109 | F400 110 | G42 111 | G1 X 233.570 Y 87.776 112 | G2 X 232.721 Y 87.776 I -0.424 J 0.424 113 | G2 X 236.292 Y 91.347 I 1.785 J 1.785 114 | G2 X 232.721 Y 87.776 I -1.785 J -1.785 115 | G1 Z 2.000 116 | G0 Z 5.000 117 | G40 118 | G0 X 346.555 Y 82.796 119 | G0 Z 2.000 120 | F150 121 | G1 Z -2.500 122 | F400 123 | G42 124 | G1 X 346.697 Y 82.372 125 | G2 X 345.848 Y 82.372 I -0.424 J 0.424 126 | G2 X 349.384 Y 85.908 I 1.768 J 1.768 127 | G2 X 345.848 Y 82.372 I -1.768 J -1.768 128 | G1 Z 2.000 129 | G0 Z 5.000 130 | G40 131 | G0 X 346.107 Y 61.942 132 | G0 Z 2.000 133 | F150 134 | G1 Z -2.500 135 | F400 136 | G42 137 | G1 X 346.249 Y 61.518 138 | G2 X 345.400 Y 61.518 I -0.424 J 0.424 139 | G2 X 348.936 Y 65.054 I 1.768 J 1.768 140 | G2 X 345.400 Y 61.518 I -1.768 J -1.768 141 | G1 Z 2.000 142 | G0 Z 5.000 143 | G40 144 | G0 X 346.468 Y 37.709 145 | G0 Z 2.000 146 | F150 147 | G1 Z -2.500 148 | F400 149 | G42 150 | G1 X 346.609 Y 37.284 151 | G2 X 345.760 Y 37.284 I -0.424 J 0.424 152 | G2 X 349.296 Y 40.820 I 1.768 J 1.768 153 | G2 X 345.760 Y 37.284 I -1.768 J -1.768 154 | G1 Z 2.000 155 | G0 Z 5.000 156 | G40 157 | G0 X 347.437 Y 12.867 158 | G0 Z 2.000 159 | F150 160 | G1 Z -2.500 161 | F400 162 | G42 163 | G1 X 347.578 Y 12.442 164 | G2 X 346.730 Y 12.442 I -0.424 J 0.424 165 | G2 X 350.265 Y 15.978 I 1.768 J 1.768 166 | G2 X 346.730 Y 12.442 I -1.768 J -1.768 167 | G1 Z 2.000 168 | G0 Z 5.000 169 | G40 170 | G0 X 231.942 Y 40.859 171 | G0 Z 2.000 172 | F150 173 | G1 Z -2.500 174 | F400 175 | G42 176 | G1 X 232.083 Y 40.434 177 | G2 X 231.235 Y 40.434 I -0.424 J 0.424 178 | G2 X 235.124 Y 44.323 I 1.945 J 1.945 179 | G2 X 231.235 Y 40.434 I -1.945 J -1.945 180 | G1 Z 2.000 181 | G0 Z 5.000 182 | G40 183 | G0 X 227.233 Y 19.172 184 | G0 Z 2.000 185 | F150 186 | G1 Z -2.500 187 | F400 188 | G42 189 | G1 X 227.374 Y 18.748 190 | G2 X 226.526 Y 18.748 I -0.424 J 0.424 191 | G2 X 230.415 Y 22.637 I 1.945 J 1.945 192 | G2 X 226.526 Y 18.748 I -1.945 J -1.945 193 | G1 Z 2.000 194 | G0 Z 5.000 195 | G40 196 | G0 X 181.603 Y 35.205 197 | G0 Z 2.000 198 | F150 199 | G1 Z -2.500 200 | F400 201 | G42 202 | G1 X 181.744 Y 34.781 203 | G2 X 180.896 Y 34.781 I -0.424 J 0.424 204 | G2 X 184.431 Y 38.316 I 1.768 J 1.768 205 | G2 X 180.896 Y 34.781 I -1.768 J -1.768 206 | G1 Z 2.000 207 | G0 Z 5.000 208 | G40 209 | G0 X 177.866 Y 13.647 210 | G0 Z 2.000 211 | F150 212 | G1 Z -2.500 213 | F400 214 | G42 215 | G1 X 178.007 Y 13.222 216 | G2 X 177.159 Y 13.222 I -0.424 J 0.424 217 | G2 X 180.694 Y 16.758 I 1.768 J 1.768 218 | G2 X 177.159 Y 13.222 I -1.768 J -1.768 219 | G1 Z 2.000 220 | G0 Z 5.000 221 | G40 222 | G0 X 26.670 Y 13.392 223 | G0 Z 2.000 224 | F150 225 | G1 Z -2.500 226 | F400 227 | G42 228 | G1 X 26.812 Y 12.968 229 | G2 X 25.963 Y 12.968 I -0.424 J 0.424 230 | G2 X 29.499 Y 16.503 I 1.768 J 1.768 231 | G2 X 25.963 Y 12.968 I -1.768 J -1.768 232 | G1 Z 2.000 233 | G0 Z 5.000 234 | G40 235 | G0 X 0.000 Y 0.000 236 | M9 (Coolant off) 237 | M5 (Spindle off) 238 | M2 (Prgram end) -------------------------------------------------------------------------------- /dxf/IFluegel Rippen b2 0201.dxf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/IFluegel Rippen b2 0201.dxf -------------------------------------------------------------------------------- /dxf/Inkspace_dxf_export_kreis_splines.dxf: -------------------------------------------------------------------------------- 1 | 999 2 | DXF created by Inkscape 3 | 0 4 | SECTION 5 | 2 6 | ENTITIES 7 | 0 8 | SPLINE 9 | 5 10 | 43 11 | 8 12 | 0 13 | 62 14 | 256 15 | 370 16 | -1 17 | 6 18 | ByLayer 19 | 100 20 | AcDbEntity 21 | 100 22 | AcDbSpline 23 | 70 24 | 8 25 | 71 26 | 3 27 | 72 28 | 8 29 | 73 30 | 4 31 | 74 32 | 0 33 | 40 34 | 0 35 | 40 36 | 0 37 | 40 38 | 0 39 | 40 40 | 0 41 | 40 42 | 1 43 | 40 44 | 1 45 | 40 46 | 1 47 | 40 48 | 1 49 | 10 50 | 31.447619 51 | 20 52 | 67.733340 53 | 30 54 | 0 55 | 10 56 | 37.777750 57 | 20 58 | 70.921991 59 | 30 60 | 0 61 | 10 62 | 44.842151 63 | 20 64 | 69.719998 65 | 30 66 | 0 67 | 10 68 | 51.606348 69 | 20 70 | 67.733340 71 | 30 72 | 0 73 | 0 74 | SPLINE 75 | 5 76 | 43 77 | 8 78 | 0 79 | 62 80 | 256 81 | 370 82 | -1 83 | 6 84 | ByLayer 85 | 100 86 | AcDbEntity 87 | 100 88 | AcDbSpline 89 | 70 90 | 8 91 | 71 92 | 3 93 | 72 94 | 8 95 | 73 96 | 4 97 | 74 98 | 0 99 | 40 100 | 0 101 | 40 102 | 0 103 | 40 104 | 0 105 | 40 106 | 0 107 | 40 108 | 1 109 | 40 110 | 1 111 | 40 112 | 1 113 | 40 114 | 1 115 | 10 116 | 51.606348 117 | 20 118 | 67.733340 119 | 30 120 | 0 121 | 10 122 | 58.370546 123 | 20 124 | 65.746682 125 | 30 126 | 0 127 | 10 128 | 70.111846 129 | 20 130 | 59.596741 131 | 30 132 | 0 133 | 10 134 | 74.184126 135 | 20 136 | 53.219052 137 | 30 138 | 0 139 | 0 140 | SPLINE 141 | 5 142 | 43 143 | 8 144 | 0 145 | 62 146 | 256 147 | 370 148 | -1 149 | 6 150 | ByLayer 151 | 100 152 | AcDbEntity 153 | 100 154 | AcDbSpline 155 | 70 156 | 8 157 | 71 158 | 3 159 | 72 160 | 8 161 | 73 162 | 4 163 | 74 164 | 0 165 | 40 166 | 0 167 | 40 168 | 0 169 | 40 170 | 0 171 | 40 172 | 0 173 | 40 174 | 1 175 | 40 176 | 1 177 | 40 178 | 1 179 | 40 180 | 1 181 | 10 182 | 74.184126 183 | 20 184 | 53.219052 185 | 30 186 | 0 187 | 10 188 | 78.256407 189 | 20 190 | 46.841366 191 | 30 192 | 0 193 | 10 194 | 79.099893 195 | 20 196 | 35.804753 197 | 30 198 | 0 199 | 10 200 | 77.409525 201 | 20 202 | 29.834926 203 | 30 204 | 0 205 | 0 206 | SPLINE 207 | 5 208 | 43 209 | 8 210 | 0 211 | 62 212 | 256 213 | 370 214 | -1 215 | 6 216 | ByLayer 217 | 100 218 | AcDbEntity 219 | 100 220 | AcDbSpline 221 | 70 222 | 8 223 | 71 224 | 3 225 | 72 226 | 8 227 | 73 228 | 4 229 | 74 230 | 0 231 | 40 232 | 0 233 | 40 234 | 0 235 | 40 236 | 0 237 | 40 238 | 0 239 | 40 240 | 1 241 | 40 242 | 1 243 | 40 244 | 1 245 | 40 246 | 1 247 | 10 248 | 77.409525 249 | 20 250 | 29.834926 251 | 30 252 | 0 253 | 10 254 | 75.719155 255 | 20 256 | 23.865102 257 | 30 258 | 0 259 | 10 260 | 73.610953 261 | 20 262 | 20.496342 263 | 30 264 | 0 265 | 10 266 | 66.120637 267 | 20 268 | 16.126989 269 | 30 270 | 0 271 | 0 272 | SPLINE 273 | 5 274 | 43 275 | 8 276 | 0 277 | 62 278 | 256 279 | 370 280 | -1 281 | 6 282 | ByLayer 283 | 100 284 | AcDbEntity 285 | 100 286 | AcDbSpline 287 | 70 288 | 8 289 | 71 290 | 3 291 | 72 292 | 8 293 | 73 294 | 4 295 | 74 296 | 0 297 | 40 298 | 0 299 | 40 300 | 0 301 | 40 302 | 0 303 | 40 304 | 0 305 | 40 306 | 1 307 | 40 308 | 1 309 | 40 310 | 1 311 | 40 312 | 1 313 | 10 314 | 66.120637 315 | 20 316 | 16.126989 317 | 30 318 | 0 319 | 10 320 | 58.630320 321 | 20 322 | 11.757633 323 | 30 324 | 0 325 | 10 326 | 45.323546 327 | 20 328 | 2.312163 329 | 30 330 | 0 331 | 10 332 | 27.415873 333 | 20 334 | 13.707930 335 | 30 336 | 0 337 | 0 338 | SPLINE 339 | 5 340 | 43 341 | 8 342 | 0 343 | 62 344 | 256 345 | 370 346 | -1 347 | 6 348 | ByLayer 349 | 100 350 | AcDbEntity 351 | 100 352 | AcDbSpline 353 | 70 354 | 8 355 | 71 356 | 3 357 | 72 358 | 8 359 | 73 360 | 4 361 | 74 362 | 0 363 | 40 364 | 0 365 | 40 366 | 0 367 | 40 368 | 0 369 | 40 370 | 0 371 | 40 372 | 1 373 | 40 374 | 1 375 | 40 376 | 1 377 | 40 378 | 1 379 | 10 380 | 27.415873 381 | 20 382 | 13.707930 383 | 30 384 | 0 385 | 10 386 | 9.508201 387 | 20 388 | 25.103702 389 | 30 390 | 0 391 | 10 392 | 14.038074 393 | 20 394 | 36.820282 395 | 30 396 | 0 397 | 10 398 | 15.320635 399 | 20 400 | 45.961911 401 | 30 402 | 0 403 | 0 404 | SPLINE 405 | 5 406 | 43 407 | 8 408 | 0 409 | 62 410 | 256 411 | 370 412 | -1 413 | 6 414 | ByLayer 415 | 100 416 | AcDbEntity 417 | 100 418 | AcDbSpline 419 | 70 420 | 8 421 | 71 422 | 3 423 | 72 424 | 8 425 | 73 426 | 4 427 | 74 428 | 0 429 | 40 430 | 0 431 | 40 432 | 0 433 | 40 434 | 0 435 | 40 436 | 0 437 | 40 438 | 1 439 | 40 440 | 1 441 | 40 442 | 1 443 | 40 444 | 1 445 | 10 446 | 15.320635 447 | 20 448 | 45.961911 449 | 30 450 | 0 451 | 10 452 | 16.603196 453 | 20 454 | 55.103540 455 | 30 456 | 0 457 | 10 458 | 25.117487 459 | 20 460 | 64.544689 461 | 30 462 | 0 463 | 10 464 | 31.447619 465 | 20 466 | 67.733340 467 | 30 468 | 0 469 | 0 470 | LINE 471 | 8 472 | 2 473 | 62 474 | 4 475 | 10 476 | 31.447619 477 | 20 478 | 67.733340 479 | 30 480 | 0 481 | 11 482 | 31.447619 483 | 21 484 | 67.733340 485 | 31 486 | 0 487 | 0 488 | ENDSEC 489 | 0 490 | EOF 491 | 492 | -------------------------------------------------------------------------------- /dxf/LinieBlock.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/LinieBlock.JPG -------------------------------------------------------------------------------- /dxf/LinieBlock1-Meines.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/LinieBlock1-Meines.JPG -------------------------------------------------------------------------------- /dxf/LinieBlock1Turbocad.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/LinieBlock1Turbocad.JPG -------------------------------------------------------------------------------- /dxf/Spline_Problem.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | SPLINE 7 | 8 8 | 0 9 | 62 10 | 7 11 | 210 12 | 0.0 13 | 220 14 | 0.0 15 | 230 16 | 1.0 17 | 70 18 | 8 19 | 71 20 | 5 21 | 72 22 | 15 23 | 73 24 | 9 25 | 74 26 | 0 27 | 42 28 | 0.0 29 | 43 30 | 0.0 31 | 40 32 | 0.2960716011585239 33 | 40 34 | 0.2960716011585239 35 | 40 36 | 0.2960716011585239 37 | 40 38 | 0.2960716011585239 39 | 40 40 | 0.2960716011585239 41 | 40 42 | 0.2960716011585239 43 | 40 44 | 1.6062952070777794 45 | 40 46 | 1.6062952070777794 47 | 40 48 | 1.6062952070777794 49 | 40 50 | 3.2645918963599247 51 | 40 52 | 3.2645918963599247 53 | 40 54 | 3.2645918963599247 55 | 40 56 | 3.2645918963599247 57 | 40 58 | 3.2645918963599247 59 | 40 60 | 3.2645918963599247 61 | 10 62 | 121.09966679259503 63 | 20 64 | 76.381201705220676 65 | 30 66 | 0.0 67 | 10 68 | 121.07130091929682 69 | 20 70 | 76.112062323237495 71 | 30 72 | 0.0 73 | 10 74 | 121.01596396413595 75 | 20 76 | 75.854818935882179 77 | 30 78 | 0.0 79 | 10 80 | 120.9337369057566 81 | 20 82 | 75.609495682694771 83 | 30 84 | 0.0 85 | 10 86 | 120.68750998502378 87 | 20 88 | 75.08098045958657 89 | 30 90 | 0.0 91 | 10 92 | 120.31774104417886 93 | 20 94 | 74.617973420667496 95 | 30 96 | 0.0 97 | 10 98 | 120.077457479202 99 | 20 100 | 74.38120837456222 101 | 30 102 | 0.0 103 | 10 104 | 119.81327498839786 105 | 20 106 | 74.169254479215283 107 | 30 108 | 0.0 109 | 10 110 | 119.53223325674307 111 | 20 112 | 73.984210247874302 113 | 30 114 | 0.0 115 | 0 116 | ENDSEC 117 | 0 118 | EOF 119 | -------------------------------------------------------------------------------- /dxf/UAP_212718.dxf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/UAP_212718.dxf -------------------------------------------------------------------------------- /dxf/beispiel_wordart.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/beispiel_wordart.doc -------------------------------------------------------------------------------- /dxf/beispiel_wordart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/beispiel_wordart.pdf -------------------------------------------------------------------------------- /dxf/erin7.ngc: -------------------------------------------------------------------------------- 1 | (Generated with: dxf2gcode_b02, Version: TKINTER Beta 02, Date: 2009-11-16) 2 | (Time: Sat Feb 20 21:50:58 2010) 3 | (Created from file: /home/wortley/emc2/nc_files/XYZ/erin.dxf) 4 | G21 (Unit in mm) 5 | G90 (Absolute distance mode) 6 | G64 P0.01 (Exact Path 0.001 tol.) 7 | G17 8 | G40 (Cancel diameter comp.) 9 | G49 (Cancel length comp.) 10 | T1M6 (Tool change to T1) 11 | M8 (Coolant flood on) 12 | S5000M03 (Spindle 5000rpm cw) 13 | G0 Z 5.000 14 | G0 X 34.897 Y 51.222 15 | G0 Z 3.000 16 | F15 17 | G1 Z -1.500 18 | F100 19 | G1 X 32.030 Y 48.355 20 | G1 X 32.030 Y 42.620 21 | G1 X 34.897 Y 39.753 22 | G1 X 40.632 Y 39.753 23 | G1 X 43.499 Y 45.488 24 | G1 X 43.499 Y 51.222 25 | G1 X 40.632 Y 56.957 26 | G1 X 34.897 Y 59.824 27 | G1 X 26.295 Y 59.824 28 | G1 X 20.560 Y 56.957 29 | G1 X 17.693 Y 54.090 30 | G1 X 14.825 Y 48.355 31 | G1 X 14.825 Y 42.620 32 | G1 X 17.693 Y 36.885 33 | G1 X 23.427 Y 34.018 34 | G1 X 17.693 Y 34.018 35 | G1 X 9.090 Y 31.151 36 | G1 X 3.356 Y 25.416 37 | G1 X 0.488 Y 19.681 38 | G1 X 0.488 Y 11.079 39 | G1 X 3.356 Y 5.344 40 | G1 X 6.223 Y 2.477 41 | G1 X 11.958 Y -0.391 42 | G1 X 20.560 Y -0.391 43 | G1 X 29.162 Y 2.477 44 | G1 X 34.897 Y 8.212 45 | G1 X 37.764 Y 13.946 46 | G1 X 37.764 Y 19.681 47 | G1 X 34.897 Y 25.416 48 | G1 X 29.162 Y 25.416 49 | G1 X 23.427 Y 22.548 50 | G1 X 20.560 Y 16.814 51 | F15 52 | G1 Z -3.000 53 | F100 54 | G1 X 23.427 Y 22.548 55 | G1 X 29.162 Y 25.416 56 | G1 X 34.897 Y 25.416 57 | G1 X 37.764 Y 19.681 58 | G1 X 37.764 Y 13.946 59 | G1 X 34.897 Y 8.212 60 | G1 X 29.162 Y 2.477 61 | G1 X 20.560 Y -0.391 62 | G1 X 11.958 Y -0.391 63 | G1 X 6.223 Y 2.477 64 | G1 X 3.356 Y 5.344 65 | G1 X 0.488 Y 11.079 66 | G1 X 0.488 Y 19.681 67 | G1 X 3.356 Y 25.416 68 | G1 X 9.090 Y 31.151 69 | G1 X 17.693 Y 34.018 70 | G1 X 23.427 Y 34.018 71 | G1 X 17.693 Y 36.885 72 | G1 X 14.825 Y 42.620 73 | G1 X 14.825 Y 48.355 74 | G1 X 17.693 Y 54.090 75 | G1 X 20.560 Y 56.957 76 | G1 X 26.295 Y 59.824 77 | G1 X 34.897 Y 59.824 78 | G1 X 40.632 Y 56.957 79 | G1 X 43.499 Y 51.222 80 | G1 X 43.499 Y 45.488 81 | G1 X 40.632 Y 39.753 82 | G1 X 34.897 Y 39.753 83 | G1 X 32.030 Y 42.620 84 | G1 X 32.030 Y 48.355 85 | G1 X 34.897 Y 51.222 86 | G1 Z 3.000 87 | G0 Z 5.000 88 | G0 X 94.037 Y 2.477 89 | G0 Z 3.000 90 | F15 91 | G1 Z -1.500 92 | F100 93 | G1 X 85.435 Y -0.391 94 | G1 X 79.700 Y -0.391 95 | G1 X 76.832 Y 2.477 96 | G1 X 76.832 Y 8.212 97 | G1 X 79.700 Y 11.079 98 | G1 X 82.567 Y 8.212 99 | G1 X 79.700 Y 5.344 100 | F15 101 | G1 Z -3.000 102 | F100 103 | G1 X 82.567 Y 8.212 104 | G1 X 79.700 Y 11.079 105 | G1 X 76.832 Y 8.212 106 | G1 X 76.832 Y 2.477 107 | G1 X 79.700 Y -0.391 108 | G1 X 85.435 Y -0.391 109 | G1 X 94.037 Y 2.477 110 | G1 Z 3.000 111 | G0 Z 5.000 112 | G0 X 116.976 Y 56.957 113 | G0 Z 3.000 114 | F15 115 | G1 Z -1.500 116 | F100 117 | G1 X 114.108 Y 54.090 118 | G1 X 111.241 Y 48.355 119 | G1 X 105.506 Y 34.018 120 | G1 X 99.771 Y 16.814 121 | G1 X 96.904 Y 11.079 122 | G1 X 91.169 Y 2.477 123 | G1 X 85.435 Y -0.391 124 | G1 X 94.037 Y 2.477 125 | G1 X 99.771 Y 8.212 126 | G1 X 102.639 Y 13.946 127 | G1 X 105.506 Y 22.548 128 | G1 X 111.241 Y 45.488 129 | G1 X 114.108 Y 54.090 130 | G1 X 116.976 Y 56.957 131 | F15 132 | G1 Z -3.000 133 | F100 134 | G1 X 114.108 Y 54.090 135 | G1 X 111.241 Y 48.355 136 | G1 X 105.506 Y 34.018 137 | G1 X 99.771 Y 16.814 138 | G1 X 96.904 Y 11.079 139 | G1 X 91.169 Y 2.477 140 | G1 X 85.435 Y -0.391 141 | G1 X 94.037 Y 2.477 142 | G1 X 99.771 Y 8.212 143 | G1 X 102.639 Y 13.946 144 | G1 X 105.506 Y 22.548 145 | G1 X 111.241 Y 45.488 146 | G1 X 114.108 Y 54.090 147 | G1 X 116.976 Y 56.957 148 | G1 Z 3.000 149 | G0 Z 5.000 150 | G0 X 116.976 Y 31.151 151 | G0 Z 3.000 152 | F15 153 | G1 Z -1.500 154 | F100 155 | G1 X 108.374 Y 34.018 156 | G1 X 114.108 Y 31.151 157 | G1 X 116.976 Y 25.416 158 | G1 X 119.843 Y 5.344 159 | G1 X 125.578 Y -0.391 160 | G1 X 122.711 Y 5.344 161 | F15 162 | G1 Z -3.000 163 | F100 164 | G1 X 125.578 Y -0.391 165 | G1 X 119.843 Y 5.344 166 | G1 X 116.976 Y 25.416 167 | G1 X 114.108 Y 31.151 168 | G1 X 108.374 Y 34.018 169 | G1 X 116.976 Y 31.151 170 | G1 Z 3.000 171 | G0 Z 5.000 172 | G0 X 298.338 Y 11.079 173 | G0 Z 3.000 174 | F15 175 | G1 Z -1.500 176 | F100 177 | G1 X 295.470 Y -0.391 178 | F15 179 | G1 Z -3.000 180 | F100 181 | G1 X 298.338 Y 11.079 182 | G1 Z 3.000 183 | G0 Z 5.000 184 | G0 X 295.470 Y 13.946 185 | G0 Z 3.000 186 | F15 187 | G1 Z -1.500 188 | F100 189 | G1 X 295.470 Y -0.391 190 | G1 X 122.711 Y 59.824 191 | G1 X 128.445 Y 56.957 192 | G1 X 131.313 Y 51.222 193 | G1 X 131.313 Y 45.488 194 | G1 X 128.445 Y 39.753 195 | G1 X 125.578 Y 36.885 196 | G1 X 119.843 Y 34.018 197 | G1 X 108.374 Y 34.018 198 | F15 199 | G1 Z -3.000 200 | F100 201 | G1 X 295.470 Y -0.391 202 | G1 X 122.711 Y 59.824 203 | G1 X 128.445 Y 56.957 204 | G1 X 131.313 Y 51.222 205 | G1 X 131.313 Y 45.488 206 | G1 X 128.445 Y 39.753 207 | G1 X 125.578 Y 36.885 208 | G1 X 119.843 Y 34.018 209 | G1 X 108.374 Y 34.018 210 | G1 Z 3.000 211 | G0 Z 5.000 212 | G0 X 99.771 Y 42.620 213 | G0 Z 3.000 214 | F15 215 | G1 Z -1.500 216 | F100 217 | G1 X 96.904 Y 36.885 218 | G1 X 94.037 Y 34.018 219 | G1 X 88.302 Y 34.018 220 | G1 X 85.435 Y 36.885 221 | G1 X 85.435 Y 42.620 222 | G1 X 88.302 Y 48.355 223 | G1 X 94.037 Y 54.090 224 | G1 X 99.771 Y 56.957 225 | G1 X 108.374 Y 59.824 226 | G1 X 122.711 Y 59.824 227 | G1 X 131.313 Y 56.957 228 | G1 X 134.180 Y 51.222 229 | G1 X 134.180 Y 45.488 230 | G1 X 131.313 Y 39.753 231 | G1 X 128.445 Y 36.885 232 | G1 X 119.843 Y 34.018 233 | G1 X 108.374 Y 34.018 234 | G1 X 116.976 Y 31.151 235 | G1 X 119.843 Y 25.416 236 | G1 X 122.711 Y 5.344 237 | G1 X 125.578 Y -0.391 238 | G1 X 128.445 Y -0.391 239 | G1 X 134.180 Y 2.477 240 | G1 X 139.915 Y 8.212 241 | F15 242 | G1 Z -3.000 243 | F100 244 | G1 X 134.180 Y 2.477 245 | G1 X 128.445 Y -0.391 246 | G1 X 125.578 Y -0.391 247 | G1 X 122.711 Y 5.344 248 | G1 X 119.843 Y 25.416 249 | G1 X 116.976 Y 31.151 250 | G1 X 108.374 Y 34.018 251 | G1 X 119.843 Y 34.018 252 | G1 X 128.445 Y 36.885 253 | G1 X 131.313 Y 39.753 254 | G1 X 134.180 Y 45.488 255 | G1 X 134.180 Y 51.222 256 | G1 X 131.313 Y 56.957 257 | G1 X 122.711 Y 59.824 258 | G1 X 108.374 Y 59.824 259 | G1 X 99.771 Y 56.957 260 | G1 X 94.037 Y 54.090 261 | G1 X 88.302 Y 48.355 262 | G1 X 85.435 Y 42.620 263 | G1 X 85.435 Y 36.885 264 | G1 X 88.302 Y 34.018 265 | G1 X 94.037 Y 34.018 266 | G1 X 96.904 Y 36.885 267 | G1 X 99.771 Y 42.620 268 | G1 Z 3.000 269 | G0 Z 5.000 270 | G0 X 190.452 Y 2.477 271 | G0 Z 3.000 272 | F15 273 | G1 Z -1.500 274 | F100 275 | G1 X 181.850 Y -0.391 276 | G1 X 176.116 Y -0.391 277 | G1 X 173.248 Y 2.477 278 | G1 X 173.248 Y 8.212 279 | G1 X 176.116 Y 11.079 280 | G1 X 178.983 Y 8.212 281 | G1 X 176.116 Y 5.344 282 | F15 283 | G1 Z -3.000 284 | F100 285 | G1 X 178.983 Y 8.212 286 | G1 X 176.116 Y 11.079 287 | G1 X 173.248 Y 8.212 288 | G1 X 173.248 Y 2.477 289 | G1 X 176.116 Y -0.391 290 | G1 X 181.850 Y -0.391 291 | G1 X 190.452 Y 2.477 292 | G1 Z 3.000 293 | G0 Z 5.000 294 | G0 X 219.126 Y 42.620 295 | G0 Z 3.000 296 | F15 297 | G1 Z -1.500 298 | F100 299 | G1 X 213.392 Y 36.885 300 | G1 X 204.789 Y 34.018 301 | G1 X 196.187 Y 34.018 302 | G1 X 190.452 Y 36.885 303 | G1 X 187.585 Y 42.620 304 | G1 X 187.585 Y 48.355 305 | G1 X 190.452 Y 54.090 306 | G1 X 196.187 Y 56.957 307 | G1 X 207.657 Y 59.824 308 | G1 X 219.126 Y 59.824 309 | G1 X 213.392 Y 54.090 310 | G1 X 207.657 Y 45.488 311 | F15 312 | G1 Z -3.000 313 | F100 314 | G1 X 213.392 Y 54.090 315 | G1 X 219.126 Y 59.824 316 | G1 X 207.657 Y 59.824 317 | G1 X 196.187 Y 56.957 318 | G1 X 190.452 Y 54.090 319 | G1 X 187.585 Y 48.355 320 | G1 X 187.585 Y 42.620 321 | G1 X 190.452 Y 36.885 322 | G1 X 196.187 Y 34.018 323 | G1 X 204.789 Y 34.018 324 | G1 X 213.392 Y 36.885 325 | G1 X 219.126 Y 42.620 326 | G1 Z 3.000 327 | G0 Z 5.000 328 | G0 X 207.657 Y 45.488 329 | G0 Z 3.000 330 | F15 331 | G1 Z -1.500 332 | F100 333 | G1 X 213.392 Y 54.090 334 | G1 X 210.524 Y 48.355 335 | G1 X 204.789 Y 31.151 336 | G1 X 199.055 Y 13.946 337 | G1 X 196.187 Y 8.212 338 | G1 X 190.452 Y 2.477 339 | G1 X 181.850 Y -0.391 340 | G1 X 187.585 Y 2.477 341 | G1 X 193.320 Y 11.079 342 | G1 X 196.187 Y 16.814 343 | G1 X 201.922 Y 31.151 344 | G1 X 207.657 Y 45.488 345 | F15 346 | G1 Z -3.000 347 | F100 348 | G1 X 213.392 Y 54.090 349 | G1 X 210.524 Y 48.355 350 | G1 X 204.789 Y 31.151 351 | G1 X 199.055 Y 13.946 352 | G1 X 196.187 Y 8.212 353 | G1 X 190.452 Y 2.477 354 | G1 X 181.850 Y -0.391 355 | G1 X 187.585 Y 2.477 356 | G1 X 193.320 Y 11.079 357 | G1 X 196.187 Y 16.814 358 | G1 X 201.922 Y 31.151 359 | G1 X 207.657 Y 45.488 360 | G1 Z 3.000 361 | G0 Z 5.000 362 | G0 X 255.327 Y 5.344 363 | G0 Z 3.000 364 | F15 365 | G1 Z -1.500 366 | F100 367 | G1 X 258.194 Y 8.212 368 | G1 X 255.327 Y 11.079 369 | G1 X 252.460 Y 8.212 370 | G1 X 252.460 Y 2.477 371 | G1 X 255.327 Y -0.391 372 | G1 X 261.062 Y -0.391 373 | G1 X 266.797 Y 2.477 374 | G1 X 272.531 Y 11.079 375 | G1 X 275.399 Y 16.814 376 | G1 X 281.133 Y 31.151 377 | G1 X 286.868 Y 48.355 378 | G1 X 289.736 Y 59.824 379 | G1 X 289.736 Y 45.488 380 | G1 X 292.603 Y 13.946 381 | G1 X 295.470 Y -0.391 382 | G1 X 26.295 Y 59.824 383 | G1 X 20.560 Y 54.090 384 | G1 X 17.693 Y 48.355 385 | G1 X 17.693 Y 39.753 386 | G1 X 23.427 Y 34.018 387 | G1 X 17.693 Y 36.885 388 | G1 X 304.073 Y 28.283 389 | G1 X 309.807 Y 42.620 390 | G1 X 312.675 Y 48.355 391 | G1 X 318.409 Y 56.957 392 | G1 X 324.144 Y 59.824 393 | G1 X 329.879 Y 59.824 394 | G1 X 332.746 Y 56.957 395 | G1 X 332.746 Y 54.090 396 | G1 X 329.879 Y 51.222 397 | G1 X 327.012 Y 54.090 398 | G1 X 329.879 Y 56.957 399 | F15 400 | G1 Z -3.000 401 | F100 402 | G1 X 327.012 Y 54.090 403 | G1 X 329.879 Y 51.222 404 | G1 X 332.746 Y 54.090 405 | G1 X 332.746 Y 56.957 406 | G1 X 329.879 Y 59.824 407 | G1 X 324.144 Y 59.824 408 | G1 X 318.409 Y 56.957 409 | G1 X 312.675 Y 48.355 410 | G1 X 309.807 Y 42.620 411 | G1 X 304.073 Y 28.283 412 | G1 X 298.338 Y 11.079 413 | G1 X 23.427 Y 34.018 414 | G1 X 17.693 Y 39.753 415 | G1 X 17.693 Y 48.355 416 | G1 X 20.560 Y 54.090 417 | G1 X 26.295 Y 59.824 418 | G1 X 20.560 Y 56.957 419 | G1 X 292.603 Y 13.946 420 | G1 X 289.736 Y 45.488 421 | G1 X 289.736 Y 59.824 422 | G1 X 286.868 Y 48.355 423 | G1 X 281.133 Y 31.151 424 | G1 X 275.399 Y 16.814 425 | G1 X 272.531 Y 11.079 426 | G1 X 266.797 Y 2.477 427 | G1 X 261.062 Y -0.391 428 | G1 X 255.327 Y -0.391 429 | G1 X 252.460 Y 2.477 430 | G1 X 252.460 Y 8.212 431 | G1 X 255.327 Y 11.079 432 | G1 X 258.194 Y 8.212 433 | G1 X 255.327 Y 5.344 434 | G1 Z 3.000 435 | G0 Z 5.000 436 | G0 X 289.736 Y 45.488 437 | G0 Z 3.000 438 | F15 439 | G1 Z -1.500 440 | F100 441 | G1 X 289.736 Y 59.824 442 | G1 X 292.603 Y 45.488 443 | G1 X 295.470 Y 13.946 444 | G1 X 295.470 Y -0.391 445 | G1 X 17.693 Y 34.018 446 | G1 X 11.958 Y 31.151 447 | G1 X 6.223 Y 25.416 448 | G1 X 3.356 Y 19.681 449 | G1 X 3.356 Y 8.212 450 | G1 X 6.223 Y 2.477 451 | G1 X 11.958 Y -0.391 452 | F15 453 | G1 Z -3.000 454 | F100 455 | G1 X 6.223 Y 2.477 456 | G1 X 3.356 Y 8.212 457 | G1 X 3.356 Y 19.681 458 | G1 X 6.223 Y 25.416 459 | G1 X 11.958 Y 31.151 460 | G1 X 17.693 Y 34.018 461 | G1 X 9.090 Y 31.151 462 | G1 X 295.470 Y 13.946 463 | G1 X 292.603 Y 45.488 464 | G1 X 289.736 Y 59.824 465 | G1 X 289.736 Y 45.488 466 | G1 Z 3.000 467 | G0 Z 5.000 468 | G0 X 0.000 Y 0.000 469 | M9 (Coolant off) 470 | M5 (Spindle off) 471 | M2 (Prgram end) -------------------------------------------------------------------------------- /dxf/fr%E4sen_test_02 2004.dxf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/fr%E4sen_test_02 2004.dxf -------------------------------------------------------------------------------- /dxf/fr�sen_test_02 2004.dxf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/fr�sen_test_02 2004.dxf -------------------------------------------------------------------------------- /dxf/lines_through_cutting_depth1.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/lines_through_cutting_depth1.dat -------------------------------------------------------------------------------- /dxf/lines_through_cutting_depth2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/lines_through_cutting_depth2.png -------------------------------------------------------------------------------- /dxf/print.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/print.pdf -------------------------------------------------------------------------------- /dxf/pstoedit_test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/dxf/pstoedit_test.pdf -------------------------------------------------------------------------------- /links/DXF2GCODE Webpage.URL: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=http://www.christian-kohloeffel.homepage.t-online.de/dxf2gocde.html#mozTocId700862 3 | -------------------------------------------------------------------------------- /python_examples/Ellipse_BiArc/BIARC_TEST.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/Ellipse_BiArc/BIARC_TEST.py -------------------------------------------------------------------------------- /python_examples/Ellipse_BiArc/clsBiArc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/Ellipse_BiArc/clsBiArc.py -------------------------------------------------------------------------------- /python_examples/Ellipse_BiArc/clsEllipse.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/Ellipse_BiArc/clsEllipse.py -------------------------------------------------------------------------------- /python_examples/Ellipse_BiArc/clsGeometrie.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/Ellipse_BiArc/clsGeometrie.py -------------------------------------------------------------------------------- /python_examples/Ellipse_BiArc/test.bat: -------------------------------------------------------------------------------- 1 | python BIARC_TEST.py 2 | @pause -------------------------------------------------------------------------------- /python_examples/Ellipse_fitting_by_Biarc_curves.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/Ellipse_fitting_by_Biarc_curves.py -------------------------------------------------------------------------------- /python_examples/GridDemo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2.4 2 | 3 | """ 4 | A simple demo to show how to do grids 5 | 6 | """ 7 | 8 | import wx 9 | 10 | 11 | try: 12 | # See if there is a local copy 13 | import sys 14 | sys.path.append("../") 15 | from floatcanvas import NavCanvas, FloatCanvas 16 | except ImportError: 17 | from wx.lib.floatcanvas import NavCanvas, FloatCanvas 18 | 19 | class DrawFrame(wx.Frame): 20 | 21 | """ 22 | A frame used for the FloatCanvas Demo 23 | 24 | """ 25 | 26 | def __init__(self, *args, **kwargs): 27 | wx.Frame.__init__(self, *args, **kwargs) 28 | 29 | self.CreateStatusBar() 30 | 31 | # Add the Canvas 32 | Canvas = NavCanvas.NavCanvas(self,-1, 33 | size = (500,500), 34 | ProjectionFun = None, 35 | Debug = 0, 36 | BackgroundColor = "DARK SLATE BLUE", 37 | ).Canvas 38 | 39 | 40 | Point = (45,40) 41 | Box = Canvas.AddCircle(Point, 42 | Diameter = 10, 43 | FillColor = "Black", 44 | LineColor = "Red", 45 | LineWidth = 6) 46 | 47 | # Crosses: 48 | Grid = FloatCanvas.DotGrid( Spacing=(1, .5), Size=2, Color="Cyan", Cross=True, CrossThickness=2) 49 | #Dots: 50 | #Grid = FloatCanvas.DotGrid( (0.5, 1), Size=3, Color="Red") 51 | 52 | Canvas.GridUnder = Grid 53 | #Canvas.GridOver = Grid 54 | 55 | FloatCanvas.EVT_MOTION(Canvas, self.OnMove ) 56 | 57 | self.Show() 58 | Canvas.ZoomToBB() 59 | 60 | def OnMove(self, event): 61 | """ 62 | Updates the status bar with the world coordinates 63 | 64 | """ 65 | self.SetStatusText("%.2f, %.2f"%tuple(event.Coords)) 66 | 67 | 68 | 69 | app = wx.App(False) # true to get its own output window. 70 | F = DrawFrame(None, title="FloatCanvas Demo App", size=(700,700) ) 71 | app.MainLoop() 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /python_examples/Kegelstump_Abwicklung_2dxf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/Kegelstump_Abwicklung_2dxf.py -------------------------------------------------------------------------------- /python_examples/NURBS_fitting_by_Biarc_curves.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/NURBS_fitting_by_Biarc_curves.py -------------------------------------------------------------------------------- /python_examples/NURBS_fitting_by_Biarc_curves_wx.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/NURBS_fitting_by_Biarc_curves_wx.py -------------------------------------------------------------------------------- /python_examples/canvas_sample.py: -------------------------------------------------------------------------------- 1 | import wx, sys, time, threading 2 | from wx.lib.floatcanvas.FloatCanvas import FloatCanvas 3 | from wx.lib.floatcanvas.GUIMode import GUIMove 4 | 5 | 6 | myEVT_PRINT = wx.NewEventType() 7 | EVT_PRINT = wx.PyEventBinder(myEVT_PRINT, 1) 8 | class PrintEvent(wx.PyCommandEvent): 9 | def __init__(self,message): 10 | wx.PyCommandEvent.__init__(self, myEVT_PRINT, wx.ID_ANY) 11 | self._message = message 12 | 13 | def GetMessage(self): 14 | return self._message 15 | 16 | 17 | class Renderer: 18 | def __init__(self,parent): 19 | self.parent = parent 20 | self.requests = [] 21 | self.counter = 0 22 | self.running = True 23 | threading.Thread(target=self.render).start() 24 | 25 | def MakeRequest(self): 26 | self.requests.append(None) 27 | 28 | def render(self): 29 | while self.running: 30 | if self.requests: 31 | request = self.requests.pop(0) 32 | # Make the CPU work 33 | for i in range(100000): pass 34 | self.counter += 1 35 | wx.PostEvent(self.parent.log,PrintEvent("%s\n"%self.counter)) 36 | else: 37 | time.sleep(.01) 38 | 39 | 40 | class MyTextCtrl(wx.TextCtrl): 41 | def __init__(self,parent): 42 | wx.TextCtrl.__init__(self,parent,-1,style = wx.TE_MULTILINE) 43 | sys.stdout = self 44 | self.Bind(EVT_PRINT, self.OnPrint) 45 | 46 | def OnPrint(self,e): 47 | self.AppendText(e.GetMessage()) 48 | 49 | 50 | class MyCanvas(FloatCanvas): 51 | def __init__(self, parent): 52 | self.parent = parent 53 | FloatCanvas.__init__(self, parent, BackgroundColor="BLACK") 54 | self.circles = [] 55 | self.GUIMode = GUICustom(self) 56 | 57 | def UpdateCircles(self, coord): 58 | self.RemoveObjects(self.circles) 59 | self.circles = [] 60 | for i in range(25): 61 | self.circles.append(self.AddCircle((coord[0]+i%5*5,coord[1]+i), 62 | Diameter=10,LineColor="White")) 63 | 64 | class GUICustom(GUIMove): 65 | def OnLeftDown(self,e): 66 | self.starttime = time.time() 67 | 68 | def OnLeftUp(self,e): 69 | return 70 | 71 | def OnMove(self,e): 72 | if e.LeftIsDown() and e.Dragging(): 73 | # Uncomment these lines to see the fix 74 | ## t = time.time() 75 | ## if t - self.starttime < .05: 76 | ## return 77 | ## self.starttime = t 78 | self.Canvas.UpdateCircles(self.Canvas.PixelToWorld(e.GetPosition())) 79 | self.Canvas.parent.renderer.MakeRequest() 80 | self.Canvas.Draw() 81 | 82 | 83 | class TestFrame(wx.Frame): 84 | def __init__(self,parent,id): 85 | wx.Frame.__init__(self,parent,id,"Test App") 86 | self.renderer = Renderer(self) 87 | self.log = MyTextCtrl(self) 88 | self.Canvas = MyCanvas(self) 89 | 90 | sizer = wx.BoxSizer() 91 | sizer.Add(self.Canvas,3,wx.EXPAND) 92 | sizer.Add(self.log,1,wx.EXPAND) 93 | self.SetSizer(sizer) 94 | 95 | self.Bind(wx.EVT_CLOSE,self.OnExit) 96 | self.Show(True) 97 | 98 | def OnExit(self,e): 99 | self.renderer.running = False 100 | self.Destroy() 101 | 102 | app = wx.App() 103 | frame = TestFrame(None,wx.ID_ANY) 104 | app.MainLoop() 105 | -------------------------------------------------------------------------------- /python_examples/customtreectrl.py: -------------------------------------------------------------------------------- 1 | import wx, wx.lib.customtreectrl as CT 2 | 3 | class MainWindow(wx.Frame): 4 | def __init__(self, parent, id, title): 5 | wx.Frame.__init__(self,parent,wx.ID_ANY, title, size=(600, 600), pos=(200, 200)) 6 | 7 | self.splitter_window = wx.SplitterWindow(self, -1, style=wx.SP_3D|wx.SP_BORDER) 8 | self.splitter_window.SetMinimumPaneSize(20) 9 | self.left_panel = wx.Panel(self.splitter_window, -1) 10 | self.right_panel = wx.Panel(self.splitter_window, -1) 11 | 12 | self.tree = CT.CustomTreeCtrl(self.left_panel, 1002, pos=(0, 0), 13 | style=wx.TR_DEFAULT_STYLE | 14 | wx.TR_HAS_VARIABLE_ROW_HEIGHT | 15 | wx.TR_HAS_BUTTONS | 16 | wx.TR_FULL_ROW_HIGHLIGHT | 17 | wx.TR_MULTIPLE | 18 | wx.TR_EDIT_LABELS) 19 | self.root = self.tree.AddRoot("Root Item") 20 | 21 | offset_lists = ["Clearance Reports", "Other Offsets"] 22 | offset_list_combo_box = wx.ComboBox(self.right_panel, -1, choices=offset_lists) 23 | 24 | #Sizers 25 | offset_sizer = wx.BoxSizer(wx.VERTICAL) 26 | offset_sizer.Add(offset_list_combo_box, 0, wx.EXPAND) 27 | vbox = wx.BoxSizer(wx.VERTICAL) 28 | vbox.Add(self.tree, 1, wx.EXPAND) 29 | self.left_panel.SetSizer(vbox) 30 | vbox2 = wx.BoxSizer(wx.VERTICAL) 31 | vbox2.Add(offset_sizer, 1, wx.EXPAND) 32 | self.right_panel.SetSizer(vbox2) 33 | main_sizer = wx.BoxSizer(wx.HORIZONTAL) 34 | self.splitter_window.SplitVertically(self.left_panel, self.right_panel) 35 | main_sizer.Add(self.splitter_window, 1, wx.EXPAND) 36 | self.SetSizer(main_sizer) 37 | 38 | self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnEndLabelEdit) 39 | self.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnBeginLabelEdit) 40 | self.Bind(wx.EVT_KEY_DOWN, self.enterpressed) 41 | self.tree.Bind(wx.EVT_KEY_DOWN, self.enterpressed) 42 | self.Bind(wx.EVT_KEY_DOWN, self.enterpressed, self.tree) 43 | self.Bind(wx.EVT_COMMAND_ENTER, self.enterpressed) 44 | self.Bind(wx.EVT_TEXT_ENTER, self.enterpressed) 45 | 46 | self.Show(True) 47 | 48 | def OnBeginLabelEdit(self, event): 49 | pass 50 | def OnEndLabelEdit(self, event): 51 | text = self.tree.GetEditControl().GetValue() 52 | item_being_edited = self.tree.GetSelection() 53 | self.tree.SetItemText(item_being_edited, text) 54 | def enterpressed(self, event): 55 | print "pressed enter" 56 | 57 | app = wx.PySimpleApp() 58 | frame = MainWindow(None, -1, "Test") 59 | app.MainLoop() -------------------------------------------------------------------------------- /python_examples/gtk/animationrotation.py: -------------------------------------------------------------------------------- 1 | ## cairo demos Copyright (C) 2007 Donn.C.Ingle 2 | ## 3 | ## Contact: donn.ingle@gmail.com - I hope this email lasts. 4 | ## 5 | ## This program is free software; you can redistribute it and/or modify 6 | ## it under the terms of the GNU General Public License as published by 7 | ## the Free Software Foundation; either version 2 of the License, or 8 | ## ( at your option ) any later version. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU General Public License 16 | ## along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | import pygtk 20 | import gtk, gobject, cairo 21 | from gtk import gdk 22 | 23 | class Screen( gtk.DrawingArea ): 24 | """ This class is a Drawing Area""" 25 | def __init__( self, w, h, speed ): 26 | super( Screen, self ).__init__( ) 27 | ## Old fashioned way to connect expose. I don't savvy the gobject stuff. 28 | self.connect ( "expose_event", self.do_expose_event ) 29 | ## We want to know where the mouse is: 30 | self.connect ( "motion_notify_event", self._mouseMoved ) 31 | ## More GTK voodoo : unmask events 32 | self.add_events ( gdk.BUTTON_PRESS_MASK | gdk.BUTTON_RELEASE_MASK | gdk.POINTER_MOTION_MASK ) 33 | ## This is what gives the animation life! 34 | gobject.timeout_add( speed, self.tick ) # Go call tick every 'speed' whatsits. 35 | self.width, self.height = w, h 36 | self.set_size_request ( w, h ) 37 | self.x, self.y = 11110,11111110 #unlikely first coord to prevent false hits. 38 | 39 | def tick ( self ): 40 | """This invalidates the screen, causing the expose event to fire.""" 41 | self.alloc = self.get_allocation ( ) 42 | rect = gtk.gdk.Rectangle ( self.alloc.x, self.alloc.y, self.alloc.width, self.alloc.height ) 43 | self.window.invalidate_rect ( rect, True ) 44 | return True # Causes timeout to tick again. 45 | 46 | ## When expose event fires, this is run 47 | def do_expose_event( self, widget, event ): 48 | self.cr = self.window.cairo_create( ) 49 | ## Call our draw function to do stuff. 50 | self.draw( ) 51 | 52 | def _mouseMoved ( self, widget, event ): 53 | self.x = event.x 54 | self.y = event.y 55 | 56 | class BunchOfStuff ( object ): 57 | """Stores a bunch of data""" 58 | def __init__ ( self, x=0, y=0, rx=0, ry=0, rot=0, sx=1, sy=1 ): 59 | self.x = x 60 | self.y = y 61 | self.rx = rx 62 | self.ry = ry 63 | self.rot = rot 64 | self.sx = sx 65 | self.sy = sy 66 | 67 | class MyStuff ( Screen ): 68 | """This class is also a Drawing Area, coming from Screen.""" 69 | def __init__ ( self, w, h, speed): 70 | Screen.__init__( self, w, h, speed ) 71 | 72 | ## Setup three sets of data for the three objects to be drawn 73 | self.red = BunchOfStuff ( x=50, y=-10, rx=50, ry=25 ) 74 | self.green = BunchOfStuff ( x=-10, y=10 ) 75 | self.blue = BunchOfStuff ( x=-70,y=30, sx=1, sy=1 ) 76 | 77 | self.sign = +1 # to flip the blue animation's sign 78 | 79 | def setToCenter ( self ): 80 | """Shift 0,0 to be in the center of page.""" 81 | matrix = cairo.Matrix ( 1, 0, 0, 1, self.width/2, self.height/2 ) 82 | self.cr.transform ( matrix ) # Make it so... 83 | 84 | def doMatrixVoodoo ( self, bos ): 85 | """Do all the matrix mumbo to get stuff to the right place on the screen.""" 86 | ThingMatrix =cairo.Matrix ( 1, 0, 0, 1, 0, 0 ) 87 | ## Next, move the drawing to it's x,y 88 | cairo.Matrix.translate ( ThingMatrix, bos.x, bos.y ) 89 | self.cr.transform ( ThingMatrix ) # Changes the context to reflect that 90 | ## Now, change the matrix again to: 91 | if bos.rx != 0 and bos.ry != 0 : # Only do this if there's a special reason 92 | cairo.Matrix.translate( ThingMatrix, bos.rx, bos.ry ) # move it all to point of rotation 93 | cairo.Matrix.rotate( ThingMatrix, bos.rot ) # Do the rotation 94 | if bos.rx != 0 and bos.ry != 0 : 95 | cairo.Matrix.translate( ThingMatrix, -bos.rx, -bos.ry ) # move it back again 96 | cairo.Matrix.scale( ThingMatrix, bos.sx, bos.sy ) # Now scale it all 97 | self.cr.transform ( ThingMatrix ) # and commit it to the context 98 | 99 | def draw( self ): 100 | cr = self.cr # Shabby shortcut. 101 | 102 | #---------TOP LEVEL - THE "PAGE" 103 | self.cr.identity_matrix ( ) # VITAL LINE :: I'm not sure what it's doing. 104 | self.setToCenter ( ) 105 | 106 | #----------FIRST LEVEL 107 | cr.save ( ) # Creates a 'bubble' of private coordinates. Save # 1 108 | 109 | ## RED - draw the red object 110 | self.doMatrixVoodoo ( self.red ) 111 | self.drawCairoStuff ( self.red ) 112 | 113 | #---------- SECOND LEVEL - RELATIVE TO FIRST 114 | cr.save ( ) #save 2 115 | 116 | ## GREEN - draw the green one 117 | self.doMatrixVoodoo ( self.green ) 118 | self.drawCairoStuff ( self.green, col= ( 0,1,0 ) ) 119 | 120 | ## Demonstrate how to detect a mouse hit on this shape: 121 | ## Draw the hit shape :: It *should* be drawn exactly over the green rectangle. 122 | self.drawHitShape ( ) 123 | cr.save ( ) # Start a bubble 124 | cr.identity_matrix ( ) # Reset the matrix within it. 125 | hit = cr.in_fill ( self.x, self.y ) # Use Cairo's built-in hit test 126 | cr.new_path ( ) # stops the hit shape from being drawn 127 | cr.restore ( ) # Close the bubble like this never happened. 128 | 129 | 130 | cr.restore ( ) #restore 2 :: "pop" the bubble. 131 | 132 | ## We are in level one's influence now 133 | 134 | cr.restore ( ) #restore 1 135 | ## Back on PAGE's influence now 136 | 137 | #-------- THIRD LEVEL -- RELATIVE TO PAGE 138 | cr.save ( ) # Creates a 'bubble' of private coordinates. 139 | ## Draw the blue object 140 | self.doMatrixVoodoo ( self.blue ) # within the bubble, this will not effect the PAGE 141 | self.drawCairoStuff ( self.blue, col= ( 0,0,1 ) ) 142 | cr.restore ( ) 143 | 144 | ## Back on the PAGE level again. 145 | 146 | #indicate center 147 | self.drawCrosshair ( ) 148 | self.guageScale ( ) 149 | 150 | ## Let's animate the red object 151 | ## ( which *also* moves the green because it's a 'child' 152 | ## of the red by way of being in the same "bubble" ) 153 | self.red.rot += 0.01 154 | ## Now animate the blue 155 | self.blue.sx += self.sign * 0.1 156 | if self.blue.sx < 0 or self.blue.sx > 4: 157 | self.sign *= -1 158 | self.blue.sy = self.blue.sx 159 | 160 | ## Print to the console -- low-tech special effects :) 161 | if hit: print "HIT!", self.x, self.y 162 | 163 | def guageScale ( self ): 164 | """Draw some axis so we can see where stuff is.""" 165 | c = self.cr 166 | m = 0 167 | for x in range ( 10,210,10 ): 168 | m += 1 169 | w = 10 + ( m % 2 * 10 ) 170 | if x == 100: w = 50 171 | c.rectangle ( x,-w/2,1,w ) 172 | c.rectangle ( -x, -w/2, 1, w ) 173 | c.rectangle ( -w/2, x, w, 1 ) 174 | c.rectangle ( -w/2, -x , w, 1 ) 175 | c.set_source_rgb ( 0,0,0 ) 176 | c.fill ( ) 177 | 178 | def drawCairoStuff ( self, bos, col= ( 1,0,0 ) ): 179 | """This draws the squares we see. Pass it a BagOfStuff (bos) and a colour.""" 180 | cr = self.cr 181 | ## Thrillingly, we draw a rectangle. 182 | ## It's drawn such that 0,0 is in it's center. 183 | cr.rectangle( -25, -25, 50, 50 ) 184 | cr.set_source_rgb( col[0],col[1],col[2] ) 185 | cr.fill( ) 186 | ## Now draw an axis 187 | self.guageScale ( ) 188 | ## Now a visual indicator of the point of rotation 189 | cr.set_source_rgb( 1,1,1 ) 190 | cr.rectangle ( bos.rx - 2, bos.ry - 2, 4, 4 ) 191 | cr.fill ( ) 192 | 193 | ## Same as the rectangle we see. No fill. 194 | def drawHitShape ( self ): 195 | """Draws a shape that we'll use to test hits.""" 196 | self.cr.rectangle( -25, -25, 50, 50 ) # Same as the shape of the squares 197 | 198 | def drawCrosshair ( self ): 199 | """Another visual aid.""" 200 | ctx = self.cr 201 | ctx.set_source_rgb ( 0, 0, 0 ) 202 | ctx.move_to ( 0,10 ) 203 | ctx.line_to ( 0, -10 ) 204 | ctx.move_to ( -10, 0 ) 205 | ctx.line_to ( 10, 0 ) 206 | ctx.stroke ( ) 207 | 208 | 209 | def run( Widget, w, h, speed ): 210 | window = gtk.Window( ) 211 | window.connect( "delete-event", gtk.main_quit ) 212 | widget = Widget( w, h, speed ) 213 | widget.show( ) 214 | window.add( widget ) 215 | window.present( ) 216 | gtk.main( ) 217 | 218 | run( MyStuff, 400, 400, speed = 20 ) 219 | -------------------------------------------------------------------------------- /python_examples/gtk/filesel.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # example filesel.py 4 | 5 | import pygtk 6 | pygtk.require('2.0') 7 | import gtk 8 | 9 | class FileSelectionExample: 10 | # Get the selected filename and print it to the console 11 | def file_ok_sel(self, w): 12 | print "%s" % self.filew.get_filename() 13 | 14 | def destroy(self, widget): 15 | gtk.main_quit() 16 | 17 | def __init__(self): 18 | # Create a new file selection widget 19 | self.filew = gtk.FileSelection("File selection") 20 | 21 | self.filew.connect("destroy", self.destroy) 22 | # Connect the ok_button to file_ok_sel method 23 | self.filew.ok_button.connect("clicked", self.file_ok_sel) 24 | 25 | # Connect the cancel_button to destroy the widget 26 | self.filew.cancel_button.connect("clicked", 27 | lambda w: self.filew.destroy()) 28 | 29 | # Lets set the filename, as if this were a save dialog, 30 | # and we are giving a default filename 31 | self.filew.set_filename("penguin.png") 32 | 33 | self.filew.show() 34 | 35 | def main(): 36 | gtk.main() 37 | return 0 38 | 39 | if __name__ == "__main__": 40 | FileSelectionExample() 41 | main() 42 | -------------------------------------------------------------------------------- /python_examples/gtk/make_exe.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os, sys 4 | import subprocess 5 | 6 | pyinpfad = "C:\Python26\pyinstaller-1.4" 7 | 8 | pyt = "C:/Python26/pythonw.exe" 9 | filepfad= os.path.realpath(os.path.dirname(sys.argv[0])) 10 | exemakepfad=filepfad 11 | file = "animationrotation" 12 | icon= "%s/DXF2GCODE-001.ico" %filepfad 13 | 14 | options=("--onefile --noconsole --upx --tk") #--icon=%s" %icon) 15 | print options 16 | 17 | #Verzwichniss wechseln 18 | exemakepfad = unicode( exemakepfad, "utf-8" ) 19 | os.chdir(exemakepfad.encode( "utf-8" )) 20 | 21 | 22 | cmd=("%s %s\Makespec.py %s %s/%s.py" %(pyt,pyinpfad,options,filepfad,file)) 23 | print cmd 24 | retcode=subprocess.call(cmd) 25 | 26 | cmd=("%s %s\Build.py %s\%s.spec" %(pyt,pyinpfad,exemakepfad,file)) 27 | print cmd 28 | retcode=subprocess.call(cmd) 29 | 30 | print "\n!!!!!!!Bitmaps und Languagues Ordner nicht vergessen!!!!!!" 31 | print "\nFertig" -------------------------------------------------------------------------------- /python_examples/gtk/polyline_hit_inside.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | ## hittest Copyright (C) 2007 Donn.C.Ingle 4 | ## 5 | ## Contact: donn.ingle@gmail.com - I hope this email lasts. 6 | ## 7 | ## This program is free software; you can redistribute it and/or modify 8 | ## it under the terms of the GNU General Public License as published by 9 | ## the Free Software Foundation; either version 2 of the License, or 10 | ## ( at your option ) any later version. 11 | ## 12 | ## This program is distributed in the hope that it will be useful, 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ## GNU General Public License for more details. 16 | ## 17 | ## You should have received a copy of the GNU General Public License 18 | ## along with this program; if not, write to the Free Software 19 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | ## 21 | 22 | import pygtk 23 | #pygtk.require('2.0') 24 | import gtk 25 | import gobject 26 | import cairo 27 | from gtk import gdk 28 | 29 | # Create a GTK+ widget on which we will draw using Cairo 30 | class Screen(gtk.DrawingArea): 31 | 32 | # Draw in response to an expose-event 33 | __gsignals__ = { "expose-event": "override" } 34 | 35 | def __init__(self): 36 | super(Screen,self).__init__() 37 | # gtk.Widget signals 38 | self.connect("button_press_event", self.button_press) 39 | self.connect("button_release_event", self.button_release) 40 | self.connect("motion_notify_event", self.motion_notify) 41 | # More GTK voodoo : unmask events 42 | self.add_events(gdk.BUTTON_PRESS_MASK | 43 | gdk.BUTTON_RELEASE_MASK | 44 | gdk.POINTER_MOTION_MASK) 45 | 46 | # Handle the expose-event by drawing 47 | def do_expose_event(self, event): 48 | 49 | # Create the cairo context 50 | cr = self.window.cairo_create() 51 | self.hitpath = None #Is set later 52 | 53 | # Restrict Cairo to the exposed area; avoid extra work 54 | cr.rectangle(event.area.x, event.area.y, 55 | event.area.width, event.area.height) 56 | cr.clip() 57 | 58 | self.draw(cr, *self.window.get_size()) 59 | 60 | def makeHitPath(self,cairopath): 61 | ## Make a simpler list of tuples 62 | 63 | ## Internally, a cairo path looks like this: 64 | ## (0, (10.0, 10.0)) 65 | ## (1, (60.0, 10.0)) 66 | ## (1, (60.0, 60.0)) 67 | ## (1, (35.0, 60.0)) 68 | ## (1, (35.0, 35.0)) 69 | ## (1, (10.0, 35.0)) 70 | ## (1, (10.0, 60.0)) 71 | ## (1, (-40.0, 60.0)) 72 | ## (3, ()) #want to ignore this one 73 | ## (0, (10.0, 10.0)) 74 | 75 | self.hitpath = [] 76 | for sub in cairopath: 77 | if sub[1]: #kick out the close path () empty tuple 78 | self.hitpath.append(sub[1]) #list of tuples 79 | 80 | def draw(self, cr, width, height): 81 | # Fill the background with gray 82 | cr.set_source_rgb(0.5, 0.5, 0.5) 83 | cr.rectangle(0, 0, width, height) 84 | cr.fill() 85 | 86 | def hitTest(self,*p): 87 | ## Code lifted from http://local.wasp.uwa.edu.au/~pbourke/geometry/insidepoly/ 88 | ## converted to Python. I won't pretend I grok it at all, just glad it works! 89 | ## Not sure how well it works yet, it might have edge flaws. 90 | px = p[0] 91 | py = p[1] 92 | counter = i = xinters = 0 93 | p1 = p2 = () 94 | 95 | p1 = self.hitpath[0] 96 | N = len(self.hitpath) 97 | 98 | # Mathemagic loop-de-loop 99 | for i in range(0,N): 100 | p2 = self.hitpath[i % N] 101 | if py > min( p1[1] , p2[1] ): 102 | if py <= max( p1[1], p2[1] ): 103 | if px <= max( p1[0], p2[0] ): 104 | if p1[1] != p2[1]: 105 | xinters = ( py - p1[1] ) * ( p2[0] - p1[0] ) / ( p2[1] - p1[1] ) + p1[0] 106 | if p1[0] == p2[0] or px <= xinters: counter += 1 107 | p1 = p2 108 | 109 | if counter % 2 == 0: 110 | return "outside" 111 | return "inside" 112 | 113 | def button_press(self,widget,event): 114 | pass 115 | def button_release(self,widget,event): 116 | pass 117 | def motion_notify(self,widget,event): 118 | pass 119 | 120 | # GTK mumbo-jumbo to show the widget in a window and quit when it's closed 121 | def run(Widget): 122 | window = gtk.Window() 123 | window.connect("delete-event", gtk.main_quit) 124 | widget = Widget() 125 | widget.show() 126 | window.add(widget) 127 | window.present() 128 | gtk.main() 129 | 130 | class Shapes(Screen): 131 | #Override the press event 132 | def button_press(self,widget,event): 133 | print self.hitTest(event.x, event.y) 134 | 135 | def draw(self, cr, width, height): 136 | x = y = 10 137 | sx = sy = 50 138 | cr.move_to(x,y) 139 | cr.line_to(x+sx,y) 140 | cr.line_to(x+sx,y+sy) 141 | cr.line_to(x+(sx/2),y+sy) 142 | cr.line_to(x+(sx/2),y+(sy/2)) 143 | cr.line_to(x,y+(sy/2)) 144 | cr.line_to(x,y+sy) 145 | cr.line_to(x-sx,y+sy) 146 | cr.close_path() 147 | cr.set_source_rgb(1,0,0) 148 | 149 | self.makeHitPath(cr.copy_path_flat()) #record the path to use as a hit area. 150 | 151 | cr.fill() #consumes the path, so get it before the fill 152 | 153 | 154 | run(Shapes) 155 | -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008, 2009, Marko Tasic 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * Neither the name of the Marko Tasic nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/gtk/pygtkcanvas-1.0/README -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/__init__.py: -------------------------------------------------------------------------------- 1 | from canvas import * 2 | from canvaslayer import * 3 | from canvasitem import * 4 | -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/canvaslayer.py: -------------------------------------------------------------------------------- 1 | __all__ = ['CanvasLayer'] 2 | 3 | class CanvasLayer(list): 4 | def __init__(self): 5 | self.visible = True 6 | 7 | def set_visible(self, visible): 8 | self.visible = visible 9 | 10 | def get_visible(self): 11 | return self.visible 12 | 13 | def clear(self): 14 | del self[:] 15 | 16 | def move_all(self, dx, dy): 17 | for item in self: 18 | item.move(dx, dy) 19 | 20 | def scale_all(self, xc, yc, xs, ys): 21 | for item in self: 22 | item.scale(xc, yc, xs, ys) 23 | 24 | def find_above(self, item): 25 | index = self.index(item) 26 | if index < len(self) - 1: 27 | return self[index + 1] 28 | else: 29 | return None 30 | 31 | def find_all_above(self, item): 32 | index = self.index(item) 33 | if index < len(self) - 1: 34 | return self[index + 1:] 35 | else: 36 | return [] 37 | 38 | def find_below(self, item): 39 | index = self.index(item) 40 | if index > 0: 41 | return self[index - 1] 42 | else: 43 | return None 44 | 45 | def find_all_below(self, item): 46 | index = self.index(item) 47 | if index > 0: 48 | return self[:index - 1] 49 | else: 50 | return [] 51 | 52 | def find_visible(self, x0, y0, x1, y1): 53 | l = [] 54 | for item in self: 55 | _x0, _y0, _x1, _y1 = item.get_bbox() 56 | if y1 < _y0: continue 57 | if y0 > _y1: continue 58 | if x1 < _x0: continue 59 | if x0 > _x1: continue 60 | l.append(item) 61 | 62 | return l 63 | 64 | def find_closest(self, x, y, halo=0, start=None, end=None): 65 | x0, y0, x1, y1 = x - halo, y - halo, x + halo, y + halo 66 | start_index = self.index(start) if start else 0 67 | end_index = self.index(end) if end else len(self) 68 | l = [] 69 | 70 | for item in self[start_index:end_index]: 71 | _x0, _y0, _x1, _y1 = item.get_bbox() 72 | if (x0<=_x0<=x1 or x0<=_x1<=x1) and (y0<=_y0<=y1 or y0<=_y1<=y1): 73 | l.append(item) 74 | 75 | return l 76 | 77 | def find_enclosed(self, x0, y0, x1, y1): 78 | l = [] 79 | for item in self: 80 | _x0, _y0, _x1, _y1 = item.get_bbox() 81 | if x0<=_x0 and y0<=_y0 and x1>=_x1 and y1>=_y1: 82 | l.append(item) 83 | 84 | return l 85 | 86 | def find_overlapping(self, x0, y0, x1, y1): 87 | l = [] 88 | for item in self: 89 | _x0, _y0, _x1, _y1 = item.get_bbox() 90 | if (x0<=_x0<=x1 or x0<=_x1<=x1) and (y0<=_y0<=y1 or y0<=_y1<=y1): 91 | l.append(item) 92 | 93 | return l 94 | -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/canvasmath.py: -------------------------------------------------------------------------------- 1 | __all__ = ['dist2d', 'inline2d', 'inrect2d', 'inoval2d', 'inarc2d', 2 | 'intext2d', 'inpolygon2d', 'collision_rect_rect2d', 3 | 'image_rgba_to_argb', 'image_argb_to_rgba', 'image_rgba_to_bgra', 4 | 'cairo_image_surface_from_image', 'cairo_image_surface_from_filename'] 5 | 6 | from math import fabs, sqrt, cos, sin, pi, copysign 7 | import array 8 | import Image 9 | import cairo 10 | 11 | def dist2d(x0, y0, x1, y1): 12 | dx = x0 - x1 13 | dy = y0 - y1 14 | return sqrt(dx * dx + dy * dy) 15 | 16 | def inline2d(points, x, y, tolerance=2): 17 | x0, y0, x1, y1 = points 18 | dx = x1 - x0 19 | dy = y1 - y0 20 | px = x - x0 21 | py = y - y0 22 | segment_len = sqrt(dx * dx + dy * dy) 23 | 24 | if segment_len < 1E-6: 25 | dist = sqrt(px * px + py * py) 26 | else: 27 | half_len = segment_len / 2 28 | newx = abs((px * dx + py * dy) / segment_len - half_len) 29 | newy = abs(-px * dy + py * dx) / segment_len 30 | 31 | if newx > half_len: 32 | newx = newx - half_len 33 | dist = sqrt(newx * newx + newy * newy) 34 | else: 35 | dist = newy 36 | 37 | return True if dist<=tolerance else False 38 | 39 | def inrect2d(points, x, y, filled=False, tolerance=2): 40 | x0, y0, x1, y1 = points 41 | 42 | if x0>x1: 43 | x0, x1 = x1, x0 44 | if y0>y1: 45 | y0, y1 = y1, y0 46 | 47 | if filled: 48 | return True if x0<=x<=x1 and y0<=y<=y1 else False 49 | else: 50 | if x0-tolerance<=x<=x0+tolerance or x1-tolerance<=x<=x1+tolerance: 51 | return True if y0<=y<=y1 else False 52 | elif y0-tolerance<=y<=y0+tolerance or y1-tolerance<=y<=y1+tolerance: 53 | return True if x0<=x<=x1 else False 54 | 55 | def inoval2d(points, x, y, filled=False, tolerance=2): 56 | x0, y0, x1, y1 = points 57 | if x0 > x1: 58 | x0, x1 = x1, x0 59 | if y0 > y1: 60 | y0, y1 = y1, y0 61 | 62 | xc = (x0 + x1) / 2 63 | yc = (y0 + y1) / 2 64 | xr0 = xc - x0 65 | yr0 = yc - y0 66 | r0 = xr0 if xr0>yr0 else yr0 67 | 68 | xr1 = xc - x 69 | yr1 = yc - y 70 | r1 = sqrt(xr1*xr1 + yr1*yr1) 71 | 72 | if filled: 73 | return True if r0>=r1 else False 74 | else: 75 | return True if r0-tolerance<=r1<=r0+tolerance else False 76 | 77 | def inarc2d(points, x, y, start=0, extent=360, filled=False, tolerance=2): 78 | return inoval2d(points, x, y, filled, tolerance) 79 | 80 | def intext2d(points, x, y, filled=True, tolerance=0): 81 | return inrect2d(points, x, y, filled, tolerance) 82 | 83 | def inpolygon2d(poly, x, y, tolerance=2): 84 | inside = False 85 | npoints = len(poly) 86 | 87 | # 3-points, 2-axes(x,y) 88 | if npoints < 3 * 2: 89 | return False 90 | 91 | xold = poly[-2] 92 | yold = poly[-1] 93 | 94 | for i in xrange(0, npoints, 2): 95 | xnew = poly[i] 96 | ynew = poly[i+1] 97 | 98 | if xnew > xold: 99 | x0 = xold 100 | y0 = yold 101 | x1 = xnew 102 | y1 = ynew 103 | else: 104 | x0 = xnew 105 | y0 = ynew 106 | x1 = xold 107 | y1 = yold 108 | 109 | if (xnew < x) == (x <= xold) and (y-y0)*(x1-x0) < (y1-y0)*(x-x0): 110 | inside = not inside 111 | 112 | xold = xnew 113 | yold = ynew 114 | 115 | return inside 116 | 117 | #def matmul(a, b): 118 | # return [[sum(i*j for i, j in zip(row, col)) for col in zip(*b)] for row in a] 119 | 120 | def collision_rect_rect2d(left1, top1, right1, bottom1, left2, top2, right2, bottom2): 121 | if bottom1 < top2: return False 122 | if top1 > bottom2: return False 123 | if right1 < left2: return False 124 | if left1 > right2: return False 125 | return True 126 | 127 | def image_rgba_to_argb(str_buf): 128 | byte_buf = array.array("B", str_buf) 129 | num_quads = len(byte_buf)/4 130 | 131 | for i in xrange(num_quads): 132 | alpha = byte_buf[i*4 + 3] 133 | byte_buf[i*4 + 3] = byte_buf[i*4 + 2] 134 | byte_buf[i*4 + 2] = byte_buf[i*4 + 1] 135 | byte_buf[i*4 + 1] = byte_buf[i*4 + 0] 136 | byte_buf[i*4 + 0] = alpha 137 | 138 | return byte_buf.tostring() 139 | 140 | def image_argb_to_rgba(str_buf): 141 | byte_buf = array.array("B", str_buf) 142 | num_quads = len(byte_buf)/4 143 | 144 | for i in xrange(num_quads): 145 | alpha = byte_buf[i*4 + 0] 146 | byte_buf[i*4 + 0] = byte_buf[i*4 + 1] 147 | byte_buf[i*4 + 1] = byte_buf[i*4 + 2] 148 | byte_buf[i*4 + 2] = byte_buf[i*4 + 3] 149 | byte_buf[i*4 + 3] = alpha 150 | 151 | return byte_buf.tostring() 152 | 153 | def image_rgba_to_bgra(str_buf): 154 | byte_buf = array.array("B", str_buf) 155 | num_quads = len(byte_buf) / 4 156 | 157 | for i in xrange(num_quads): 158 | i40 = i * 4 159 | i42 = i40 + 2 160 | r = byte_buf[i40] 161 | b = byte_buf[i42] 162 | byte_buf[i40] = b 163 | byte_buf[i42] = r 164 | 165 | return byte_buf.tostring() 166 | 167 | def cairo_image_surface_from_image(image): 168 | if image.mode != 'RGBA': 169 | image = image.convert('RGBA') 170 | 171 | width, height = image.size 172 | stride = cairo.ImageSurface.format_stride_for_width( 173 | cairo.FORMAT_ARGB32, width) 174 | 175 | image_buffer = array.array('c') 176 | image_buffer.fromstring( 177 | image_rgba_to_bgra( 178 | image.tostring())) 179 | 180 | cairo_image = cairo.ImageSurface.create_for_data( 181 | image_buffer, cairo.FORMAT_ARGB32, width, height, stride) 182 | 183 | return cairo_image 184 | 185 | def cairo_image_surface_from_filename(filename): 186 | image = Image.open(filename) 187 | cairo_image = cairo_image_surface_from_image(image) 188 | return cairo_image 189 | -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/example.py: -------------------------------------------------------------------------------- 1 | import pygtk 2 | pygtk.require('2.0') 3 | import gtk 4 | from random import randrange, random 5 | 6 | from canvas import Canvas 7 | from canvaslayer import CanvasLayer 8 | from canvasitem import * 9 | 10 | class Window: 11 | def __init__(self): 12 | self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) 13 | self.window.connect("delete-event", self.delete_event_cb) 14 | self.window.connect("destroy", self.destroy_cb) 15 | self.window.set_border_width(0) 16 | self.window.set_size_request(800, 600) 17 | self.window.show() 18 | 19 | self.canvas = Canvas() 20 | self.canvas.set_background((0,0,0)) 21 | self.canvas.set_foreground((0,0,0)) 22 | self.canvas.set_flags(gtk.HAS_FOCUS|gtk.CAN_FOCUS) 23 | self.canvas.grab_focus() 24 | 25 | self.layer1 = CanvasLayer() 26 | self.layer2 = CanvasLayer() 27 | self.canvas.append(self.layer1) 28 | self.canvas.append(self.layer2) 29 | self.canvas.show() 30 | self.window.add(self.canvas) 31 | 32 | for n in xrange(100): 33 | o = CanvasRect(self.layer1, 100, 100, 200, 200, filled=True) 34 | o.scale(random(), random(), random(), random()) 35 | o.move(randrange(1000), randrange(1000)) 36 | o.connect('button-press-event', self.button_press_event_cb) 37 | o.connect('motion-notify-event', self.motion_notify_event_cb) 38 | o.connect('button-release-event', self.button_release_event_cb) 39 | 40 | for n in xrange(100): 41 | g = CanvasGroup(self.layer2, fg=(0,0,1)) 42 | o = CanvasLine(g, 0, 0, 100, 100) 43 | print(dir(o)) 44 | o = CanvasRect(g, 0, 100, 100, 200, filled=True, fg=(0.5, 0.3,0.4),bg=(1, 0.3,0.4)) 45 | o = CanvasOval(g, 0, 200, 100, 300, fg=(0.5, 1,0.3)) 46 | o = CanvasArc(g, 0, 300, 100, 400, start=0, extent=180) 47 | o = CanvasText(g, 0, 400, text='Hello') 48 | o = CanvasLine(g, 100, 0, 200, 100) 49 | o = CanvasRect(g, 100, 100, 200, 200, filled=True, outline=True) 50 | o = CanvasOval(g, 100, 200, 200, 300, filled=True) 51 | o = CanvasArc(g, 100, 300, 200, 400, start=90, extent=270, filled=True) 52 | o = CanvasText(g, 100, 400, text='World') 53 | g.scale(random(), random(), random(), random()) 54 | g.move(randrange(1000), randrange(1000)) 55 | g.connect('button-press-event', self.button_press_event_cb) 56 | g.connect('motion-notify-event', self.motion_notify_event_cb) 57 | g.connect('button-release-event', self.button_release_event_cb) 58 | 59 | # o = CanvasImage(self.layer1, 0, 0, filename='image2.jpeg') 60 | # o.connect('button-press-event', self.button_press_event_cb) 61 | # o.connect('motion-notify-event', self.motion_notify_event_cb) 62 | # o.connect('button-release-event', self.button_release_event_cb) 63 | 64 | # o = CanvasImage(self.layer1, 100, 100, filename='image1.png') 65 | # o.connect('button-press-event', self.button_press_event_cb) 66 | # o.connect('motion-notify-event', self.motion_notify_event_cb) 67 | # o.connect('button-release-event', self.button_release_event_cb) 68 | 69 | # o = CanvasFunc(self.layer1, target=self.canvas_func1, args=(), kw={}) 70 | 71 | self.canvas_button = None 72 | self.item = None 73 | self.item_prev_x = None 74 | self.item_prev_y = None 75 | self.item_button = None 76 | 77 | self.window.connect('key-press-event', self.window_key_press_event_cb) 78 | self.window.connect('key-release-event', self.window_key_release_event_cb) 79 | self.canvas.connect('button-press-event', self.canvas_button_press_event_cb) 80 | self.canvas.connect('motion-notify-event', self.canvas_motion_notify_event_cb) 81 | self.canvas.connect('button-release-event', self.canvas_button_release_event_cb) 82 | self.canvas.connect('scroll-event', self.canvas_scroll_event_cb) 83 | 84 | def delete_event_cb(self, widget, event, data=None): 85 | return False 86 | 87 | def destroy_cb(self, widget, data=None): 88 | gtk.main_quit() 89 | 90 | def main(self): 91 | gtk.main() 92 | 93 | def button_press_event_cb(self, widget, item, event): 94 | self.item = item 95 | self.item_prev_x = event.x 96 | self.item_prev_y = event.y 97 | self.item_button = event.button 98 | 99 | def motion_notify_event_cb(self, widget, item, event): 100 | if self.item_button == 1: 101 | dx = event.x - self.item_prev_x 102 | dy = event.y - self.item_prev_y 103 | self.item.move(dx, dy) 104 | self.item_prev_x = event.x 105 | self.item_prev_y = event.y 106 | 107 | def button_release_event_cb(self, widget, item, signal_id): 108 | self.item_button = None 109 | 110 | def canvas_button_press_event_cb(self, widget, event): 111 | self.canvas_button = event.button 112 | if self.canvas_button == 2: 113 | self.canvas_prev_x = event.x 114 | self.canvas_prev_y = event.y 115 | 116 | def canvas_motion_notify_event_cb(self, widget, event): 117 | if self.canvas_button == 2: 118 | dx = event.x - self.canvas_prev_x 119 | dy = event.y - self.canvas_prev_y 120 | self.canvas.move_all(dx, dy) 121 | self.canvas_prev_x = event.x 122 | self.canvas_prev_y = event.y 123 | 124 | def canvas_button_release_event_cb(self, widget, signal_id): 125 | self.canvas_button = None 126 | 127 | def canvas_scroll_event_cb(self, widget, event): 128 | if event.direction == gtk.gdk.SCROLL_UP: 129 | self.canvas.scale_all(event.x, event.y, 1.2, 1.2) 130 | elif event.direction == gtk.gdk.SCROLL_DOWN: 131 | self.canvas.scale_all(event.x, event.y, 1/1.2, 1/1.2) 132 | 133 | def window_key_press_event_cb(self, widget, event): 134 | print widget, event 135 | 136 | def window_key_release_event_cb(self, widget, event): 137 | print widget, event 138 | 139 | def canvas_func1(self, *args, **kw): 140 | self.canvas.draw_image(0, 0, xs=1.0, ys=1.0, filename='image2.jpeg') 141 | self.canvas.draw_line(0, 0, 100, 100) 142 | self.canvas.draw_rect(0, 100, 100, 200) 143 | self.canvas.draw_oval(0, 200, 100, 300) 144 | self.canvas.draw_arc(0, 300, 100, 400) 145 | self.canvas.draw_text(0, 400, "Hello World") 146 | 147 | if __name__ == "__main__": 148 | win = Window() 149 | win.main() 150 | -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/gtk/pygtkcanvas-1.0/image1.png -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/image2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/gtk/pygtkcanvas-1.0/image2.jpeg -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/pygtkcanvas-design.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/gtk/pygtkcanvas-1.0/pygtkcanvas-design.dia -------------------------------------------------------------------------------- /python_examples/gtk/pygtkcanvas-1.0/pygtkcanvas.geany: -------------------------------------------------------------------------------- 1 | 2 | [project] 3 | name=pygtkcanvas 4 | base_path=/home/mtasic/projects/pygtkcanvas/ 5 | make_in_base_path=false 6 | description= 7 | run_cmd= 8 | 9 | [files] 10 | current_page=0 11 | FILE_NAME_0=438;Python;0;16;1;1;0;/home/mtasic/projects/pygtkcanvas//example.py;0 12 | FILE_NAME_1=115;Python;0;16;1;1;0;/home/mtasic/projects/pygtkcanvas/canvas.py;0 13 | FILE_NAME_2=72;Python;0;16;1;1;0;/home/mtasic/projects/pygtkcanvas/canvaslayer.py;0 14 | FILE_NAME_3=159;Python;0;16;1;1;0;/home/mtasic/projects/pygtkcanvas//canvasitem.py;0 15 | FILE_NAME_4=260;Python;0;16;1;1;0;/home/mtasic/projects/pygtkcanvas/canvasmath.py;0 16 | 17 | [indentation] 18 | indent_width=4 19 | indent_type=1 20 | indent_hard_tab_width=8 21 | detect_indent=false 22 | indent_mode=2 23 | -------------------------------------------------------------------------------- /python_examples/make_exe.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os, sys 4 | import subprocess 5 | 6 | pyinpfad = "D:\pyinstaller" 7 | exemakepfad = "D:/dxf2gcode_exe_tkinter" 8 | pyt = "C:/Python25/pythonw.exe" 9 | filepfad= os.path.realpath(os.path.dirname(sys.argv[0])) 10 | icon= "" 11 | file = "NURBS_fitting_by_Biarc_curves_wx" 12 | 13 | 14 | options=("--onefile --noconsol --upx --tk --icon=%s" %icon) 15 | print options 16 | 17 | #Verzwichniss wechseln 18 | exemakepfad = unicode( exemakepfad, "utf-8" ) 19 | os.chdir(exemakepfad.encode( "utf-8" )) 20 | 21 | 22 | cmd=("%s %s\Makespec.py %s %s/%s.py" %(pyt,pyinpfad,options,filepfad,file)) 23 | print cmd 24 | retcode=subprocess.call(cmd) 25 | 26 | cmd=("%s %s\Build.py %s\%s.spec" %(pyt,pyinpfad,exemakepfad,file)) 27 | print cmd 28 | retcode=subprocess.call(cmd) 29 | 30 | print "\n!!!!!!!Bitmaps und Languagues Ordner nicht vergessen!!!!!!" 31 | print "\nFertig" -------------------------------------------------------------------------------- /python_examples/menu_test.py: -------------------------------------------------------------------------------- 1 | ''' 2 | dynamic cascaded submenus 3 | 4 | Created on 25.11.2009 5 | 6 | @author: mah 7 | ''' 8 | 9 | from Tkinter import * 10 | import pprint 11 | 12 | # http://www.astro.washington.edu/users/rowen/TkinterSummary.html#CallbackShims 13 | class SimpleCallback: 14 | """Create a callback shim. Based on code by Scott David Daniels 15 | (which also handles keyword arguments). 16 | """ 17 | def __init__(self, callback, *firstArgs): 18 | self.__callback = callback 19 | self.__firstArgs = firstArgs 20 | 21 | def __call__(self, *args): 22 | return self.__callback (*(self.__firstArgs + args)) 23 | 24 | 25 | def apply_export(inst): 26 | print "export ",inst 27 | 28 | def apply_delete(inst): 29 | if inst in instances: 30 | instances.remove(inst) 31 | rebuild_menu() 32 | print "delete ",inst 33 | 34 | def add_instance(tag): 35 | global counter 36 | counter += 1 37 | name = "%s-%d" %(tag,counter) 38 | print "add %s" % (name) 39 | instances.append(name) 40 | rebuild_menu() 41 | 42 | 43 | def rebuild_menu(): 44 | 45 | dyn_menu = Menu(menu) 46 | dyn_menu.add_command(label="single entry") 47 | dyn_menu.add_separator() 48 | print instances 49 | print dir(menu) 50 | print dir(Menu) 51 | for i in range(len(instances)): 52 | print i 53 | name = instances[i] 54 | sm= Menu(dyn_menu) 55 | sm.add_command(label = "export shape with %s" %(name),command=SimpleCallback(apply_export,name)) 56 | sm.add_command(label = "close %s" %(name),command=SimpleCallback(apply_delete,name)) 57 | dyn_menu.add_cascade(label=name,menu=sm) 58 | menu.entryconfigure(3,label="Apply", menu=dyn_menu) 59 | 60 | def dump(arg): 61 | print "instances:" 62 | pp.pprint(instances) 63 | 64 | 65 | pp = pprint.PrettyPrinter(indent=4) 66 | 67 | 68 | counter = 0 69 | entries = ['good','bad','ugly'] 70 | dyn_menu = None 71 | instances = [] 72 | 73 | root=Tk() 74 | menu = Menu(root) 75 | root.config(menu=menu) 76 | 77 | list_menu = Menu(menu) 78 | list_menu.add_command(label="show instances",command=SimpleCallback(dump,1)) 79 | menu.add_cascade(label="Dump", menu=list_menu) 80 | 81 | 82 | create_menu = Menu(menu) 83 | for k in entries: 84 | create_menu.add_command(label=k,command=SimpleCallback(add_instance,k)) 85 | menu.add_cascade(label="Create", menu=create_menu) 86 | 87 | menu.add_cascade(label="Apply") 88 | menu.entryconfigure(3,label="Sowas", menu=dyn_menu) 89 | #rebuild_menu() 90 | root.mainloop() 91 | -------------------------------------------------------------------------------- /python_examples/qt/Starte_mein_gui.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """The user interface for our app""" 4 | 5 | import os,sys 6 | 7 | # Import Qt modules 8 | from PyQt4 import QtCore,QtGui 9 | 10 | # Import the compiled UI module 11 | from mein_test import Ui_MainWindow 12 | 13 | # Create a class for our main window 14 | class Main(QtGui.QMainWindow): 15 | def __init__(self): 16 | QtGui.QMainWindow.__init__(self) 17 | 18 | # This is always the same 19 | self.ui=Ui_MainWindow() 20 | self.ui.setupUi(self) 21 | 22 | self.createActions() 23 | 24 | self.myGraphicsScene=myGraphicsScene() 25 | self.myGraphicsScene.addLine() 26 | 27 | self.ui.mygraphicsView.setScene(self.myGraphicsScene) 28 | self.ui.mygraphicsView.show() 29 | 30 | def createActions(self): 31 | 32 | 33 | self.ui.actionExit.triggered.connect(self.close) 34 | 35 | self.ui.actionLoad_File.triggered.connect(self.showDialog) 36 | 37 | self.ui.actionAbout.triggered.connect(self.about) 38 | 39 | 40 | def showDialog(self): 41 | filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file', 42 | 'E:') 43 | 44 | 45 | def about(self): 46 | QtGui.QMessageBox.about(self, "About Diagram Scene", 47 | "The Diagram Scene example shows use of the graphics framework.") 48 | 49 | class myGraphicsScene(QtGui.QGraphicsScene): 50 | def __init__(self): 51 | QtGui.QGraphicsScene.__init__(self) 52 | self.setSceneRect(0,-600,800,500) 53 | 54 | def addLine(self): 55 | l=myLineItem(QtCore.QLineF(0,0,2000,-200)) 56 | self.addItem(l) 57 | 58 | class myLineItem(QtGui.QGraphicsLineItem): 59 | def __init__(self,line): 60 | QtGui.QGraphicsLineItem.__init__(self,line) 61 | def paint(self, painter, options, widget): 62 | print "Painting" 63 | QtGui.QGraphicsLineItem.paint(self, painter,options,widget) 64 | #self.setPen(QPen(Qt.red)) 65 | 66 | 67 | 68 | def main(): 69 | # Again, this is boilerplate, it's going to be the same on 70 | # almost every app you write 71 | app = QtGui.QApplication(sys.argv) 72 | window=Main() 73 | window.show() 74 | 75 | 76 | # It's exec_ because exec is a reserved word in Python 77 | sys.exit(app.exec_()) 78 | 79 | 80 | if __name__ == "__main__": 81 | main() 82 | 83 | -------------------------------------------------------------------------------- /python_examples/qt/Starte_mein_gui.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'), os.path.join(HOMEPATH,'support\\useUnicode.py'), 'D:\\Eclipse_Workspace\\DXF2GCODE\\trunk\\python_examples\\qt/Starte_mein_gui.py'], 3 | pathex=['D:\\Eclipse_Workspace\\DXF2GCODE\\trunk\\python_examples\\qt']) 4 | pyz = PYZ(a.pure) 5 | exe = EXE( pyz, 6 | a.scripts, 7 | a.binaries, 8 | a.zipfiles, 9 | a.datas, 10 | name=os.path.join('dist', 'Starte_mein_gui.exe'), 11 | debug=False, 12 | strip=False, 13 | upx=True, 14 | console=False ) 15 | -------------------------------------------------------------------------------- /python_examples/qt/context_menu.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from PyQt4.QtCore import Qt 5 | from PyQt4.QtGui import * 6 | 7 | class TableWidget(QTableWidget): 8 | 9 | def __init__(self, parent = None): 10 | 11 | QTableWidget.__init__(self, parent) 12 | self.setContextMenuPolicy(Qt.ActionsContextMenu) 13 | 14 | quitAction = QAction("Quit", self) 15 | quitAction.triggered.connect(qApp.quit) 16 | 17 | quitAction2 = QAction("Quit", self) 18 | quitAction2.triggered.connect(qApp.quit) 19 | 20 | self.addAction(quitAction) 21 | self.addAction(quitAction2) 22 | 23 | 24 | app = QApplication([]) 25 | tableWidget = TableWidget() 26 | tableWidget.show() 27 | sys.exit(app.exec_()) 28 | -------------------------------------------------------------------------------- /python_examples/qt/demo.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'demo.ui' 4 | # 5 | # Created: Wed Nov 24 21:16:23 2010 6 | # by: PyQt4 UI code generator 4.5.4 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | from PyQt4 import QtCore, QtGui 11 | 12 | class Ui_DemoDialog(object): 13 | def setupUi(self, DemoDialog): 14 | DemoDialog.setObjectName("DemoDialog") 15 | DemoDialog.resize(473, 439) 16 | self.gridlayout = QtGui.QGridLayout(DemoDialog) 17 | self.gridlayout.setMargin(9) 18 | self.gridlayout.setSpacing(6) 19 | self.gridlayout.setObjectName("gridlayout") 20 | self.vboxlayout = QtGui.QVBoxLayout() 21 | self.vboxlayout.setSpacing(6) 22 | self.vboxlayout.setMargin(0) 23 | self.vboxlayout.setObjectName("vboxlayout") 24 | self.button1 = QtGui.QPushButton(DemoDialog) 25 | self.button1.setObjectName("button1") 26 | self.vboxlayout.addWidget(self.button1) 27 | self.button2 = QtGui.QPushButton(DemoDialog) 28 | self.button2.setObjectName("button2") 29 | self.vboxlayout.addWidget(self.button2) 30 | self.gridlayout.addLayout(self.vboxlayout, 1, 0, 1, 1) 31 | self.hboxlayout = QtGui.QHBoxLayout() 32 | self.hboxlayout.setSpacing(6) 33 | self.hboxlayout.setMargin(0) 34 | self.hboxlayout.setObjectName("hboxlayout") 35 | spacerItem = QtGui.QSpacerItem(131, 31, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) 36 | self.hboxlayout.addItem(spacerItem) 37 | self.okButton = QtGui.QPushButton(DemoDialog) 38 | self.okButton.setObjectName("okButton") 39 | self.hboxlayout.addWidget(self.okButton) 40 | self.gridlayout.addLayout(self.hboxlayout, 3, 0, 1, 3) 41 | spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) 42 | self.gridlayout.addItem(spacerItem1, 2, 0, 1, 1) 43 | spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) 44 | self.gridlayout.addItem(spacerItem2, 0, 0, 1, 1) 45 | self.list = QtGui.QListWidget(DemoDialog) 46 | self.list.setObjectName("list") 47 | self.gridlayout.addWidget(self.list, 0, 2, 3, 1) 48 | self.graphicsView = QtGui.QGraphicsView(DemoDialog) 49 | self.graphicsView.setObjectName("graphicsView") 50 | self.gridlayout.addWidget(self.graphicsView, 0, 1, 3, 1) 51 | 52 | self.retranslateUi(DemoDialog) 53 | QtCore.QObject.connect(self.okButton, QtCore.SIGNAL("clicked()"), DemoDialog.accept) 54 | QtCore.QObject.connect(self.button2, QtCore.SIGNAL("clicked()"), self.list.clear) 55 | QtCore.QMetaObject.connectSlotsByName(DemoDialog) 56 | 57 | def retranslateUi(self, DemoDialog): 58 | DemoDialog.setWindowTitle(QtGui.QApplication.translate("DemoDialog", "PyUIC4 Demo Dialog", None, QtGui.QApplication.UnicodeUTF8)) 59 | self.button1.setText(QtGui.QApplication.translate("DemoDialog", "Add items", None, QtGui.QApplication.UnicodeUTF8)) 60 | self.button2.setText(QtGui.QApplication.translate("DemoDialog", "Clear list", None, QtGui.QApplication.UnicodeUTF8)) 61 | self.okButton.setText(QtGui.QApplication.translate("DemoDialog", "OK", None, QtGui.QApplication.UnicodeUTF8)) 62 | 63 | -------------------------------------------------------------------------------- /python_examples/qt/demo.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DemoDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 473 10 | 439 11 | 12 | 13 | 14 | PyUIC4 Demo Dialog 15 | 16 | 17 | 18 | 9 19 | 20 | 21 | 6 22 | 23 | 24 | 25 | 26 | 6 27 | 28 | 29 | 0 30 | 31 | 32 | 33 | 34 | Add items 35 | 36 | 37 | 38 | 39 | 40 | 41 | Clear list 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 6 51 | 52 | 53 | 0 54 | 55 | 56 | 57 | 58 | Qt::Horizontal 59 | 60 | 61 | 62 | 131 63 | 31 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | OK 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | Qt::Vertical 81 | 82 | 83 | 84 | 20 85 | 40 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | Qt::Vertical 94 | 95 | 96 | 97 | 20 98 | 40 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | okButton 115 | clicked() 116 | DemoDialog 117 | accept() 118 | 119 | 120 | 369 121 | 256 122 | 123 | 124 | 96 125 | 254 126 | 127 | 128 | 129 | 130 | button2 131 | clicked() 132 | list 133 | clear() 134 | 135 | 136 | 92 137 | 112 138 | 139 | 140 | 279 141 | 123 142 | 143 | 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /python_examples/qt/diagramscene.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/pointer.png 4 | images/linepointer.png 5 | images/textpointer.png 6 | images/bold.png 7 | images/italic.png 8 | images/underline.png 9 | images/floodfill.png 10 | images/bringtofront.png 11 | images/delete.png 12 | images/sendtoback.png 13 | images/linecolor.png 14 | images/background1.png 15 | images/background2.png 16 | images/background3.png 17 | images/background4.png 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /python_examples/qt/filedialog.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # openfiledialog.py 4 | 5 | import sys 6 | from PyQt4 import QtGui 7 | from PyQt4 import QtCore 8 | 9 | 10 | class OpenFile(QtGui.QMainWindow): 11 | def __init__(self, parent=None): 12 | QtGui.QMainWindow.__init__(self, parent) 13 | 14 | self.setGeometry(300, 300, 350, 300) 15 | self.setWindowTitle('OpenFile') 16 | 17 | self.textEdit = QtGui.QTextEdit() 18 | self.setCentralWidget(self.textEdit) 19 | self.statusBar() 20 | 21 | self._label = QtGui.QLabel("Einkaufszaehler") 22 | self.statusBar().addPermanentWidget(self._label) 23 | self.statusBar().addPermanentWidget(self._label) 24 | 25 | self._label.setText("BLA2") 26 | 27 | self.setFocus() 28 | 29 | openFile = QtGui.QAction(QtGui.QIcon('open.png'), 'Open', self) 30 | openFile.setShortcut('Ctrl+O') 31 | openFile.setStatusTip('Open new File') 32 | self.connect(openFile, QtCore.SIGNAL('triggered()'), self.showDialog) 33 | 34 | menubar = self.menuBar() 35 | fileMenu = menubar.addMenu('&File') 36 | fileMenu.addAction(openFile) 37 | 38 | def showDialog(self): 39 | filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file', 40 | '/home') 41 | fname = open(filename) 42 | data = fname.read() 43 | self.textEdit.setText(data) 44 | 45 | app = QtGui.QApplication(sys.argv) 46 | fd = OpenFile() 47 | fd.show() 48 | app.exec_() 49 | 50 | -------------------------------------------------------------------------------- /python_examples/qt/graphicscene_test.py: -------------------------------------------------------------------------------- 1 | from PyQt4.QtGui import * 2 | from PyQt4.QtCore import * 3 | import sys 4 | class myLineItem(QGraphicsLineItem): 5 | def __init__(self,line): 6 | QGraphicsLineItem.__init__(self,line) 7 | def paint(self, painter, options, widget): 8 | print "Painting" 9 | QGraphicsLineItem.paint(self, painter,options,widget) 10 | #self.setPen(QPen(Qt.red)) 11 | app=QApplication(sys.argv) 12 | scene=QGraphicsScene() 13 | l=myLineItem(QLineF(-20,0,20,2000)) 14 | 15 | 16 | 17 | scene.addItem(l) 18 | 19 | view= QGraphicsView(scene) 20 | view.show(); 21 | scene.setSceneRect(0,0,800,600) 22 | app.exec_() 23 | 24 | -------------------------------------------------------------------------------- /python_examples/qt/images/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/background1.png -------------------------------------------------------------------------------- /python_examples/qt/images/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/background2.png -------------------------------------------------------------------------------- /python_examples/qt/images/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/background3.png -------------------------------------------------------------------------------- /python_examples/qt/images/background4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/background4.png -------------------------------------------------------------------------------- /python_examples/qt/images/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/bold.png -------------------------------------------------------------------------------- /python_examples/qt/images/bringtofront.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/bringtofront.png -------------------------------------------------------------------------------- /python_examples/qt/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/delete.png -------------------------------------------------------------------------------- /python_examples/qt/images/floodfill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/floodfill.png -------------------------------------------------------------------------------- /python_examples/qt/images/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/italic.png -------------------------------------------------------------------------------- /python_examples/qt/images/linecolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/linecolor.png -------------------------------------------------------------------------------- /python_examples/qt/images/linepointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/linepointer.png -------------------------------------------------------------------------------- /python_examples/qt/images/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/pointer.png -------------------------------------------------------------------------------- /python_examples/qt/images/sendtoback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/sendtoback.png -------------------------------------------------------------------------------- /python_examples/qt/images/textpointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/textpointer.png -------------------------------------------------------------------------------- /python_examples/qt/images/underline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/qt/images/underline.png -------------------------------------------------------------------------------- /python_examples/qt/make_exe.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os, sys 4 | import subprocess 5 | 6 | pyinpfad = "C:\Python26\pyinstaller-1.4" 7 | 8 | pyt = "C:/Python26/pythonw.exe" 9 | filepfad= os.path.realpath(os.path.dirname(sys.argv[0])) 10 | exemakepfad=filepfad 11 | file = "Starte_mein_gui" 12 | icon= "%s/DXF2GCODE-001.ico" %filepfad 13 | 14 | #options=("--onefile --noconsole --upx --icon=%s" %icon) 15 | options=("--onefile --noconsole --upx") 16 | print options 17 | 18 | #Verzwichniss wechseln 19 | exemakepfad = unicode( exemakepfad, "utf-8" ) 20 | os.chdir(exemakepfad.encode( "utf-8" )) 21 | 22 | 23 | cmd=("%s %s\Makespec.py %s %s/%s.py" %(pyt,pyinpfad,options,filepfad,file)) 24 | print cmd 25 | retcode=subprocess.call(cmd) 26 | 27 | cmd=("%s %s\Build.py %s\%s.spec" %(pyt,pyinpfad,exemakepfad,file)) 28 | print cmd 29 | retcode=subprocess.call(cmd) 30 | 31 | print "\n!!!!!!!Bitmaps und Languagues Ordner nicht vergessen!!!!!!" 32 | print "\nFertig" -------------------------------------------------------------------------------- /python_examples/qt/make_py_uic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os, sys 4 | import subprocess 5 | 6 | pyt = "C:/Python26/pythonw.exe" 7 | 8 | uicpfad = "C:\Python26\Lib\site-packages\PyQt4\uic" 9 | filepfad= os.path.realpath(os.path.dirname(sys.argv[0])) 10 | 11 | uifile = "mein_test.ui" 12 | ergfile= "mein_test.py" 13 | 14 | 15 | options=("-o") 16 | #print options 17 | 18 | 19 | cmd=("%s %s\pyuic.py %s %s %s" %(pyt,uicpfad,uifile,options,ergfile)) 20 | print cmd 21 | retcode=subprocess.call(cmd) 22 | -------------------------------------------------------------------------------- /python_examples/qt/warnStarte_mein_gui.txt: -------------------------------------------------------------------------------- 1 | W: no module named pyreadline.keysyms.make_KeyPress (top-level import by pyreadline.console.ironpython_console) 2 | W: no module named startup (conditional import by pyreadline.keysyms.keysyms) 3 | W: no module named pwd (delayed, conditional import by posixpath) 4 | W: no module named ctypes.windll (top-level import by pyreadline.keysyms.keysyms) 5 | W: no module named org (top-level import by pickle) 6 | W: no module named startup (conditional import by pyreadline.keysyms.common) 7 | W: no module named fcntl (conditional import by subprocess) 8 | W: no module named System (top-level import by pyreadline.clipboard.ironpython_clipboard) 9 | W: no module named clr (top-level import by pyreadline.console.ironpython_console) 10 | W: no module named AES (delayed, conditional import by archive) 11 | W: no module named pyreadline.keysyms.make_KeyPress (top-level import by pyreadline.console.console) 12 | W: no module named posix (delayed, conditional import by iu) 13 | W: no module named PyQt4._qt (top-level import by PyQt4.QtCore) 14 | W: no module named startup (conditional import by pyreadline.lineeditor.lineobj) 15 | W: no module named org (top-level import by copy) 16 | W: no module named fcntl (top-level import by tempfile) 17 | W: no module named IronPythonConsole (top-level import by pyreadline.console.ironpython_console) 18 | W: no module named System (top-level import by pyreadline.console.ironpython_console) 19 | W: no module named PyQt4._qt (top-level import by PyQt4.QtGui) 20 | W: no module named pyreadline.modes.editingmodes (top-level import by pyreadline.rlmain) 21 | W: no module named pyreadline.keysyms.make_keyinfo (top-level import by pyreadline.console.ironpython_console) 22 | W: no module named System (top-level import by pyreadline.keysyms.ironpython_keysyms) 23 | W: no module named clr (top-level import by pyreadline.clipboard.ironpython_clipboard) 24 | W: no module named _emx_link (conditional import by os) 25 | W: no module named posix (conditional import by os) 26 | W: no module named pyreadline.keysyms.make_KeyPress_from_keydescr (top-level import by pyreadline.console.ironpython_console) 27 | W: no module named System (conditional import by pyreadline.rlmain) 28 | W: no module named PyQt4._qt (top-level import by PyQt4) 29 | W: no module named pyreadline.keysyms.make_keysym (top-level import by pyreadline.console.ironpython_console) 30 | W: delayed exec statement detected at line 0 - bdb (C:\Python26\lib\bdb.pyc) 31 | W: delayed eval hack detected at line 0 - bdb (C:\Python26\lib\bdb.pyc) 32 | W: delayed eval hack detected at line 0 - bdb (C:\Python26\lib\bdb.pyc) 33 | W: delayed __import__ hack detected at line 0 - optparse (C:\Python26\lib\optparse.pyc) 34 | W: delayed conditional __import__ hack detected at line 0 - doctest (C:\Python26\lib\doctest.pyc) 35 | W: delayed exec statement detected at line 0 - doctest (C:\Python26\lib\doctest.pyc) 36 | W: delayed conditional __import__ hack detected at line 0 - doctest (C:\Python26\lib\doctest.pyc) 37 | W: __all__ is built strangely at line 0 - tokenize (C:\Python26\lib\tokenize.pyc) 38 | W: delayed __import__ hack detected at line 0 - pickle (C:\Python26\lib\pickle.pyc) 39 | W: delayed __import__ hack detected at line 0 - pickle (C:\Python26\lib\pickle.pyc) 40 | W: delayed __import__ hack detected at line 0 - encodings (C:\Python26\lib\encodings\__init__.pyc) 41 | W: name rl not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 42 | W: name GetOutputFile not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 43 | W: name add_history not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 44 | W: name get_completer_delims not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 45 | W: name set_completer_delims not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 46 | W: name get_endidx not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 47 | W: name get_begidx not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 48 | W: name get_completer not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 49 | W: name set_completer not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 50 | W: name set_pre_input_hook not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 51 | W: name set_startup_hook not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 52 | W: name set_history_length not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 53 | W: name get_history_length not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 54 | W: name write_history_file not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 55 | W: name read_history_file not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 56 | W: name read_init_file not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 57 | W: name clear_history not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 58 | W: name insert_text not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 59 | W: name get_line_buffer not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 60 | W: name parse_and_bind not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 61 | W: name rl not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 62 | W: name GetOutputFile not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 63 | W: name add_history not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 64 | W: name get_completer_delims not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 65 | W: name set_completer_delims not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 66 | W: name get_endidx not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 67 | W: name get_begidx not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 68 | W: name get_completer not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 69 | W: name set_completer not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 70 | W: name set_pre_input_hook not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 71 | W: name set_startup_hook not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 72 | W: name set_history_length not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 73 | W: name get_history_length not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 74 | W: name write_history_file not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 75 | W: name read_history_file not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 76 | W: name read_init_file not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 77 | W: name clear_history not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 78 | W: name insert_text not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 79 | W: name get_line_buffer not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 80 | W: name parse_and_bind not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 81 | W: name rl not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 82 | W: name GetOutputFile not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 83 | W: name add_history not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 84 | W: name get_completer_delims not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 85 | W: name set_completer_delims not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 86 | W: name get_endidx not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 87 | W: name get_begidx not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 88 | W: name get_completer not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 89 | W: name set_completer not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 90 | W: name set_pre_input_hook not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 91 | W: name set_startup_hook not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 92 | W: name set_history_length not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 93 | W: name get_history_length not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 94 | W: name write_history_file not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 95 | W: name read_history_file not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 96 | W: name read_init_file not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 97 | W: name clear_history not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 98 | W: name insert_text not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 99 | W: name get_line_buffer not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 100 | W: name parse_and_bind not found - pyreadline (C:\Python26\lib\site-packages\pyreadline\__init__.pyc) 101 | W: __all__ is built strangely at line 0 - dis (C:\Python26\lib\dis.pyc) 102 | W: delayed conditional eval hack detected at line 0 - warnings (C:\Python26\lib\warnings.pyc) 103 | W: delayed conditional __import__ hack detected at line 0 - warnings (C:\Python26\lib\warnings.pyc) 104 | W: delayed __import__ hack detected at line 0 - ctypes (C:\Python26\lib\ctypes\__init__.pyc) 105 | W: delayed __import__ hack detected at line 0 - ctypes (C:\Python26\lib\ctypes\__init__.pyc) 106 | W: delayed exec statement detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 107 | W: delayed conditional eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 108 | W: delayed eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 109 | W: delayed conditional eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 110 | W: delayed eval hack detected at line 0 - pdb (C:\Python26\lib\pdb.pyc) 111 | W: delayed conditional __import__ hack detected at line 0 - unittest (C:\Python26\lib\unittest.pyc) 112 | W: delayed conditional __import__ hack detected at line 0 - unittest (C:\Python26\lib\unittest.pyc) 113 | W: delayed conditional exec statement detected at line 0 - iu (C:\Python26\pyinstaller-1.4\iu.pyc) 114 | W: delayed conditional exec statement detected at line 0 - iu (C:\Python26\pyinstaller-1.4\iu.pyc) 115 | W: __all__ is built strangely at line 0 - collections (C:\Python26\lib\collections.pyc) 116 | W: delayed exec statement detected at line 0 - collections (C:\Python26\lib\collections.pyc) 117 | W: delayed exec statement detected at line 0 - socket (C:\Python26\lib\socket.pyc) 118 | W: delayed eval hack detected at line 0 - os (C:\Python26\lib\os.pyc) 119 | W: __all__ is built strangely at line 0 - __future__ (C:\Python26\lib\__future__.pyc) 120 | W: delayed eval hack detected at line 0 - gettext (C:\Python26\lib\gettext.pyc) 121 | -------------------------------------------------------------------------------- /python_examples/travelling_salesman_problem_2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/python_examples/travelling_salesman_problem_2.py -------------------------------------------------------------------------------- /source/Core/ArcGeo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/Core/ArcGeo.py -------------------------------------------------------------------------------- /source/Core/BoundingBox.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/Core/BoundingBox.py -------------------------------------------------------------------------------- /source/Core/Config.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/Core/Config.py -------------------------------------------------------------------------------- /source/Core/CustomGCode.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | This class contains a "custom gcode" object. Custom GCode objects are part of a layer (LayerContent.py) and are used to insert custom GCode into the generated file. 4 | Customs GCodes are defined in config.cfg file 5 | 6 | @purpose: store user defined GCode 7 | @author: Xavier Izard 8 | @since: 2012.10.27 9 | @license: GPL 10 | """ 11 | 12 | """ 13 | from PyQt4 import QtCore, QtGui 14 | 15 | import Core.Globals as g 16 | 17 | from Core.Point import Point 18 | from Core.BoundingBox import BoundingBox 19 | from math import cos, sin, degrees 20 | from copy import deepcopy 21 | from EntitieContent import EntitieContentClass 22 | """ 23 | import logging 24 | logger=logging.getLogger("Core.CustomGCodeClass") 25 | 26 | 27 | class CustomGCodeClass: 28 | """ 29 | The Shape Class includes all plotting, GUI functionality and export functions 30 | related to the Shapes. 31 | """ 32 | def __init__(self, name, nr, gcode=None, parent=None): 33 | """ 34 | Standard method to initialize the class 35 | @param name: the name of the GCode, as defined in the config file 36 | @param gcode: the user defined gcode 37 | @param parent: The parent layer Class of the shape 38 | """ 39 | self.type = "CustomGCode" 40 | self.name = name 41 | self.nr = nr 42 | self.gcode = gcode 43 | self.LayerContent = parent 44 | self.disabled = False 45 | self.send_to_TSP = False #Never optimize path for CustomGCode 46 | 47 | 48 | def __str__(self): 49 | """ 50 | Standard method to print the object 51 | @return: A string 52 | """ 53 | return ('\ntype: %s' % self.type) + \ 54 | ('\nname: %s' % self.name) + \ 55 | ('\nnr: %i' % self.nr) + \ 56 | ('\ngcode: %s' % self.gcode) 57 | 58 | 59 | 60 | def setDisable(self, flag=False): 61 | """ 62 | Function to modify the disable property 63 | @param flag: The flag to enable or disable Selection 64 | """ 65 | self.disabled=flag 66 | 67 | 68 | 69 | def isDisabled(self): 70 | """ 71 | Returns the state of self.disabled 72 | """ 73 | return self.disabled 74 | 75 | 76 | 77 | def Write_GCode(self, LayerContent=None, PostPro=None): 78 | """ 79 | This method returns the string to be exported for this custom gcode, including 80 | @param LayerContent: This parameter includes the parent LayerContent 81 | @param PostPro: this is the Postprocessor class including the methods to export 82 | """ 83 | 84 | #initialisation of the string 85 | exstr = self.gcode 86 | 87 | return exstr 88 | -------------------------------------------------------------------------------- /source/Core/EntitieContent.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: cp1252 -*- 3 | # 4 | #Programmers: Christian Kohl�ffel 5 | # Vinzenz Schulz 6 | # 7 | #Distributed under the terms of the GPL (GNU Public License) 8 | # 9 | #dxf2gcode is free software; you can redistribute it and/or modify 10 | #it under the terms of the GNU General Public License as published by 11 | #the Free Software Foundation; either version 2 of the License, or 12 | #(at your option) any later version. 13 | # 14 | #This program is distributed in the hope that it will be useful, 15 | #but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | #GNU General Public License for more details. 18 | # 19 | #You should have received a copy of the GNU General Public License 20 | #along with this program; if not, write to the Free Software 21 | #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | 23 | from Core.Point import Point 24 | 25 | import logging 26 | logger=logging.getLogger("Core.EntitieContent") 27 | 28 | class EntitieContentClass: 29 | def __init__(self,type="Entitie",Nr=None,Name='',parent=None,children=[], 30 | p0=Point(x=0.0,y=0.0),pb=Point(x=0.0,y=0.0),sca=[1,1,1],rot=0.0): 31 | 32 | self.type=type 33 | self.Nr=Nr 34 | self.Name=Name 35 | self.children=children 36 | self.p0=p0 37 | self.pb=pb 38 | self.sca=sca 39 | self.rot=rot 40 | self.parent=parent 41 | 42 | def __cmp__(self, other): 43 | return cmp(self.EntNr, other.EntNr) 44 | 45 | def __str__(self): 46 | return ('\ntype: %s' %self.type) +\ 47 | ('\nNr : %i' %self.Nr) +\ 48 | ('\nName: %s' %self.Name)+\ 49 | ('\np0: %s' %self.p0)+\ 50 | ('\npb: %s' %self.pb)+\ 51 | ('\nsca: %s' %self.sca)+\ 52 | ('\nrot: %s' %self.rot)+\ 53 | ('\nchildren: %s' %self.children) 54 | 55 | #Hinzufuegen der Kontur zu den Entities 56 | #Add the contour of the Entities 57 | def addchild(self,child): 58 | self.children.append(child) 59 | 60 | -------------------------------------------------------------------------------- /source/Core/Globals.py: -------------------------------------------------------------------------------- 1 | # -*- coding: iso-8859-15 -*- 2 | # 3 | # This program is free software; you can redistribute it and/or 4 | # modify it under the terms of the GNU General Public License 5 | # as published by the Free Software Foundation; either version 2 6 | # of the License, or (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 | ''' 17 | 18 | Container for global variables accessible to all classes 19 | 20 | Michael Haberler 20.12.2009 21 | ''' 22 | import os 23 | import sys 24 | import gettext 25 | import locale 26 | import constants 27 | 28 | 29 | 30 | # logger instance, see http://docs.python.org/library/logging.html 31 | # once set, use as logger.error("foo") 32 | logger = None 33 | 34 | # Config instance 35 | config = None 36 | 37 | # Folder of the main instance 38 | folder = None 39 | 40 | window = None 41 | 42 | 43 | #------------------------------------- 44 | 45 | # determine Platform 46 | platform = "" 47 | if os.name == "posix" and sys.platform == "darwin": 48 | platform = "mac" 49 | 50 | 51 | # Language support 52 | # 53 | langs = [] # list of supported languages 54 | 55 | # figure default language 56 | lc, encoding = locale.getdefaultlocale() 57 | 58 | if (lc): 59 | langs = [lc] # if there's one, use as default 60 | 61 | language = os.environ.get('LANGUAGE', None) 62 | if (language): 63 | """language comes back something like en_CA:en_US:en_GB:en 64 | on linuxy systems, on Win32 it's nothing, so we need to 65 | split it up into a list""" 66 | langs += language.split(":") 67 | 68 | """Now add on to the back of the list the translations that we 69 | know that we have, our defaults""" 70 | langs += [] 71 | 72 | """Now langs is a list of all of the languages that we are going 73 | to try to use. First we check the default, then what the system 74 | told us, and finally the 'known' list""" 75 | 76 | gettext.bindtextdomain(constants.APPNAME, os.path.realpath(os.path.dirname(sys.argv[0]))) 77 | gettext.textdomain(constants.APPNAME) 78 | # Get the language to use 79 | trans = gettext.translation(constants.APPNAME, localedir='languages', languages=langs, fallback=True) 80 | trans.install() 81 | -------------------------------------------------------------------------------- /source/Core/LayerContent.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: cp1252 -*- 3 | # 4 | #Programmers: Christian Kohl�ffel 5 | # Vinzenz Schulz 6 | # 7 | #Distributed under the terms of the GPL (GNU Public License) 8 | # 9 | #dxf2gcode is free software; you can redistribute it and/or modify 10 | #it under the terms of the GNU General Public License as published by 11 | #the Free Software Foundation; either version 2 of the License, or 12 | #(at your option) any later version. 13 | # 14 | #This program is distributed in the hope that it will be useful, 15 | #but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | #GNU General Public License for more details. 18 | # 19 | #You should have received a copy of the GNU General Public License 20 | #along with this program; if not, write to the Free Software 21 | #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | 23 | 24 | import Core.Globals as g 25 | 26 | import logging 27 | logger=logging.getLogger("Core.LayerContent") 28 | 29 | class LayerContentClass: 30 | """ 31 | The LayerContentClass is used for the definition of the shape order to 32 | export and to store and change (GUI) the different export parameters. The 33 | LayerConentClasses for each Layer is stored in a list. This List Defines the 34 | order for Layers to be exported. 35 | """ 36 | def __init__(self,LayerNr=None,LayerName='',shapes=[]): 37 | """ 38 | Initialization of the LayerContentClass. This is performed during the 39 | shapes creation in the main dxf2gcode.py file. 40 | @param LayerNr: This parameter is forwarded from the dxf import 41 | @param LayerName: This parameter is forwarded from the dxf import 42 | @param shapes: This is a list which includes all shapes on the layer. 43 | """ 44 | 45 | #Define Short Name for config.vars 46 | vars=g.config.vars 47 | 48 | self.type = "Layer" 49 | self.LayerNr=LayerNr 50 | self.LayerName=LayerName 51 | self.shapes=shapes 52 | self.exp_order=[] #used for shape order optimization, ... Only contains shapes 53 | self.exp_order_complete=[] #used for outputing the GCODE ; can contain shapes, custom gcode, ... 54 | self.axis3_slice_depth=vars.Depth_Coordinates['axis3_slice_depth'] 55 | self.axis3_start_mill_depth=vars.Depth_Coordinates['axis3_start_mill_depth'] 56 | self.axis3_mill_depth=vars.Depth_Coordinates['axis3_mill_depth'] 57 | self.axis3_retract=vars.Depth_Coordinates['axis3_retract'] 58 | self.axis3_safe_margin=vars.Depth_Coordinates['axis3_safe_margin'] 59 | 60 | #Use default tool 1 (always exists in config) 61 | self.tool_nr=1 62 | self.tool_diameter=vars.Tool_Parameters['1']['diameter'] 63 | self.speed=vars.Tool_Parameters['1']['speed'] 64 | self.start_radius=vars.Tool_Parameters['1']['start_radius'] 65 | self.f_g1_plane=vars.Feed_Rates['f_g1_plane'] 66 | self.f_g1_depth=vars.Feed_Rates['f_g1_depth'] 67 | 68 | 69 | def __cmp__(self, other): 70 | return cmp(self.LayerNr, other.LayerNr) 71 | """ 72 | This function just compares the LayerNr to sort the List of LayerContents 73 | @param other: This is the 2nd of the LayerContentClass to be compared. 74 | """ 75 | 76 | def __str__(self): 77 | """ 78 | Standard method to print the object 79 | @return: A string 80 | """ 81 | return ('\ntype: %s' %self.type) +\ 82 | ('\nLayerNr : %i' %self.LayerNr) +\ 83 | ('\nLayerName: %s' %self.LayerName)+\ 84 | ('\nshapes: %s' %self.shapes)+\ 85 | ('\nexp_order: %s' %self.exp_order)+\ 86 | ('\nexp_order_comp:%s' %self.exp_order_complete)+\ 87 | ('\ntool_diameter: %i' %self.tool_nr) 88 | -------------------------------------------------------------------------------- /source/Core/LineGeo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/Core/LineGeo.py -------------------------------------------------------------------------------- /source/Core/Logger.py: -------------------------------------------------------------------------------- 1 | # -*- coding: iso-8859-15 -*- 2 | # 3 | # This program is free software; you can redistribute it and/or 4 | # modify it under the terms of the GNU General Public License 5 | # as published by the Free Software Foundation; either version 2 6 | # of the License, or (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 | ''' 17 | 18 | Michael Haberler 20.12.2009 19 | ''' 20 | import sys 21 | import time 22 | import logging 23 | 24 | import Core.Globals as g 25 | 26 | from PyQt4 import QtCore 27 | 28 | class LoggerClass(QtCore.QObject): 29 | ''' 30 | handle 3 log streams: 31 | console 32 | file 33 | message window 34 | ''' 35 | def __init__(self, rootlogger, console_loglevel): 36 | QtCore.QObject.__init__(self) 37 | 38 | self.file_handler = None 39 | self.window_handler = None 40 | self.rootlogger = rootlogger 41 | self.rootlogger.setLevel(logging.DEBUG) 42 | 43 | # always log to the console window 44 | self.console_handler = logging.StreamHandler() 45 | self.console_handler.setFormatter(logging.Formatter("%(name)-25s %(funcName)-12s %(lineno)-3d: - %(message)s")) 46 | self.console_handler.setLevel(self._cvtlevel(console_loglevel)) 47 | self.console_handler.addFilter(FilterModule()) 48 | 49 | self.rootlogger.addHandler(self.console_handler) 50 | 51 | # allow 'INFO' or logging.INFO args 52 | def _cvtlevel(self, level): 53 | if isinstance(level, basestring): 54 | return logging._levelNames[level] 55 | else: 56 | return level 57 | 58 | # logging to file + window - explicitly enabled 59 | def add_file_logger(self, logfile, log_level): 60 | 61 | self.file_handler = logging.FileHandler(logfile, 'w') # recreate 62 | self.file_handler.setFormatter(logging.Formatter("%(levelname)-10s %(module)-15s %(name)-15s %(funcName)-10s %(lineno)-4d: - %(message)s")) 63 | self.file_handler.setLevel(self._cvtlevel(log_level)) 64 | #self.logger.addHandler(self.file_handler) 65 | 66 | def change_file_logging(self, onoff): 67 | if onoff: 68 | if not hasattr(self.logger, 'file_handler'): 69 | self.add_file_logger(g.config.logfile, g.config.file_loglevel) 70 | self.rootlogger.addHandler(self.file_handler) 71 | self.rootlogger.info(self.tr("file logging started at %s", time.asctime())) 72 | else: 73 | self.rootlogger.info(self.tr("file logging stopped at %s", time.asctime())) 74 | self.rootlogger.removeHandler(self.file_handler) 75 | 76 | def add_window_logger(self, log_level): 77 | 78 | self.window_handler = logging.StreamHandler() 79 | if log_level==logging.INFO: 80 | self.window_handler.setFormatter(logging.Formatter("%(message)s")) 81 | else: 82 | self.window_handler.setFormatter(logging.Formatter("%(levelname)s - %(message)s")) 83 | 84 | self.window_handler.setLevel(self._cvtlevel(log_level)) 85 | self.rootlogger.addHandler(self.window_handler) 86 | 87 | def set_window_logstream(self, stream=sys.stderr): 88 | if self.window_handler: 89 | self.window_handler.stream = stream 90 | 91 | def set_window_loglevel(self, log_level): 92 | if self.window_handler: 93 | self.window_handler.setLevel(self._cvtlevel(log_level)) 94 | 95 | def set_file_loglevel(self, log_level): 96 | if self.file_handler: 97 | self.file_handler.setLevel(self._cvtlevel(log_level)) 98 | 99 | def set_console_loglevel(self, log_level): 100 | if self.console_handler: 101 | self.console_handler.setLevel(self._cvtlevel(log_level)) 102 | 103 | 104 | 105 | class FilterModule(logging.Filter): 106 | def filter(self, record): 107 | return True 108 | 109 | -------------------------------------------------------------------------------- /source/Core/Point.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/Core/Point.py -------------------------------------------------------------------------------- /source/Core/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/Core/constants.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/Core/constants.py -------------------------------------------------------------------------------- /source/DXF2GCODE-001.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/DXF2GCODE-001.ico -------------------------------------------------------------------------------- /source/DxfImport/Classes.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/DxfImport/Classes.py -------------------------------------------------------------------------------- /source/DxfImport/GeoentArc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/DxfImport/GeoentArc.py -------------------------------------------------------------------------------- /source/DxfImport/GeoentCircle.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: cp1252 -*- 3 | # 4 | #dxf2gcode_b02_geoent_circle 5 | #Programmers: Christian Kohl�ffel 6 | # Vinzenz Schulz 7 | # 8 | #Distributed under the terms of the GPL (GNU Public License) 9 | # 10 | #dxf2gcode is free software; you can redistribute it and/or modify 11 | #it under the terms of the GNU General Public License as published by 12 | #the Free Software Foundation; either version 2 of the License, or 13 | #(at your option) any later version. 14 | # 15 | #This program is distributed in the hope that it will be useful, 16 | #but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | #GNU General Public License for more details. 19 | # 20 | #You should have received a copy of the GNU General Public License 21 | #along with this program; if not, write to the Free Software 22 | #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | 24 | from math import sin, cos, pi 25 | from PyQt4 import QtCore, QtGui 26 | 27 | from Core.Point import Point 28 | from DxfImport.Classes import ContourClass 29 | from Core.ArcGeo import ArcGeo 30 | 31 | import logging 32 | logger=logging.getLogger("DXFImport.GeoentCircle") 33 | 34 | class GeoentCircle(QtCore.QObject): 35 | def __init__(self, Nr=0, caller=None): 36 | self.Typ = 'Circle' 37 | self.Nr = Nr 38 | self.Layer_Nr = 0 39 | self.length = 0.0 40 | self.geo = [] 41 | 42 | #Lesen der Geometrie 43 | #Read the geometry 44 | self.Read(caller) 45 | 46 | def __str__(self): 47 | # how to print the object 48 | return("\nTyp: Circle ") + \ 49 | ("\nNr: %i" % self.Nr) + \ 50 | ("\nLayer Nr:%i" % self.Layer_Nr) + \ 51 | str(self.geo[-1]) 52 | 53 | def tr(self,string_to_translate): 54 | """ 55 | Translate a string using the QCoreApplication translation framework 56 | @param: string_to_translate: a unicode string 57 | @return: the translated unicode string if it was possible to translate 58 | """ 59 | return unicode(QtGui.QApplication.translate("ReadDXF", 60 | string_to_translate, 61 | None, 62 | QtGui.QApplication.UnicodeUTF8)) 63 | 64 | 65 | def App_Cont_or_Calc_IntPts(self, cont, points, i, tol, warning): 66 | cont.append(ContourClass(len(cont), 1, [[i, 0]], self.length)) 67 | return warning 68 | 69 | def Read(self, caller): 70 | 71 | #K�rzere Namen zuweisen 72 | #Assign short name 73 | lp = caller.line_pairs 74 | e = lp.index_code(0, caller.start + 1) 75 | 76 | 77 | #Layer zuweisen 78 | #Assign layer 79 | s = lp.index_code(8, caller.start + 1) 80 | self.Layer_Nr = caller.Get_Layer_Nr(lp.line_pair[s].value) 81 | #XWert 82 | #X Value 83 | s = lp.index_code(10, s + 1) 84 | x0 = float(lp.line_pair[s].value) 85 | #YWert 86 | #Y Value 87 | s = lp.index_code(20, s + 1) 88 | y0 = float(lp.line_pair[s].value) 89 | 90 | #Radius 91 | s = lp.index_code(40, s + 1) 92 | r = float(lp.line_pair[s].value) 93 | 94 | #Searching for an extrusion direction 95 | s_nxt_xt = lp.index_code(230, s + 1, e) 96 | #If there is a extrusion direction given flip around x-Axis 97 | if s_nxt_xt != None: 98 | extrusion_dir = float(lp.line_pair[s_nxt_xt].value) 99 | logger.debug(self.tr('Found extrusion direction: %s') %extrusion_dir) 100 | if extrusion_dir == -1: 101 | x0=-x0 102 | 103 | O = Point(x0, y0) 104 | 105 | #Berechnen der Start und Endwerte des Kreises ohne �berschneidung 106 | #Calculate the start and end values of the circle without clipping 107 | s_ang = -3 * pi / 4 108 | m_ang = s_ang -pi 109 | e_ang = -3 * pi / 4 110 | 111 | #Berechnen der Start und Endwerte des Arcs 112 | #Calculate the start and end values of the arcs 113 | Pa = Point(x=cos(s_ang) * r, y=sin(s_ang) * r) + O 114 | Pm = Point(x=cos(m_ang) * r, y=sin(m_ang) * r) + O 115 | Pe = Point(x=cos(e_ang) * r, y=sin(e_ang) * r) + O 116 | 117 | #Anh�ngen der ArcGeo Klasse f�r die Geometrie 118 | #Annexes to ArcGeo class for geometry 119 | self.geo.append(ArcGeo(Pa=Pa, Pe=Pm, O=O, r=r, 120 | s_ang=s_ang, e_ang=m_ang, direction=-1)) 121 | self.geo.append(ArcGeo(Pa=Pm, Pe=Pe, O=O, r=r, 122 | s_ang=m_ang, e_ang=e_ang, direction=-1)) 123 | 124 | #L�nge entspricht der L�nge des Kreises 125 | #Length corresponds to the length (circumference?) of the circle 126 | self.length = self.geo[-1].length+self.geo[-2].length 127 | 128 | #Neuen Startwert f�r die n�chste Geometrie zur�ckgeben 129 | #New starting value for the next geometry 130 | caller.start = s 131 | 132 | def get_start_end_points(self, direction=0): 133 | if not(direction): 134 | punkt, angle = self.geo[0].get_start_end_points(direction) 135 | elif direction: 136 | punkt, angle = self.geo[-1].get_start_end_points(direction) 137 | return punkt, angle 138 | -------------------------------------------------------------------------------- /source/DxfImport/GeoentEllipse.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: cp1252 -*- 3 | # 4 | #dxf2gcode_b02_geoent_ellipse 5 | #Programmers: Christian Kohl�ffel 6 | # Vinzenz Schulz 7 | # 8 | #Distributed under the terms of the GPL (GNU Public License) 9 | # 10 | #dxf2gcode is free software; you can redistribute it and/or modify 11 | #it under the terms of the GNU General Public License as published by 12 | #the Free Software Foundation; either version 2 of the License, or 13 | #(at your option) any later version. 14 | # 15 | #This program is distributed in the hope that it will be useful, 16 | #but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | #GNU General Public License for more details. 19 | # 20 | #You should have received a copy of the GNU General Public License 21 | #along with this program; if not, write to the Free Software 22 | #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | 24 | import Core.Globals as g 25 | 26 | from math import sqrt, sin, cos, atan2, degrees, pi 27 | from Core.Point import Point 28 | from DxfImport.Classes import PointsClass, ContourClass 29 | from DxfImport.biarc import BiarcClass 30 | 31 | 32 | 33 | class GeoentEllipse: 34 | def __init__(self, Nr=0, caller=None): 35 | self.Typ = 'Ellipse' 36 | self.Nr = Nr 37 | #Initialisieren der Werte 38 | #Initialise the values 39 | self.Layer_Nr = 0 40 | self.center = Point(0, 0) #Mittelpunkt der Geometrie / Centre of the geometry 41 | self.vector = Point(1, 0) #Vektor A = gro�e Halbachse a, = Drehung der Ellipse 42 | # Vector A = semi-major axis. a = rotation of the ellipse 43 | # http://de.wikipedia.org/wiki/Gro%C3%9Fe_Halbachse 44 | self.ratio = 1 #Verh�ltnis der kleinen zur gro�en Halbachse (b/a) 45 | #Ratio of the minor to major axis (b/a) 46 | #self.AngS = 0 #Startwinkel beim zeichnen eines Ellipsensegments 47 | #Starting angle when drawing an ellipse segment 48 | #self.AngE = radians(360) #Endwinkel (Winkel im DXF als Radians!) 49 | #End angle (angle in radians as DXF!) 50 | #Die folgenden Grundwerte werden sp�ter ein mal berechnet 51 | #The following limits are calculated later 52 | 53 | self.length = 0 54 | self.Points = [] 55 | self.Points.append(self.center) 56 | #Lesen der Geometrie / Read the geometry 57 | self.Read(caller) 58 | 59 | #Zuweisen der Toleranz f�rs Fitting / Assign the tolerance for fitting 60 | tol = g.config.fitting_tolerance 61 | 62 | #Errechnen der Ellipse / Calculate the ellipse 63 | self.Ellipse_Grundwerte() 64 | self.Ellipse_2_Arcs(tol) 65 | 66 | 67 | def __str__(self): 68 | # how to print the object #Geht auch so ellegant wie sprintf in C oder Matlab usw. siehe erste zeile !!!!!!!!!!!!!!!!!!!!!! 69 | # As elegant as printf in C or Matlab etc. see the first line! 70 | s = ('Typ: Ellipse\n') + \ 71 | ('Nr: %i \n' % (self.Nr)) + \ 72 | 'Layer: ' + str(self.Layer_Nr) + '\n' + \ 73 | 'center: ' + str(self.center) + '\n' + \ 74 | 'vector: ' + str(self.vector) + '\n' + \ 75 | 'ratio: ' + str(self.ratio) + '\n' + \ 76 | 'angles: ' + str(degrees(self.AngS)) + ' -> ' + str(degrees(self.AngE)) + '\n' + \ 77 | 'extend: ' + str(degrees(self.ext)) + '\n' + \ 78 | 'a: ' + str(self.a) + '\n' + \ 79 | 'b: ' + str(self.b) + '\n' + \ 80 | 'length: ' + str(self.length) + \ 81 | ("\nNr. of arcs: %i" % len(self.geo)) 82 | return s 83 | 84 | def reverse(self): 85 | self.geo.reverse() 86 | for geo in self.geo: 87 | geo.reverse() 88 | 89 | def App_Cont_or_Calc_IntPts(self, cont, points, i, tol, warning): 90 | #Hinzuf�gen falls es keine geschlossene Polyline ist 91 | #Add if it is not a closed polyline 92 | if self.geo[0].Pa.isintol(self.geo[-1].Pe, tol): 93 | self.analyse_and_opt() 94 | cont.append(ContourClass(len(cont), 1, [[i, 0]], self.length)) 95 | else: 96 | points.append(PointsClass(point_nr=len(points), geo_nr=i, \ 97 | Layer_Nr=self.Layer_Nr, \ 98 | be=self.geo[0].Pa, 99 | en=self.geo[-1].Pe, be_cp=[], en_cp=[])) 100 | return warning 101 | 102 | def Read(self, caller): 103 | #K�rzere Namen zuweisen 104 | #Assign short name 105 | lp = caller.line_pairs 106 | e = lp.index_code(0, caller.start + 1) 107 | #Layer zuweisen 108 | #Assign Layer 109 | s = lp.index_code(8, caller.start + 1) 110 | self.Layer_Nr = caller.Get_Layer_Nr(lp.line_pair[s].value) 111 | #XWert, YWert Center 112 | #Centre X value, Y value 113 | s = lp.index_code(10, s + 1) 114 | x0 = float(lp.line_pair[s].value) 115 | s = lp.index_code(20, s + 1) 116 | y0 = float(lp.line_pair[s].value) 117 | self.center = Point(x0, y0) 118 | #XWert, YWert. Vektor, relativ zum Zentrum, Gro�e Halbachse 119 | #X value, Y value. Vector relative to the center, Semi-major axis 120 | s = lp.index_code(11, s + 1) 121 | x1 = float(lp.line_pair[s].value) 122 | s = lp.index_code(21, s + 1) 123 | y1 = float(lp.line_pair[s].value) 124 | self.vector = Point(x1, y1) 125 | #Ratio minor to major axis 126 | s = lp.index_code(40, s + 1) 127 | self.ratio = float(lp.line_pair[s].value) 128 | #Start Winkel - Achtung, ist als rad (0-2pi) im dxf 129 | #Start angle - Note in radian (0-2pi) per dxf 130 | s = lp.index_code(41, s + 1) 131 | self.AngS = float(lp.line_pair[s].value) 132 | #End Winkel - Achtung, ist als rad (0-2pi) im dxf 133 | #End angle - Note in radian (0-2pi) per dxf 134 | s = lp.index_code(42, s + 1) 135 | self.AngE = float(lp.line_pair[s].value) 136 | #Neuen Startwert f�r die n�chste Geometrie zur�ckgeben 137 | #New starting value for the next geometry return 138 | caller.start = e 139 | 140 | 141 | def analyse_and_opt(self): 142 | #Richtung in welcher der Anfang liegen soll (unten links) 143 | #Direction of top (lower left) ??? 144 | Popt = Point(x= -1e3, y= -1e6) 145 | 146 | #Suchen des kleinsten Startpunkts von unten Links X zuerst (Muss neue Schleife sein!) 147 | #Find the smallest starting point from bottom left X (Must be new loop!) 148 | min_distance = self.geo[0].Pa.distance(Popt) 149 | min_geo_nr = 0 150 | for geo_nr in range(1, len(self.geo)): 151 | if (self.geo[geo_nr].Pa.distance(Popt) < min_distance): 152 | min_distance = self.geo[geo_nr].Pa.distance(Popt) 153 | min_geo_nr = geo_nr 154 | 155 | #Kontur so anordnen das neuer Startpunkt am Anfang liegt 156 | #Contour so the new starting point is at the start order 157 | self.geo = self.geo[min_geo_nr:len(self.geo)] + self.geo[0:min_geo_nr] 158 | 159 | def get_start_end_points(self, direction=0): 160 | if not(direction): 161 | punkt, angle = self.geo[0].get_start_end_points(direction) 162 | elif direction: 163 | punkt, angle = self.geo[-1].get_start_end_points(direction) 164 | return punkt, angle 165 | 166 | def Ellipse_2_Arcs(self, tol): 167 | #Anfangswert f�r Anzahl Elemente 168 | #Initial value for number of elements 169 | num_elements = 2 170 | intol = False 171 | 172 | #print degrees(self.AngS) 173 | #print tol 174 | 175 | while not(intol): 176 | intol = True 177 | 178 | #Anfangswete Ausrechnen 179 | #Calculate Anfangswete ??? 180 | angle = self.AngS 181 | Pa = self.Ellipse_Point(angle) 182 | tana = self.Ellipse_Tangent(angle) 183 | 184 | self.geo = [] 185 | self.PtsVec = [] 186 | self.PtsVec.append([Pa, tana]) 187 | 188 | 189 | for sec in range(num_elements): 190 | #Schrittweite errechnen 191 | #Calculate Increment 192 | step = self.ext / num_elements 193 | 194 | #print degrees(step) 195 | 196 | #Endwerte errechnen 197 | #Calculate final values 198 | Pb = self.Ellipse_Point(angle + step) 199 | tanb = self.Ellipse_Tangent(angle + step) 200 | 201 | #Biarc erstellen und an geo anh�ngen 202 | #Biarc create and attach them ??? 203 | biarcs = BiarcClass(Pa, tana, Pb, tanb, tol / 100) 204 | self.geo += biarcs.geos[:] 205 | 206 | #Letzer Wert = Startwert 207 | #Last value = Start value 208 | Pa = Pb 209 | tana = tanb 210 | 211 | self.PtsVec.append([Pa, tana]) 212 | 213 | if not(self.check_ellipse_fitting_tolerance(biarcs, tol, angle, angle + step)): 214 | intol = False 215 | num_elements += 1 216 | break 217 | 218 | #Neuer Winkel errechnen 219 | #Calculate new angle 220 | angle += step 221 | #print degrees(angle) 222 | #print self 223 | 224 | 225 | 226 | def check_ellipse_fitting_tolerance(self, biarc, tol, ang0, ang1): 227 | check_step = (ang1 - ang0) / 4 228 | check_ang = [] 229 | check_Pts = [] 230 | fit_error = [] 231 | 232 | for i in range(1, 4): 233 | check_ang.append(ang0 + check_step * i) 234 | check_Pts.append(self.Ellipse_Point(check_ang[-1])) 235 | fit_error.append(biarc.get_biarc_fitting_error(check_Pts[-1])) 236 | 237 | if max(fit_error) >= tol: 238 | return 0 239 | else: 240 | return 1 241 | 242 | def Ellipse_Grundwerte(self): 243 | #Weitere Grundwerte der Ellipse, die nur einmal ausgerechnet werden m�ssen 244 | #Other values of the ellipse that are calculated only once 245 | self.rotation = atan2(self.vector.y, self.vector.x) 246 | self.a = sqrt(self.vector.x ** 2 + self.vector.y ** 2) 247 | self.b = self.a * self.ratio 248 | 249 | #Aus dem Vorzeichen von dir den extend ausrechnen 250 | #Calculate angle to extend 251 | self.ext = self.AngE - self.AngS 252 | #self.ext=self.ext%(-2*pi) 253 | #self.ext-=floor(self.ext/(2*pi))*(2*pi) 254 | 255 | def Ellipse_Point(self, alpha=0):#Point(0,0) 256 | #gro�e Halbachse, kleine Halbachse, rotation der Ellipse (rad), Winkel des Punkts in der Ellipse (rad) 257 | #Semi-major axis, minor axis, rotation of the ellipse (rad), the point in the ellipse angle (rad) ??? 258 | Ex = self.a * cos(alpha) * cos(self.rotation) - self.b * sin(alpha) * sin(self.rotation); 259 | Ey = self.a * cos(alpha) * sin(self.rotation) + self.b * sin(alpha) * cos(self.rotation); 260 | return Point(self.center.x + Ex, self.center.y + Ey) 261 | 262 | def Ellipse_Tangent(self, alpha=0):#Point(0,0) 263 | #gro�e Halbachse, kleine Halbachse, rotation der Ellipse (rad), Winkel des Punkts in der Ellipse (rad) 264 | #Semi-major axis, minor axis, rotation of the ellipse (rad), the point in the ellipse angle (rad) ??? 265 | phi = atan2(self.a * sin(alpha), self.b * cos(alpha)) + self.rotation + pi / 2 266 | return phi 267 | -------------------------------------------------------------------------------- /source/DxfImport/GeoentInsert.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: cp1252 -*- 3 | # 4 | #dxf2gcode_b02_geoent_insert 5 | #Programmers: Christian Kohl�ffel 6 | # Vinzenz Schulz 7 | # 8 | #Distributed under the terms of the GPL (GNU Public License) 9 | # 10 | #dxf2gcode is free software; you can redistribute it and/or modify 11 | #it under the terms of the GNU General Public License as published by 12 | #the Free Software Foundation; either version 2 of the License, or 13 | #(at your option) any later version. 14 | # 15 | #This program is distributed in the hope that it will be useful, 16 | #but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | #GNU General Public License for more details. 19 | # 20 | #You should have received a copy of the GNU General Public License 21 | #along with this program; if not, write to the Free Software 22 | #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | 24 | from Core.Point import Point 25 | from DxfImport.Classes import ContourClass 26 | from math import degrees, radians 27 | 28 | class GeoentInsert: 29 | def __init__(self, Nr=0, caller=None): 30 | self.Typ = 'Insert' 31 | self.Nr = Nr 32 | 33 | #Initialisieren der Werte 34 | #Initialise the values 35 | self.Layer_Nr = 0 36 | self.BlockName = '' 37 | self.Point = [] 38 | self.Scale = [1, 1, 1] 39 | self.rot = 0.0 40 | self.length = 0.0 41 | 42 | #Lesen der Geometrie 43 | #Red the geometry 44 | self.Read(caller) 45 | 46 | 47 | def __str__(self): 48 | # how to print the object 49 | return '\nTyp: Insert' + \ 50 | '\nNr: %i' % self.Nr + \ 51 | '\nLayer Nr: %i' % self.Layer_Nr + \ 52 | '\nBlockName: %s' % self.BlockName + \ 53 | '\nPoint: %s' % self.Point + \ 54 | '\nrot: %0.2f' % degrees(self.rot) + \ 55 | '\nScale: %s' % self.Scale 56 | 57 | def App_Cont_or_Calc_IntPts(self, cont, points, i, tol, warning): 58 | 59 | cont.append(ContourClass(len(cont), 0, [[i, 0]], 0)) 60 | return warning 61 | 62 | 63 | def Read(self, caller): 64 | #K�rzere Namen zuweisen 65 | #Assign short name 66 | lp = caller.line_pairs 67 | e = lp.index_code(0, caller.start + 1) 68 | 69 | #Block Name 70 | ind = lp.index_code(2, caller.start + 1, e) 71 | #print lp.line_pair[ind].value #################################################################### 72 | self.BlockName = lp.line_pair[ind].value 73 | #Layer zuweisen 74 | #Assign layer 75 | s = lp.index_code(8, caller.start + 1, e) 76 | self.Layer_Nr = caller.Get_Layer_Nr(lp.line_pair[s].value) 77 | #XWert 78 | #X Value 79 | s = lp.index_code(10, s + 1, e) 80 | x0 = float(lp.line_pair[s].value) 81 | #YWert 82 | #Y Value 83 | s = lp.index_code(20, s + 1, e) 84 | y0 = float(lp.line_pair[s].value) 85 | self.Point = Point(x0, y0) 86 | 87 | #XScale 88 | s_temp = lp.index_code(41, s + 1, e) 89 | if s_temp != None: 90 | self.Scale[0] = float(lp.line_pair[s_temp].value) 91 | #YScale 92 | s_temp = lp.index_code(42, s + 1, e) 93 | if s_temp != None: 94 | self.Scale[1] = float(lp.line_pair[s_temp].value) 95 | #ZScale 96 | s_temp = lp.index_code(43, s + 1, e) 97 | if s_temp != None: 98 | self.Scale[2] = float(lp.line_pair[s_temp].value) 99 | 100 | #Rotation 101 | s_temp = lp.index_code(50, s + 1, e) 102 | if s_temp != None: 103 | self.rot = radians(float(lp.line_pair[s_temp].value)) 104 | 105 | 106 | #Neuen Startwert f�r die n�chste Geometrie zur�ckgeben 107 | #New starting value for the next geometry 108 | caller.start = e 109 | 110 | -------------------------------------------------------------------------------- /source/DxfImport/GeoentLine.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/DxfImport/GeoentLine.py -------------------------------------------------------------------------------- /source/DxfImport/GeoentLwpolyline.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/DxfImport/GeoentLwpolyline.py -------------------------------------------------------------------------------- /source/DxfImport/GeoentPolyline.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/DxfImport/GeoentPolyline.py -------------------------------------------------------------------------------- /source/DxfImport/GeoentSpline.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: cp1252 -*- 3 | # 4 | #dxf2gcode_b02_geoent_spline 5 | #Programmers: Christian Kohl�ffel 6 | # Vinzenz Schulz 7 | # 8 | #Distributed under the terms of the GPL (GNU Public License) 9 | # 10 | #dxf2gcode is free software; you can redistribute it and/or modify 11 | #it under the terms of the GNU General Public License as published by 12 | #the Free Software Foundation; either version 2 of the License, or 13 | #(at your option) any later version. 14 | # 15 | #This program is distributed in the hope that it will be useful, 16 | #but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | #GNU General Public License for more details. 19 | # 20 | #You should have received a copy of the GNU General Public License 21 | #along with this program; if not, write to the Free Software 22 | #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | 24 | import Core.Globals as g 25 | 26 | from DxfImport.SplineConvert import Spline2Arcs 27 | from Core.Point import Point 28 | from DxfImport.Classes import PointsClass, ContourClass 29 | 30 | class GeoentSpline: 31 | def __init__(self, Nr=0, caller=None): 32 | self.Typ = 'Spline' 33 | self.Nr = Nr 34 | 35 | #Initialisieren der Werte 36 | #Initialise the values 37 | self.Layer_Nr = 0 38 | self.Spline_flag = [] 39 | self.degree = 1 40 | self.Knots = [] 41 | self.Weights = [] 42 | self.CPoints = [] 43 | self.geo = [] 44 | self.length = 0.0 45 | 46 | #Lesen der Geometrie 47 | #Read the geometry 48 | self.Read(caller) 49 | 50 | #Zuweisen der Toleranz f�rs Fitting 51 | #Assign the fitting tolerance 52 | tol = g.config.fitting_tolerance 53 | check = g.config.vars.Import_Parameters['spline_check'] 54 | 55 | #Umwandeln zu einem ArcSpline 56 | #Convert to a ArcSpline 57 | Spline2ArcsClass = Spline2Arcs(degree=self.degree, Knots=self.Knots, \ 58 | Weights=self.Weights, CPoints=self.CPoints, tol=tol, check=check) 59 | 60 | 61 | self.geo = Spline2ArcsClass.Curve 62 | 63 | for geo in self.geo: 64 | self.length += geo.length 65 | 66 | def __str__(self): 67 | # how to print the object 68 | s = ('\nTyp: Spline') + \ 69 | ('\nNr: %i' % self.Nr) + \ 70 | ('\nLayer Nr: %i' % self.Layer_Nr) + \ 71 | ('\nSpline flag: %i' % self.Spline_flag) + \ 72 | ('\ndegree: %i' % self.degree) + \ 73 | ('\nlength: %0.3f' % self.length) + \ 74 | ('\nGeo elements: %i' % len(self.geo)) + \ 75 | ('\nKnots: %s' % self.Knots) + \ 76 | ('\nWeights: %s' % self.Weights) + \ 77 | ('\nCPoints: ') 78 | 79 | for Point in self.CPoints: 80 | s = s + "\n" + str(Point) 81 | s += ('\ngeo: ') 82 | 83 | return s 84 | 85 | def reverse(self): 86 | self.geo.reverse() 87 | for geo in self.geo: 88 | geo.reverse() 89 | 90 | def App_Cont_or_Calc_IntPts(self, cont, points, i, tol, warning): 91 | #Hinzuf�gen falls es keine geschlossener Spline ist 92 | #Add if it is not a closed spline 93 | if self.CPoints[0].isintol(self.CPoints[-1], tol): 94 | self.analyse_and_opt() 95 | cont.append(ContourClass(len(cont), 1, [[i, 0]], self.length)) 96 | else: 97 | points.append(PointsClass(point_nr=len(points), geo_nr=i, \ 98 | Layer_Nr=self.Layer_Nr, \ 99 | be=self.geo[0].Pa, \ 100 | en=self.geo[-1].Pe, \ 101 | be_cp=[], en_cp=[])) 102 | return warning 103 | 104 | def analyse_and_opt(self): 105 | summe = 0 106 | 107 | #Richtung in welcher der Anfang liegen soll (unten links) 108 | #Direction of the top (lower left) ??? 109 | Popt = Point(x= -1e3, y= -1e6) 110 | 111 | #Berechnung der Fl�ch nach Gau�-Elling Positive Wert bedeutet CW 112 | #negativer Wert bedeutet CCW geschlossenes Polygon 113 | #Calculation of the alignment after Gaussian-Elling 114 | #Positive value means CW, negative value indicates CCW 115 | #closed polygon 116 | for Line in self.geo: 117 | summe += (Line.Pa.x * Line.Pe.y - Line.Pe.x * Line.Pa.y) / 2 118 | 119 | if summe > 0.0: 120 | self.reverse() 121 | 122 | #Suchen des kleinsten Startpunkts von unten Links X zuerst (Muss neue Schleife sein!) 123 | #Find the smallest starting point from bottom left X (Must be new loop!) 124 | min_distance = self.geo[0].Pa.distance(Popt) 125 | min_geo_nr = 0 126 | for geo_nr in range(1, len(self.geo)): 127 | if (self.geo[geo_nr].Pa.distance(Popt) < min_distance): 128 | min_distance = self.geo[geo_nr].Pa.distance(Popt) 129 | min_geo_nr = geo_nr 130 | 131 | #Kontur so anordnen das neuer Startpunkt am Anfang liegt 132 | #Order contour so the new starting point is at the beginning 133 | self.geo = self.geo[min_geo_nr:len(self.geo)] + self.geo[0:min_geo_nr] 134 | 135 | def Read(self, caller): 136 | 137 | #K�rzere Namen zuweisen 138 | #Assign short name 139 | lp = caller.line_pairs 140 | e = lp.index_code(0, caller.start + 1) 141 | 142 | #Layer zuweisen 143 | #Assign layer 144 | s = lp.index_code(8, caller.start + 1) 145 | self.Layer_Nr = caller.Get_Layer_Nr(lp.line_pair[s].value) 146 | 147 | #Spline Flap zuweisen 148 | #Assign Spline Flap 149 | s = lp.index_code(70, s + 1) 150 | self.Spline_flag = int(lp.line_pair[s].value) 151 | 152 | #Spline Ordnung zuweisen 153 | #Spline order to assign 154 | s = lp.index_code(71, s + 1) 155 | self.degree = int(lp.line_pair[s].value) 156 | 157 | #Number of CPts 158 | st = lp.index_code(73, s + 1) 159 | nCPts = int(lp.line_pair[s].value) 160 | 161 | 162 | s = st 163 | #Lesen der Knoten 164 | #Read the node 165 | while 1: 166 | #Knoten Wert 167 | #Node value 168 | sk = lp.index_code(40, s + 1, e) 169 | if sk == None: 170 | break 171 | self.Knots.append(float(lp.line_pair[sk].value)) 172 | s = sk 173 | 174 | #Lesen der Gewichtungen 175 | #Read the weights 176 | s = st 177 | while 1: 178 | #Knoten Gewichtungen 179 | #Node weights 180 | sg = lp.index_code(41, s + 1, e) 181 | if sg == None: 182 | break 183 | self.Weights.append(float(lp.line_pair[sg].value)) 184 | s = sg 185 | 186 | 187 | #Lesen der Kontrollpunkte 188 | #Read the control points 189 | s = st 190 | while 1: 191 | #XWert 192 | #X value 193 | s = lp.index_code(10, s + 1, e) 194 | #Wenn kein neuer Punkt mehr gefunden wurde abbrechen ... 195 | #Cancel if no new item was detected 196 | if s == None: 197 | break 198 | 199 | x = float(lp.line_pair[s].value) 200 | #YWert 201 | #Y value 202 | s = lp.index_code(20, s + 1, e) 203 | y = float(lp.line_pair[s].value) 204 | 205 | self.CPoints.append(Point(x, y)) 206 | 207 | if len(self.Weights) == 0: 208 | for nr in range(len(self.CPoints)): 209 | self.Weights.append(1) 210 | 211 | 212 | caller.start = e 213 | # print nCPts 214 | # print len(self.Knots) 215 | # print len(self.Weights) 216 | # print len(self.CPoints) 217 | # print self 218 | 219 | 220 | def get_start_end_points(self, direction=0): 221 | if not(direction): 222 | punkt, angle = self.geo[0].get_start_end_points(direction) 223 | elif direction: 224 | punkt, angle = self.geo[-1].get_start_end_points(direction) 225 | 226 | return punkt, angle 227 | -------------------------------------------------------------------------------- /source/DxfImport/Import.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/DxfImport/Import.py -------------------------------------------------------------------------------- /source/DxfImport/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/DxfImport/biarc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/DxfImport/biarc.py -------------------------------------------------------------------------------- /source/Gui/AboutDialog.py: -------------------------------------------------------------------------------- 1 | from PyQt4 import QtGui, QtCore 2 | import logging 3 | logger=logging.getLogger("Gui.AboutDialog") 4 | 5 | class myAboutDialog(QtGui.QDialog): 6 | 7 | def __init__(self,title="Test",message="Test Text"): 8 | super(myAboutDialog, self).__init__() 9 | 10 | self.title=title 11 | self.message=message 12 | 13 | self.initUI() 14 | 15 | def initUI(self): 16 | 17 | vbox = QtGui.QVBoxLayout(self) 18 | grid1 = QtGui.QGridLayout() 19 | grid1.setSpacing(10) 20 | 21 | self.text=QtGui.QTextBrowser() 22 | self.text.setReadOnly(True) 23 | self.text.setOpenExternalLinks(True) 24 | self.text.append(self.message) 25 | self.text.moveCursor(QtGui.QTextCursor.Start) 26 | self.text.ensureCursorVisible() 27 | 28 | vbox.addWidget(self.text) 29 | 30 | self.setLayout(vbox) 31 | self.setMinimumSize(550, 450) 32 | self.setGeometry(200, 150, 550, 800) 33 | self.setWindowTitle(self.title) 34 | 35 | self.exec_() 36 | 37 | -------------------------------------------------------------------------------- /source/Gui/Arrow.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # 4 | #dxf2gcode_b02_point 5 | #Programmers: Christian Kohlöffel 6 | # Vinzenz Schulz 7 | # 8 | #Distributed under the terms of the GPL (GNU Public License) 9 | # 10 | #dxf2gcode is free software; you can redistribute it and/or modify 11 | #it under the terms of the GNU General Public License as published by 12 | #the Free Software Foundation; either version 2 of the License, or 13 | #(at your option) any later version. 14 | # 15 | #This program is distributed in the hope that it will be useful, 16 | #but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | #GNU General Public License for more details. 19 | # 20 | #You should have received a copy of the GNU General Public License 21 | #along with this program; if not, write to the Free Software 22 | #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 | 24 | 25 | from math import sin, cos, acos, radians, pi 26 | from Core.Point import Point 27 | 28 | from PyQt4 import QtCore, QtGui 29 | 30 | import logging 31 | logger=logging.getLogger("Gui.Arrow") 32 | 33 | 34 | class Arrow(QtGui.QGraphicsLineItem): 35 | def __init__(self, startp=Point(x=0.0,y=0.0), endp=None, 36 | length=60.0, angle=50.0, 37 | color=QtCore.Qt.red,pencolor=QtCore.Qt.green, 38 | dir=0): 39 | """ 40 | Initialisation of the class. 41 | """ 42 | self.sc=1 43 | super(Arrow, self).__init__() 44 | 45 | self.startp = QtCore.QPointF(startp.x,-startp.y) 46 | self.endp = endp 47 | 48 | self.length=length 49 | self.angle=angle 50 | self.dir=dir 51 | self.allwaysshow=False 52 | 53 | 54 | self.arrowHead = QtGui.QPolygonF() 55 | self.setFlag(QtGui.QGraphicsItem.ItemIsSelectable, False) 56 | self.myColor=color 57 | self.pen=QtGui.QPen(pencolor, 1, QtCore.Qt.SolidLine, 58 | QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin) 59 | self.arrowSize = 8.0 60 | 61 | self.pen.setCosmetic(True) 62 | 63 | def setSelected(self,flag=True): 64 | """ 65 | Override inherited function to turn off selection of Arrows. 66 | @param flag: The flag to enable or disable Selection 67 | """ 68 | if self.allwaysshow: 69 | pass 70 | elif flag is True: 71 | self.show() 72 | else: 73 | self.hide() 74 | 75 | self.update(self.boundingRect()) 76 | 77 | def reverseshape(self,startp,angle): 78 | """ 79 | Method is called when the shape direction is changed and therefore the 80 | arrow gets new Point and direction 81 | @param startp: The new startpoint 82 | @param angle: The new angle of the arrow 83 | """ 84 | self.startp=QtCore.QPointF(startp.x,-startp.y) 85 | self.angle=angle 86 | self.update(self.boundingRect()) 87 | 88 | def setallwaysshow(self,flag=False): 89 | """ 90 | If the directions shall be allwaysshown the parameter will be set and 91 | all paths will be shown. 92 | @param flag: The flag to enable or disable Selection 93 | """ 94 | self.allwaysshow=flag 95 | if flag is True: 96 | self.show() 97 | elif flag is True and self.isSelected(): 98 | self.show() 99 | else: 100 | self.hide() 101 | self.update(self.boundingRect()) 102 | 103 | def updatepos(self,startp,endp=None, angle=None): 104 | """ 105 | Method to update the position after optimisation of the shape. 106 | """ 107 | self.prepareGeometryChange() 108 | self.startp = QtCore.QPointF(startp.x,-startp.y) 109 | self.endp = endp 110 | self.angle = angle 111 | 112 | def paint(self, painter, option, widget=None): 113 | """ 114 | Method for painting the arrow. 115 | """ 116 | 117 | demat=painter.deviceTransform() 118 | self.sc=demat.m11() 119 | 120 | if self.endp is None: 121 | dx = cos(self.angle) * self.length/self.sc 122 | dy = sin(self.angle) * self.length/self.sc 123 | 124 | endp=QtCore.QPointF(self.startp.x()+dx,self.startp.y()-dy) 125 | else: 126 | endp=QtCore.QPointF(self.endp.x, -self.endp.y) 127 | 128 | arrowSize=self.arrowSize/self.sc 129 | 130 | painter.setPen(self.pen) 131 | painter.setBrush(self.myColor) 132 | 133 | self.setLine(QtCore.QLineF(endp,self.startp)) 134 | line = self.line() 135 | 136 | angle = acos(line.dx() / line.length()) 137 | # try: 138 | # angle = acos(line.dx() / line.length()) 139 | # except ZeroDivisionError: #FIXME : added by Xavier because the file "problem_with_arc_and_problem_with_G41-G42_auto_switch.dxf" throw a division by zero error 140 | # return 141 | 142 | if line.dy() >= 0: 143 | angle = (pi * 2.0) - angle 144 | 145 | if self.dir==0: 146 | arrowP1 = line.p1() + QtCore.QPointF(sin(angle + pi / 3.0) * arrowSize, 147 | cos(angle + pi / 3) * arrowSize) 148 | arrowP2 = line.p1() + QtCore.QPointF(sin(angle + pi - pi / 3.0) * arrowSize, 149 | cos(angle + pi - pi / 3.0) * arrowSize) 150 | self.arrowHead.clear() 151 | for Point in [line.p1(), arrowP1, arrowP2]: 152 | self.arrowHead.append(Point) 153 | 154 | else: 155 | arrowP1 = line.p2() - QtCore.QPointF(sin(angle + pi / 3.0) * arrowSize, 156 | cos(angle + pi / 3) * arrowSize) 157 | arrowP2 = line.p2() - QtCore.QPointF(sin(angle + pi - pi / 3.0) * arrowSize, 158 | cos(angle + pi - pi / 3.0) * arrowSize) 159 | self.arrowHead.clear() 160 | for Point in [line.p2(), arrowP1, arrowP2]: 161 | self.arrowHead.append(Point) 162 | 163 | 164 | 165 | painter.drawLine(line) 166 | painter.drawPolygon(self.arrowHead) 167 | 168 | 169 | def boundingRect(self): 170 | """ 171 | Override inherited function to enlarge selection of Arrow to include all 172 | @param flag: The flag to enable or disable Selection 173 | """ 174 | 175 | #print("super: %s" %super(Arrow, self).boundingRect()) 176 | arrowSize=self.arrowSize*self.sc 177 | extra = (arrowSize) / 2.0 #self.pen.width() + 178 | 179 | if self.endp is None: 180 | dx = cos(self.angle) * self.length/self.sc 181 | dy = sin(self.angle) * self.length/self.sc 182 | 183 | endp=QtCore.QPointF(self.startp.x()+dx,self.startp.y()-dy) 184 | else: 185 | endp=QtCore.QPointF(self.endp.x, -self.endp.y) 186 | 187 | brect= QtCore.QRectF(self.startp, 188 | QtCore.QSizeF(endp.x()-self.startp.x(), 189 | endp.y()-self.startp.y())).normalized().adjusted(-extra, -extra, extra, extra) 190 | return brect 191 | 192 | -------------------------------------------------------------------------------- /source/Gui/Dialog.py: -------------------------------------------------------------------------------- 1 | from PyQt4 import QtGui, QtCore 2 | import logging 3 | logger=logging.getLogger("Gui.Dialog") 4 | 5 | class myDialog(QtGui.QDialog): 6 | 7 | def __init__(self,title="Test",label=('Value1'),value=(1.0)): 8 | super(myDialog, self).__init__() 9 | 10 | 11 | logger.debug(title) 12 | logger.debug(label) 13 | logger.debug(value) 14 | 15 | self.title=title 16 | self.label=label 17 | self.value=value 18 | 19 | self.result=None 20 | 21 | if not(len(label)==len(value)): 22 | raise Exception, "Number of labels different to number of values" 23 | 24 | self.initUI() 25 | 26 | def initUI(self): 27 | 28 | vbox = QtGui.QVBoxLayout(self) 29 | 30 | top = QtGui.QFrame(self) 31 | top.setFrameShape(QtGui.QFrame.StyledPanel) 32 | 33 | bottom = QtGui.QFrame(self) 34 | bottom.setFrameShape(QtGui.QFrame.StyledPanel) 35 | 36 | 37 | grid1 = QtGui.QGridLayout() 38 | grid1.setSpacing(10) 39 | self.lineLabel=[] 40 | self.lineEdit=[] 41 | 42 | for i in range(len(self.label)): 43 | self.lineLabel.append(QtGui.QLabel(self.label[i])) 44 | self.lineEdit.append(QtGui.QLineEdit('%s' %self.value[i])) 45 | 46 | grid1.addWidget(self.lineLabel[i], i, 0) 47 | grid1.addWidget(self.lineEdit[i], i, 1) 48 | 49 | top.setLayout(grid1) 50 | 51 | grid2 = QtGui.QGridLayout() 52 | grid2.setSpacing(5) 53 | 54 | okButton = QtGui.QPushButton("OK") 55 | cancelButton = QtGui.QPushButton("Cancel") 56 | 57 | okButton.clicked.connect(self.cbOK) 58 | cancelButton.clicked.connect(self.cbCancel) 59 | 60 | grid2.addWidget(okButton, 0, 0) 61 | grid2.addWidget(cancelButton, 0, 1) # 5, 1 62 | 63 | bottom.setLayout(grid2) 64 | 65 | vbox.addWidget(top) 66 | vbox.addWidget(bottom) 67 | 68 | self.setLayout(vbox) 69 | 70 | self.setGeometry(300, 300, 50, 50) 71 | self.setWindowTitle(self.title) 72 | 73 | self.exec_() 74 | 75 | def cbOK(self): 76 | 77 | self.result=[] 78 | for lineEdit in self.lineEdit: 79 | self.result.append(lineEdit.text()) 80 | self.close() 81 | 82 | def cbCancel(self): 83 | logger.debug('Cancel') 84 | self.close() 85 | 86 | -------------------------------------------------------------------------------- /source/Gui/RouteText.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/Gui/RouteText.py -------------------------------------------------------------------------------- /source/Gui/StMove.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/Gui/StMove.py -------------------------------------------------------------------------------- /source/Gui/WpZero.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/Gui/WpZero.py -------------------------------------------------------------------------------- /source/Gui/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/Gui/myMessageBox.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Special purpose canvas including all required plotting function etc. 4 | @newfield purpose: Purpose 5 | @newfield sideeffect: Side effect, Side effects 6 | 7 | @purpose: Plotting all 8 | @author: Christian Kohl�ffel 9 | @since: 22.04.2011 10 | @license: GPL 11 | """ 12 | from PyQt4 import QtCore, QtGui 13 | import Core.Globals as g 14 | import Core.constants as c 15 | 16 | class myMessageBox(QtGui.QTextBrowser): 17 | """ 18 | The myMessageBox Class performs the write functions in the Message Window. 19 | The previous defined MyMessageBox_org class is used as output (Within ui). 20 | @sideeffect: None 21 | """ 22 | 23 | def __init__(self, origobj): 24 | """ 25 | Initialization of the myMessageBox class. 26 | @param origobj: This is the reference to to parent class initialized 27 | previously. 28 | """ 29 | super(myMessageBox, self).__init__() 30 | self.setOpenExternalLinks(True) 31 | 32 | self.append("You are using DXF2GCODE") 33 | self.append("Version %s (%s)" %(c.VERSION,c.DATE)) 34 | self.append("For more information und updates visit:") 35 | self.append("http://code.google.com/p/dxf2gcode") 36 | 37 | def write(self,charstr): 38 | """ 39 | The function is called by the window logger to write the log message to 40 | the Messagebox 41 | @param charstr: The log message which will be written. 42 | """ 43 | 44 | self.append(charstr[0:-1]) 45 | self.verticalScrollBar().setValue(1e9) 46 | -------------------------------------------------------------------------------- /source/PostPro/PostProcessorConfig.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | @newfield purpose: Purpose 5 | @newfield sideeffect: Side effect, Side effects 6 | 7 | @purpose: TBD 8 | 9 | @author: Christian Kohl�ffel 10 | @since: 26.12.2009 11 | @license: GPL 12 | """ 13 | 14 | import os 15 | 16 | from Core.configobj import ConfigObj,flatten_errors 17 | from Core.validate import Validator 18 | 19 | #from dotdictlookup import DictDotLookup 20 | import time 21 | 22 | import Core.constants as c 23 | import Core.Globals as g 24 | from d2gexceptions import * 25 | 26 | from PyQt4 import QtCore, QtGui 27 | 28 | import logging 29 | logger = logging.getLogger("PostPro.PostProcessorConfig") 30 | 31 | POSTPRO_VERSION = "2" 32 | """ 33 | version tag - increment this each time you edit CONFIG_SPEC 34 | 35 | compared to version number in config file so 36 | old versions are recognized and skipped" 37 | """ 38 | 39 | POSTPRO_SPEC = str(''' 40 | # Section and variable names must be valid Python identifiers 41 | # do not use whitespace in names 42 | 43 | # do not edit the following section name: 44 | [Version] 45 | 46 | # do not edit the following value: 47 | config_version = string(default="''' + \ 48 | str(POSTPRO_VERSION) + '")\n' + \ 49 | ''' 50 | [General] 51 | output_format = string(default=".ngx") 52 | output_text = string(default="G-CODE for EMC2") 53 | output_type = string(default="g-code") 54 | comments = boolean(default=False) 55 | 56 | abs_export = boolean(default=True) 57 | cancel_cc_for_depth = boolean(default=False) 58 | cc_outside_the_piece = boolean(default=True) 59 | export_ccw_arcs_only = boolean(default=False) 60 | max_arc_radius = float(default=10000) 61 | 62 | 63 | code_begin=string(default="G21 (Unit in mm) G90 (Absolute distance mode) G64 P0.01 (Exact Path 0.001 tol.) G17 G40 (Cancel diameter comp.) G49 (Cancel length comp.)") 64 | code_end=string(default="M2 (Prgram end)") 65 | 66 | [Number_Format] 67 | pre_decimals = integer(default=1) 68 | post_decimals = integer(default=3) 69 | decimal_seperator = string(default=".") 70 | pre_decimal_zero_padding = boolean(default=False) 71 | post_decimal_zero_padding = boolean(default=True) 72 | signed_values = boolean(default=False) 73 | 74 | [Line_Numbers] 75 | use_line_nrs = boolean(default=False) 76 | line_nrs_begin = integer(default=10) 77 | line_nrs_step = integer(default=10) 78 | 79 | [Program] 80 | tool_change = string(default=T%tool_nr M6%nlS%speed%nl) 81 | feed_change = string(default=F%feed%nl) 82 | rap_pos_plane = string(default=G0 X%XE Y%YE%nl) 83 | rap_pos_depth = string(default=G0 Z%ZE %nl) 84 | lin_mov_plane = string(default= G1 X%XE Y%YE%nl) 85 | lin_mov_depth = string(default= G1 Z%ZE%nl) 86 | arc_int_cw = string(default=G2 X%XE Y%YE I%I J%J%nl) 87 | arc_int_ccw = string(default=G3 X%XE Y%YE I%I J%J%nl) 88 | cutter_comp_off = string(default=G40%nl) 89 | cutter_comp_left = string(default=G41%nl) 90 | cutter_comp_right = string(default=G42%nl) 91 | pre_shape_cut= string(default=M3 M8%nl) 92 | post_shape_cut=string(default=M9 M5%nl) 93 | comment = string(default=%nl(%comment)%nl) 94 | 95 | ''').splitlines() 96 | """ format, type and default value specification of the global config file""" 97 | 98 | 99 | class MyPostProConfig(QtCore.QObject): 100 | """ 101 | This class hosts all functions related to the PostProConfig File. 102 | """ 103 | def __init__(self,filename='postpro_config.cfg'): 104 | """ 105 | initialize the varspace of an existing plugin instance 106 | init_varspace() is a superclass method of plugin 107 | @param filename: The filename for the creation of a new config 108 | file and the filename of the file to read config from. 109 | """ 110 | QtCore.QObject.__init__(self) 111 | 112 | self.folder = os.path.join(g.folder, c.DEFAULT_POSTPRO_DIR) 113 | self.filename =os.path.join(self.folder, filename) 114 | 115 | self.default_config = False # whether a new name was generated 116 | self.var_dict = dict() 117 | self.spec = ConfigObj(POSTPRO_SPEC, interpolation=False, list_values=False, _inspec=True) 118 | 119 | def tr(self,string_to_translate): 120 | """ 121 | Translate a string using the QCoreApplication translation framework 122 | @param: string_to_translate: a unicode string 123 | @return: the translated unicode string if it was possible to translate 124 | """ 125 | return unicode(QtGui.QApplication.translate("MyPostProConfig", 126 | string_to_translate, 127 | None, 128 | QtGui.QApplication.UnicodeUTF8)) 129 | 130 | def load_config(self): 131 | """ 132 | This method tries to load the defined postprocessor file given in 133 | self.filename. If this fail it will create a new one 134 | """ 135 | 136 | try: 137 | # file exists, read & validate it 138 | self.var_dict = ConfigObj(self.filename, configspec=POSTPRO_SPEC) 139 | _vdt = Validator() 140 | result = self.var_dict.validate(_vdt, preserve_errors=True) 141 | validate_errors = flatten_errors(self.var_dict, result) 142 | 143 | if validate_errors: 144 | g.logger.logger.error(self.tr("errors reading %s:") % (self.filename)) 145 | for entry in validate_errors: 146 | section_list, key, error = entry 147 | if key is not None: 148 | section_list.append(key) 149 | else: 150 | section_list.append('[missing section]') 151 | section_string = ', '.join(section_list) 152 | if error == False: 153 | error = self.tr('Missing value or section.') 154 | g.logger.logger.error( section_string + ' = ' + error) 155 | 156 | if validate_errors: 157 | raise BadConfigFileError,self.tr("syntax errors in postpro_config file") 158 | 159 | # check config file version against internal version 160 | 161 | if POSTPRO_VERSION: 162 | fileversion = self.var_dict['Version']['config_version'] # this could raise KeyError 163 | 164 | if fileversion != POSTPRO_VERSION: 165 | raise VersionMismatchError, (fileversion, POSTPRO_VERSION) 166 | 167 | except VersionMismatchError, values: 168 | raise VersionMismatchError, (fileversion, POSTPRO_VERSION) 169 | 170 | except Exception,inst: 171 | logger.error(inst) 172 | (base,ext) = os.path.splitext(self.filename) 173 | badfilename = base + c.BAD_CONFIG_EXTENSION 174 | logger.debug(self.tr("trying to rename bad cfg %s to %s") % (self.filename,badfilename)) 175 | try: 176 | os.rename(self.filename,badfilename) 177 | except OSError,e: 178 | logger.error(self.tr("rename(%s,%s) failed: %s") % (self.filename,badfilename,e.strerror)) 179 | raise 180 | else: 181 | logger.debug(self.tr("renamed bad varspace %s to '%s'") %(self.filename,badfilename)) 182 | self.create_default_config() 183 | self.default_config = True 184 | logger.debug(self.tr("created default varspace '%s'") %(self.filename)) 185 | else: 186 | self.default_config = False 187 | logger.debug(self.tr("read existing varspace '%s'") %(self.filename)) 188 | 189 | # convenience - flatten nested config dict to access it via self.config.sectionname.varname 190 | self.var_dict.main.interpolation = False # avoid ConfigObj getting too clever 191 | self.vars = DictDotLookup(self.var_dict) 192 | 193 | def make_settings_folder(self): 194 | """ 195 | This method creates the postprocessor settings folder if necessary 196 | """ 197 | try: 198 | os.mkdir(self.folder) 199 | except OSError: 200 | pass 201 | 202 | def create_default_config(self): 203 | """ 204 | If no postprocessor config file exists this function is called 205 | to generate the config file based on its specification. 206 | """ 207 | #check for existing setting folder or create one 208 | self.make_settings_folder() 209 | 210 | # derive config file with defaults from spec 211 | logger.debug(POSTPRO_SPEC) 212 | 213 | self.var_dict = ConfigObj(configspec=POSTPRO_SPEC) 214 | _vdt = Validator() 215 | self.var_dict.validate(_vdt, copy=True) 216 | self.var_dict.filename = self.filename 217 | self.var_dict.write() 218 | 219 | 220 | # def _save_varspace(self): 221 | # self.var_dict.filename = self.filename 222 | # self.var_dict.write() 223 | # 224 | def print_vars(self): 225 | print "Variables:" 226 | for k,v in self.var_dict['Variables'].items(): 227 | print k," = ",v 228 | 229 | 230 | class DictDotLookup(object): 231 | """ 232 | Creates objects that behave much like a dictionaries, but allow nested 233 | key access using object '.' (dot) lookups. 234 | """ 235 | def __init__(self, d): 236 | for k in d: 237 | if isinstance(d[k], dict): 238 | self.__dict__[k] = DictDotLookup(d[k]) 239 | elif isinstance(d[k], (list, tuple)): 240 | l = [] 241 | for v in d[k]: 242 | if isinstance(v, dict): 243 | l.append(DictDotLookup(v)) 244 | else: 245 | l.append(v) 246 | self.__dict__[k] = l 247 | else: 248 | self.__dict__[k] = d[k] 249 | 250 | def __getitem__(self, name): 251 | if name in self.__dict__: 252 | return self.__dict__[name] 253 | 254 | def __iter__(self): 255 | return iter(self.__dict__.keys()) 256 | 257 | # def __repr__(self): 258 | # return pprint.pformat(self.__dict__) 259 | 260 | 261 | -------------------------------------------------------------------------------- /source/PostPro/TspOptimisation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/PostPro/TspOptimisation.py -------------------------------------------------------------------------------- /source/PostPro/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/config/config-grbl2d.cfg: -------------------------------------------------------------------------------- 1 | 2 | # Section and variable names must be valid Python identifiers 3 | # do not use whitespace in names 4 | 5 | # do not edit the following section name: 6 | [Version] 7 | 8 | # do not edit the following value: 9 | config_version = 6 10 | 11 | [Paths] 12 | # 13 | # look here for DXF files 14 | import_dir = /Users/florian/Documents/Zeichnungen 15 | 16 | # store gcode output here 17 | output_dir = /Users/florian/Documents/Zeichnungen 18 | 19 | 20 | [Depth_Coordinates] 21 | axis3_retract = 0.0 22 | axis3_slice_depth = 0.0 23 | axis3_safe_margin = 0.0 24 | axis3_start_mill_depth = 0.0 25 | axis3_mill_depth = 0.0 26 | 27 | [Axis_letters] 28 | ax1_letter = X 29 | ax2_letter = Y 30 | ax3_letter = Z 31 | 32 | [Plane_Coordinates] 33 | axis1_start_end = 0.0 34 | axis2_start_end = 0.0 35 | 36 | [General] 37 | write_to_stdout = False 38 | live_update_export_route = False 39 | 40 | 41 | [Route_Optimisation] 42 | default_TSP = False 43 | 44 | # Path optimizer behaviour: 45 | # CONSTRAIN_ORDER_ONLY: fixed Shapes and optimized Shapes can be mixed. Only order of fixed shapes is kept 46 | # CONSTRAIN_PLACE_AFTER: optimized Shapes are always placed after any fixed Shape 47 | TSP_shape_order = CONSTRAIN_ORDER_ONLY 48 | mutation_rate = 0.95 49 | max_population = 20 50 | max_iterations = 300 51 | begin_art = heurestic 52 | 53 | [Import_Parameters] 54 | point_tolerance = 0.01 55 | spline_check = True 56 | fitting_tolerance = 0.01 57 | 58 | [Tool_Parameters] 59 | [[1]] 60 | diameter = 2.0 61 | speed = 6000.0 62 | start_radius = 0.2 63 | 64 | [[2]] 65 | diameter = 2.0 66 | speed = 6000.0 67 | start_radius = 1.0 68 | 69 | [[10]] 70 | diameter = 10.0 71 | speed = 6000.0 72 | start_radius = 2.0 73 | 74 | [Custom_Actions] 75 | [[custom_gcode]] 76 | gcode = '"""(change subsection name and insert your custom GCode here. Use triple quote to place the code on several lines)"""' 77 | 78 | 79 | [Filters] 80 | pstoedit_cmd = /opt/local/bin/pstoedit 81 | pstoedit_opt = -f, dxf, -mm 82 | 83 | [Logging] 84 | 85 | # set this to 'logfile = ' to turn on file logging 86 | # or give the '-L logfile' program option 87 | logfile = "" 88 | 89 | # log levels are one in increasing importance: 90 | # DEBUG INFO WARNING ERROR CRITICAL 91 | # log events with importance >= loglevel are logged to the 92 | # corresponding output 93 | 94 | # this really goes to stderr 95 | console_loglevel = DEBUG 96 | 97 | file_loglevel = DEBUG 98 | 99 | # logging level for the message window 100 | window_loglevel = INFO 101 | 102 | [Feed_Rates] 103 | f_g1_plane = 400.0 104 | f_g1_depth = 150.0 105 | -------------------------------------------------------------------------------- /source/d2gexceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: iso-8859-15 -*- 2 | # 3 | # This program is free software; you can redistribute it and/or 4 | # modify it under the terms of the GNU General Public License 5 | # as published by the Free Software Foundation; either version 2 6 | # of the License, or (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 16 | ''' 17 | 18 | user defined exceptions 19 | 20 | Michael Haberler 20.12.2009 21 | ''' 22 | 23 | class BadConfigFileError(SyntaxError): 24 | """ 25 | syntax error in .cfg file 26 | """ 27 | def __init__(self, value): 28 | print "bin hier" 29 | self.value = value 30 | def __str__(self): 31 | return repr(self.value) 32 | 33 | class VersionMismatchError(Exception): 34 | """ 35 | version mismatch in .cfg file 36 | """ 37 | def __init__(self, fileversion, CONFIG_VERSION): 38 | self.fileversion = fileversion 39 | self.CONFIG_VERSION = CONFIG_VERSION 40 | def __str__(self): 41 | return repr(self.tr('config file versions do not match - internal: %s,' 42 | ' config file %s, delete existing file to resolve issue' 43 | %(self.CONFIG_VERSION, self.fileversion))) 44 | 45 | class OptionError(SyntaxError): 46 | """ 47 | conflicting command line option 48 | """ 49 | 50 | class PluginError(SyntaxError): 51 | """ 52 | something went wrong during plugin loading or initialization 53 | """ -------------------------------------------------------------------------------- /source/dxf2gcode.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | a = Analysis(['D:\\MyWorkspace\\DXF2GCODE\\trunk\\source/dxf2gcode.py'], 3 | pathex=['D:\\MyWorkspace\\DXF2GCODE\\trunk\\source'], 4 | hiddenimports=[], 5 | hookspath=None) 6 | pyz = PYZ(a.pure) 7 | exe = EXE(pyz, 8 | a.scripts, 9 | exclude_binaries=1, 10 | name=os.path.join('build\\pyi.win32\\dxf2gcode', 'dxf2gcode.exe'), 11 | debug=False, 12 | strip=None, 13 | upx=True, 14 | console=False , icon='D:\\MyWorkspace\\DXF2GCODE\\trunk\\source\\DXF2GCODE-001.ico') 15 | coll = COLLECT(exe, 16 | a.binaries, 17 | a.zipfiles, 18 | a.datas, 19 | strip=None, 20 | upx=True, 21 | name=os.path.join('dist', 'dxf2gcode')) 22 | app = BUNDLE(coll, 23 | name=os.path.join('dist', 'dxf2gcode.app')) 24 | -------------------------------------------------------------------------------- /source/dxf2gcode_pyQt4_ui/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/dxf2gcode_pyQt4_ui/dxf2gcode_images.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/pointer.png 4 | images/linepointer.png 5 | images/textpointer.png 6 | images/bold.png 7 | images/italic.png 8 | images/underline.png 9 | images/floodfill.png 10 | images/bringtofront.png 11 | images/delete.png 12 | images/sendtoback.png 13 | images/linecolor.png 14 | images/background1.png 15 | images/background2.png 16 | images/background3.png 17 | images/background4.png 18 | images/blocks.png 19 | images/layer.png 20 | images/shape.png 21 | images/expand-all.png 22 | images/collapse-all.png 23 | images/pause.png 24 | images/go-down.png 25 | images/go-up.png 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /source/dxf2gcode_pyQt4_ui/make_py_uic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """ 3 | Generates the python file based on the defined uifile 4 | """ 5 | 6 | import os, sys 7 | import subprocess 8 | 9 | PYT = "C:/Python27/pythonw.exe" 10 | 11 | 12 | UICPATH = "C:\Python27\Lib\site-packages\PyQt4" 13 | FILEPATH = os.path.realpath(os.path.dirname(sys.argv[0])) 14 | 15 | UIFILE = "dxf2gcode_pyQt4_ui.ui" 16 | PYFILE = "dxf2gcode_pyQt4_ui.py" 17 | 18 | RCFILE = "dxf2gcode_images.qrc" 19 | RCPYFILE = "dxf2gcode_images_rc.py" 20 | 21 | OPTIONS = ("-o") 22 | 23 | CMD1 = ("%s\pyuic4.bat %s %s %s" % (UICPATH, UIFILE, OPTIONS, PYFILE)) 24 | CMD2 = ("%s\pyrcc4.exe %s %s %s" % (UICPATH, OPTIONS, RCPYFILE, RCFILE)) 25 | 26 | print CMD1 27 | RETCODE = subprocess.call(CMD1) 28 | 29 | print CMD2 30 | RETCODE = subprocess.call(CMD2) -------------------------------------------------------------------------------- /source/epydoc-gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: iso-8859-15 -*- 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | if __name__ == '__main__': 19 | import sys 20 | from epydoc.cli import cli 21 | modules = ["Starte_mein_gui.py"] 22 | sys.argv = ["epydoc.py", "-v","--html", 23 | "--output", 24 | "test_html" 25 | ] + sys.argv[1:] 26 | sys.argv += modules 27 | cli() 28 | 29 | -------------------------------------------------------------------------------- /source/epydoc_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # coding: utf-8 3 | 4 | if __name__ == '__main__': 5 | import sys 6 | from epydoc.cli import cli 7 | modules = ['dxf2gcode_b02', 'geoent_arc', 'ccomp_chrisko', 8 | 'base_geometries', 'bounding_box'] 9 | sys.argv = ["epydoc.py", "--html", 10 | "--output", 11 | "test_html" 12 | ] + sys.argv[1:] 13 | sys.argv += modules 14 | cli() 15 | -------------------------------------------------------------------------------- /source/i18n/dxf2gcode_de_DE.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/i18n/dxf2gcode_de_DE.qm -------------------------------------------------------------------------------- /source/i18n/dxf2gcode_fr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/i18n/dxf2gcode_fr.qm -------------------------------------------------------------------------------- /source/images/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/background1.png -------------------------------------------------------------------------------- /source/images/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/background2.png -------------------------------------------------------------------------------- /source/images/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/background3.png -------------------------------------------------------------------------------- /source/images/background4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/background4.png -------------------------------------------------------------------------------- /source/images/blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/blocks.png -------------------------------------------------------------------------------- /source/images/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/bold.png -------------------------------------------------------------------------------- /source/images/bringtofront.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/bringtofront.png -------------------------------------------------------------------------------- /source/images/collapse-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/collapse-all.png -------------------------------------------------------------------------------- /source/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/delete.png -------------------------------------------------------------------------------- /source/images/dxf2gcode_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/dxf2gcode_logo.png -------------------------------------------------------------------------------- /source/images/expand-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/expand-all.png -------------------------------------------------------------------------------- /source/images/floodfill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/floodfill.png -------------------------------------------------------------------------------- /source/images/go-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/go-down.png -------------------------------------------------------------------------------- /source/images/go-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/go-up.png -------------------------------------------------------------------------------- /source/images/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/italic.png -------------------------------------------------------------------------------- /source/images/layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/layer.png -------------------------------------------------------------------------------- /source/images/linecolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/linecolor.png -------------------------------------------------------------------------------- /source/images/linepointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/linepointer.png -------------------------------------------------------------------------------- /source/images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/pause.png -------------------------------------------------------------------------------- /source/images/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/pointer.png -------------------------------------------------------------------------------- /source/images/sendtoback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/sendtoback.png -------------------------------------------------------------------------------- /source/images/shape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/shape.png -------------------------------------------------------------------------------- /source/images/textpointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/textpointer.png -------------------------------------------------------------------------------- /source/images/underline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/workflo/dxf2gcode/83420dc05316d7affa69926d8e009deb20d509ef/source/images/underline.png -------------------------------------------------------------------------------- /source/make_exe.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import os, sys 4 | import subprocess 5 | 6 | pyinpfad = "C:\Python27\pyinstaller-2.0\pyinstaller.py" 7 | 8 | pyt = "C:/Python27/pythonw.exe" 9 | filepfad= os.path.realpath(os.path.dirname(sys.argv[0])) 10 | exemakepfad=filepfad 11 | file = "dxf2gcode" 12 | icon= "%s/DXF2GCODE-001.ico" %filepfad 13 | upxdir="C:\Python27\pyinstaller-2.0\upx309w" 14 | 15 | options=("--noconsole --upx-dir=%s --icon=%s" %(upxdir, icon)) 16 | options=("--noconsole --icon=%s" %(icon)) 17 | print options 18 | 19 | #Verzwichniss wechseln 20 | #Change Directory 21 | exemakepfad = unicode( exemakepfad, "utf-8" ) 22 | os.chdir(exemakepfad.encode( "utf-8" )) 23 | 24 | 25 | cmd=("%s %s %s %s/%s.py" %(pyt,pyinpfad,options,filepfad,file)) 26 | print cmd 27 | retcode=subprocess.call(cmd) 28 | # 29 | #cmd=("%s %s\Build.py %s\%s.spec" %(pyt,pyinpfad,exemakepfad,file)) 30 | #print cmd 31 | #retcode=subprocess.call(cmd) 32 | 33 | print "\n!!!!!!!Bitmaps and Languages folder not vergessen!!!!!!" 34 | print "\nReady" -------------------------------------------------------------------------------- /source/make_pylupdate4_dxf2gcode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """ 3 | Generates the tr file based on the defined pyQt Project File 4 | """ 5 | 6 | import os, sys 7 | import subprocess 8 | 9 | PLYPATH = "C:\Python27\Lib\site-packages\PyQt4\pylupdate4.exe" 10 | LREPATH = "C:\Python27\Lib\site-packages\PyQt4\lrelease.exe" 11 | 12 | FILEPATH = os.path.realpath(os.path.dirname(sys.argv[0])) 13 | 14 | FILES = ("..\dxf2gcode_pyQt4_ui\dxf2gcode_pyQt4_ui.ui", 15 | "..\Core\ArcGeo.py", 16 | "..\Core\Config.py", 17 | "..\Core\Logger.py", 18 | "..\Core\Shape.py", 19 | "..\DXFImport\Import.py", 20 | "..\Gui\myCanvasClass.py", 21 | "..\PostPro\PostProcessor.py", 22 | "..\PostPro\PostProcessorConfig.py", 23 | "..\PostPro\TspOptimisation.py", 24 | "..\dxf2gcode.py") 25 | 26 | 27 | TSFILES=("dxf2gcode_de_DE.ts", 28 | "dxf2gcode_fr.ts") 29 | 30 | 31 | FILESSTR="" 32 | for FILE in FILES: 33 | FILESSTR+=("%s\i18n\%s " %(FILEPATH, FILE)) 34 | 35 | TSFILESTR="" 36 | for TSFILE in TSFILES: 37 | TSFILESTR+=("%s\i18n\%s " %(FILEPATH, TSFILE)) 38 | 39 | OPTIONS = ("-ts") 40 | 41 | CMD1 = ("%s %s %s %s" % (PLYPATH, FILESSTR, OPTIONS, TSFILESTR)) 42 | print CMD1 43 | 44 | RETCODE = subprocess.call(CMD1,shell=True) 45 | 46 | CMD2 =("%s %s" %(LREPATH,TSFILESTR)) 47 | print CMD2 48 | 49 | RETCODE = subprocess.call(CMD2,shell=True) 50 | 51 | -------------------------------------------------------------------------------- /source/postpro_config/postpro_config-grbl2d.cfg: -------------------------------------------------------------------------------- 1 | 2 | # Section and variable names must be valid Python identifiers 3 | # do not use whitespace in names 4 | 5 | # do not edit the following section name: 6 | [Version] 7 | 8 | # do not edit the following value: 9 | config_version = 2 10 | 11 | [General] 12 | output_format = .ngx 13 | output_text = G-CODE for EMC2 14 | output_type = g-code 15 | comments = False 16 | 17 | abs_export = True 18 | cancel_cc_for_depth = False 19 | cc_outside_the_piece = True 20 | export_ccw_arcs_only = False 21 | max_arc_radius = 10000.0 22 | 23 | code_begin = 24 | code_end = 25 | 26 | [Number_Format] 27 | pre_decimals = 1 28 | post_decimals = 3 29 | decimal_seperator = . 30 | pre_decimal_zero_padding = False 31 | post_decimal_zero_padding = True 32 | signed_values = False 33 | 34 | [Line_Numbers] 35 | use_line_nrs = False 36 | line_nrs_begin = 10 37 | line_nrs_step = 10 38 | 39 | [Program] 40 | tool_change = (T%tool_nr M6)%nl(S%speed)%nl 41 | feed_change = F%feed%nl 42 | rap_pos_plane = G0 X%XE Y%YE%nl 43 | rap_pos_depth = G0 Z%ZE %nl 44 | lin_mov_plane = G1 X%XE Y%YE%nl 45 | lin_mov_depth = G1 Z%ZE%nl 46 | arc_int_cw = G2 X%XE Y%YE I%I J%J%nl 47 | arc_int_ccw = G3 X%XE Y%YE I%I J%J%nl 48 | cutter_comp_off = G40%nl 49 | cutter_comp_left = G41%nl 50 | cutter_comp_right = G42%nl 51 | pre_shape_cut = M3%nl 52 | post_shape_cut = M5%nl 53 | comment = %nl(%comment)%nl 54 | --------------------------------------------------------------------------------