Open full view…

Howto sharing some code modifications

Sun, 01 Jan 2017 12:30:49 GMT

Hi Juan Pablo, first of all I must say thank you for this remarkable tool. I've been using it for the last year or so for PCB prototyping in combination with Autoleveller and I find it very usefull. One thing I've found very unconfortable to my taste is the need to modify the generated G-Code before going to the CNC mill. The generated code is not exactly bad or wrong, but I needed to make a number of manual optimizations for the tool change code and for improving safety in some movements. I normally work on Windows so I tried to setup the development environment for Windows, but failed. It was relatively strightforward to set it up in Linux (Debian 8.6.0), though. Is there any step by step guide for seting up the development environment for Windows? I downloaded the source code and applied some modifications to camlib.py and FlatCAMObj.py. Is there any way I could sent you the code back, I don't see how I could attach a file here? Once again, thanks a lot for sharing this tool with us. Victor

Thu, 19 Jan 2017 14:25:52 GMT

Hi Victor, The way FlatCAM and most other open source software is similar. You start by making a clone of the repository in Bitbucket (Go to the Development in flatcam.org). Then you make your changes in your computer, update them to your copy of the repository, and when you are ready to share, you make a "Pull Request" to the original repository. You can find docs and tutorials of this whole methodology in bitbucket.org. JP

Sun, 26 Mar 2017 08:30:25 GMT

Hey Victor, I had to setup the development environment in Windows, the procedure is kind of involved because many of the needed packages are source-only on pypi and contain C/C++ source. I've started from a 32 bit 2.7.10 python on a 64 bit machine (I had issue installing some packages on 64 bit python). 1. Create a virtualenv for it, then go into a cmd winow and activate that virtualenv 1b. update the embedded pip with python -m install --upgrade pip (otherwise some packages can't install with the old pip version for some reason) 2. cd to the project folder where you cloned your fork of the repository 3. Now the drill is to install the dependencies, and for the failing packages use the wheels that can be found in http://www.lfd.uci.edu/~gohlke/pythonlibs/. In the next steps when I say download, it's download from lfd.uci.edu, then install using pip install path_to_the_downloaded file 4. we could try pip install -r requirements.txt but it would fail at matplotlib download and install matplotlib‑2.0.0‑cp27‑cp27m‑win32.whl 5. then it's shapely that would fail inst all, it can't find the "geos.dll", Shapely install would fail install because scipy dependency install fails. 6 Before installing scipy, download and install numpy‑1.11.3+mkl‑cp27‑cp27m‑win32.whl 7. Now, download and install scipy‑0.19.0‑cp27‑cp27m‑win32.whl 7b now finally you can download and install Shapely‑1.5.17‑cp27‑cp27m‑win32.whl 8. You can now do pip install -r requirements.txt successfully, but it's not finished :-) 9. A dependency that's not properly installed for some reason is Rtree: do a `pip uninstall Rtree` download and install Rtree‑0.8.3‑cp27‑cp27m‑win32.whl 10. Then is pyqt4: download and install PyQt4‑4.11.4‑cp27‑cp27m‑win32.whl 11. Then pywin32: download and install pywin32‑220.1‑cp27‑cp27m‑win32.whl 12 Almost there, the only missing stuff is tcl. This one is tricky. You install tcl globally, in the correct c:\PythonXX\ folder when installing the activestate community tcl version (version 8.6 at the time of writing http://www.activestate.com/activetcl/downloads) 13. Then modify you activate.bat file inside the virtualenv Scripts\ folder and add the line set "TCL_LIBRARY=C:\PythonXX\tcl\tcl8.5" just before the :END line 14. Deactivate and reactivate your virtualenv, and that's it, FlatCAM can now start with `python FlatCAM.py` Hope it helps !