FlatCAM 8.9.94 Script not working - fixed for next version

Issue #553 new
max xam created an issue

The script was running on FlatCAM 8.5 now it has some issue to set variable:

this is the instruction to set:

set bottom_traces_gbr "/home/lg/Desktop/loop-amp-B.Cu.gbr"

open_gerber $bottom_traces_gbr -outname bottom_traces_grb

so maybe also other commends are not working if somebody can fix…..

Thanks in advance,

Comments (74)

  1. Marius Stanciu

    Hi,
    You do realize that just saying in the title that: “FlatCAM 8.9.94 Script not working” and then telling that the commands:

    set bottom_traces_gbr "/home/lg/Desktop/loop-amp-B.Cu.gbr"
    open_gerber $bottom_traces_gbr -outname bottom_traces_grb
    

    do not work, is just too little information so you can get help.

    I don’t deny that TCL commands are on the bottom of my coding priorities and it is most likely to have bugs there but the above commands should open correctly the file.
    Perhaps what you are missing is that nothing is displayed on the screen? In that case use at the end the command plot_all.
    If not then please describe what errors you get.

  2. max xam reporter

    Hi Marius,

    I am testing on 2 platform, Mac and linux Fedora.

    If I run FlatCAM with Mac and open the script from the gui interface I have the following error :

    FlatCAM 8.994 - Digita >help< per iniziare

ERROR: can't read "bottom_traces_gbr": no such variable
 while executing
"open_gerber $bottom_traces_gbr -outname bottom_traces_grb"

    If I run from Mac terminal :

    flatcam --shellfile=/Users/max/Txt/3d_cnc/laser/flatcam_script/make_gcode.flatcam

    the script can run ( in linux happens the same thing like Mac gui interfaces cannot load anything ) and now I have the following problems :

    (1)

    the command set_origin 0,0 can be executed but all the loaded files are not moved to origin 0,0

    [DEBUG][MainThread] TCL command 'TclCommandSetOrigin' executed.
    [DEBUG][MainThread] parseGerber.Gerber.offset()
    [DEBUG][MainThread] parseGerber.Gerber.bounds()
    [DEBUG][MainThread] Object changed, updating the bounding box data on self.options
    [DEBUG][MainThread] parseGerber.Gerber.bounds()
    [DEBUG][MainThread] parseGerber.Gerber.offset()
    [DEBUG][MainThread] parseGerber.Gerber.bounds()
    [DEBUG][MainThread] Object changed, updating the bounding box data on self.options
    [DEBUG][MainThread] parseGerber.Gerber.bounds()
    [DEBUG][MainThread] appParsers.ParseExcellon.Excellon.offset()
    [DEBUG][MainThread] appParsers.ParseExcellon.Excellon.bounds()
    [DEBUG][MainThread] Object changed, updating the bounding box data on self.options
    [DEBUG][MainThread] appParsers.ParseExcellon.Excellon.bounds()
    [DEBUG][MainThread] export_gerber()
    [DEBUG][MainThread] GerberObject.export_gerber() --> Generating the Gerber code from the selected Gerber file
    [DEBUG][MainThread] export_gerber()
    [DEBUG][MainThread] GerberObject.export_gerber() --> Generating the Gerber code from the selected Gerber file
    [DEBUG][MainThread] export_excellon()
    [DEBUG][MainThread] TCL command 'TclCommandPlotAll' executed.
    [DEBUG][Dummy-7] Plot_all()

    (2)

    Warning message :

    /usr/local/cellar/flatcam-beta/8.9.94/libexec/appObjects/FlatCAMGerber.py:743: ShapelyDeprecationWarning: Iteration over multi-part geometries is deprecated and will be removed in Shapely 2.0. Use the geoms property to access the constituent parts of a multi-part geometry.
    for p in geom:

    (3)

    millholes command is not more existing

    [ERROR][MainThread] Exception on Tcl Command execution: invalid command name "millholes"
    while executing
    "millholes drill_drl -tools [count_tools] -tooldia $laser_d -outname holes_geo"

    I replace with :

    milldrills drill_drl -milled_dias "all" -tooldia $laser_d -outname holes_ge

    (4)

    I try cncjob with a lot of parameter also with the example in TclCommandCncjob.py but gives errors

    [ERROR][MainThread] Exception on Tcl Command execution:
    while executing
    "cncjob geo_name -dia 0.5 -z_cut -1.7 -z_move 2 -feedrate 120 -pp default"

    (5)

    I cannot save gcode

    [ERROR][MainThread] Exception on Tcl Command execution:
    while executing
    "write_gcode "pippo.gcode""

    (6)

    I cannot save the project

    AttributeError: 'App' object has no attribute 'save_project'
    [ERROR][MainThread] TCL command '<tclCommands.TclCommandSaveProject.TclCommandSaveProject object at 0x18dd9cdc0>' failed.
    [ERROR][MainThread] Exception on Tcl Command execution:
    while executing
    "save_project $project_fn"

    Thanks a lot.

    Max

  3. Marius Stanciu

    Hi Max,

    Regarding the testing I can do it only in the environment where I program which is Windows.
    I have tested the commands:

    set bottom_traces_gbr "/home/lg/Desktop/loop-amp-B.Cu.gbr"
    open_gerber $bottom_traces_gbr -outname bottom_traces_grb
    

    in my working copy and it works as expected. https://bitbucket.org/marius_stanciu/flatcam_beta/branch/Beta_8.995

    Regarding the issues:
    1. I can reproduce the issue, it is solved in the latest commit in my working copy. I have also added a new parameter ‘obj_name’ which allows to set_origin only for one object (overlap with the ‘offset’ TclCommand). Yet, you could get the desired result in Beta 8994 using the command: set_origin -auto 1

    2. It’s just a warning message, it can be ignored. Beta 8.994 was released before Shapely 1.8.0 package was released which is responsible for the warnings

    3. True. It was replaced by two Tcl Commands: milldrills and millslots. Use the help command to see what commands are available and a short description

    4. The cncjob Tcl command is now fixed in my working copy. Probably it had nothing to do with the issue you encountered, the current issues were with the fact that I changed the data structures. Most likely the issue you have was solved some time ago after the release of Beta 8.994. But… is fixed

    5. The current format of the write_gcode Tcl command can be get with the command: help write_gcode. It tells that the format is:

    write_gcode cnc_objecct_name "location_of_where_to_save/your_gcode_filename.gcode"
    

    It works.

    6. Fixed in the latest commit on my working copy. Download the sources from here: https://bitbucket.org/marius_stanciu/flatcam_beta/get/Beta_8.995.zip
    Read the Issues on Bitbucket (require a free account there) to know what is currently not working. https://bitbucket.org/marius_stanciu/flatcam_beta/issues?status=new&status=open

    Regards,
    Marius

  4. max xam reporter

    Hi Marius,

    I see only now your reply, I will download the new version and let you know.

    Thanks a lot.

    Max

  5. max xam reporter

    Hi Marius,

    I reinstall python and run see error messages in sequence.:

    ‌(1)

    max@macMax:~/flatcam95$ python3.9 FlatCAM.py
    Traceback (most recent call last):
    File "/Users/max/flatcam95/FlatCAM.py", line 8, in <module>
    from app_Main import App
    File "/Users/max/flatcam95/app_Main.py", line 57, in <module>
    from appDatabase import ToolsDB2
    File "/Users/max/flatcam95/appDatabase.py", line 4, in <module>
    from camlib import to_dict
    File "/Users/max/flatcam95/camlib.py", line 61, in <module>
    from ortools.constraint_solver import routing_enums_pb2
    File "/usr/local/lib/python3.9/site-packages/ortools/constraint_solver/routing_enums_pb2.py", line 5, in <module>
    from google.protobuf import descriptor as _descriptor
    ImportError: cannot import name 'descriptor' from 'google.protobuf' (unknown location)
    max@macMax:~/flatcam95$

    (2)

    max@macMax:~/flatcam95$ brew install or-tools
    ==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/manifests/3.19.3
    Already downloaded: /Users/max/Library/Caches/Homebrew/downloads/bc73823a1b9b3ec6c0304317185fa0e1ea8987512d822398f5f511e4a576b3a3--protobuf-3.19.3.bottle_manifest.json
    ==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/blobs/sha256:8922f3c0b2cfa6a4f4e1810b7a2
    Already downloaded: /Users/max/Library/Caches/Homebrew/downloads/aa333d00389f8f993807270a3fd7f53b97fb3729f3cb93a4ab2283868af39473--protobuf--3.19.3.big_sur.bottle.tar.gz
    ==> Downloading https://ghcr.io/v2/homebrew/core/or-tools/manifests/9.2_2
    Already downloaded: /Users/max/Library/Caches/Homebrew/downloads/33cb0ed2183de70b8ea1483dfe65c8b77debfe7dd4fd09fec9d72ea0387b156b--or-tools-9.2_2.bottle_manifest.json
    ==> Downloading https://ghcr.io/v2/homebrew/core/or-tools/blobs/sha256:53f217259a3740dadce9070892a
    Already downloaded: /Users/max/Library/Caches/Homebrew/downloads/5cc040eccca67b2c24de1cc2f54c740730eada761282da7d954f57eb5afa553d--or-tools--9.2_2.big_sur.bottle.tar.gz
    ==> Installing dependencies for or-tools: protobuf
    ==> Installing or-tools dependency: protobuf
    ==> Pouring protobuf--3.19.3.big_sur.bottle.tar.gz
    🍺 /usr/local/Cellar/protobuf/3.19.3: 270 files, 19.7MB
    ==> Installing or-tools
    ==> Pouring or-tools--9.2_2.big_sur.bottle.tar.gz
    🍺 /usr/local/Cellar/or-tools/9.2_2: 368 files, 17.8MB
    ==> Running brew cleanup or-tools...
    Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
    Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew).
    max@macMax:~/flatcam95$

    …..after running again

    max@macMax:~/flatcam95$ python3.9 FlatCAM.py
    zsh: segmentation fault python3.9 FlatCAM.py
    after installation I have segmentation fault.

    (3)

    max@macMax:~/flatcam95$ pytest
    ====================================== test session starts =======================================
    platform darwin -- Python 3.9.9, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
    rootdir: /Users/max/flatcam95
    collecting ... Fatal Python error: Segmentation fault

    Current thread 0x00000001174d1e00 (most recent call first):
    File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
    File "<frozen importlib._bootstrap_external>", line 1173 in create_module
    File "<frozen importlib._bootstrap>", line 565 in module_from_spec
    File "<frozen importlib._bootstrap>", line 666 in _load_unlocked
    File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
    File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 1058 in _handle_fromlist
    File "/usr/local/lib/python3.9/site-packages/google/protobuf/descriptor.py", line 47 in <module>
    File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
    File "<frozen importlib._bootstrap_external>", line 850 in exec_module
    File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
    File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
    File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 1058 in _handle_fromlist
    File "/usr/local/lib/python3.9/site-packages/ortools/constraint_solver/routing_enums_pb2.py", line 5 in <module>
    File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
    File "<frozen importlib._bootstrap_external>", line 850 in exec_module
    File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
    File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
    File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
    File "<frozen importlib._bootstrap>", line 1058 in _handle_fromlist
    File "/Users/max/flatcam95/camlib.py", line 61 in <module>
    File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed
    File "<frozen importlib._bootstrap_external>", line 850 in exec_module
    File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
    File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
    File "/Users/max/flatcam/tests/test_gerber_buffer.py", line 2 in <module>
    File "/usr/local/lib/python3.9/site-packages/_pytest/assertion/rewrite.py", line 170 in exec_module
    File "<frozen importlib._bootstrap>", line 680 in _load_unlocked
    File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 1007 in _find_and_load
    File "<frozen importlib._bootstrap>", line 1030 in _gcd_import
    File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/init.py", line 127 in import_module
    File "/usr/local/lib/python3.9/site-packages/_pytest/pathlib.py", line 524 in import_path
    File "/usr/local/lib/python3.9/site-packages/_pytest/python.py", line 578 in _importtestmodule
    File "/usr/local/lib/python3.9/site-packages/_pytest/python.py", line 500 in _getobj
    File "/usr/local/lib/python3.9/site-packages/_pytest/python.py", line 291 in obj
    File "/usr/local/lib/python3.9/site-packages/_pytest/python.py", line 516 in _inject_setup_module_fixture
    File "/usr/local/lib/python3.9/site-packages/_pytest/python.py", line 503 in collect
    File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 341 in <lambda>
    File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 311 in from_call
    File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 341 in pytest_make_collect_report
    File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
    File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
    File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in call
    File "/usr/local/lib/python3.9/site-packages/_pytest/runner.py", line 458 in collect_one_node
    File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 808 in genitems
    File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 811 in genitems
    File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 634 in perform_collect
    File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 333 in pytest_collection
    File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
    File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
    File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in call
    File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 322 in _main
    File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 269 in wrap_session
    File "/usr/local/lib/python3.9/site-packages/_pytest/main.py", line 316 in pytest_cmdline_main
    File "/usr/local/lib/python3.9/site-packages/pluggy/_callers.py", line 39 in _multicall
    File "/usr/local/lib/python3.9/site-packages/pluggy/_manager.py", line 80 in _hookexec
    File "/usr/local/lib/python3.9/site-packages/pluggy/_hooks.py", line 265 in call
    File "/usr/local/lib/python3.9/site-packages/_pytest/config/init.py", line 162 in main
    File "/usr/local/lib/python3.9/site-packages/_pytest/config/init.py", line 185 in console_main
    File "/usr/local/bin/pytest", line 8 in <module>
    zsh: segmentation fault pytest

    Please let me know, I have no more idea…..and if I try 8.9.94 is looking for pyqt5 !!!

    Kind regards.

    Max

  6. Marius Stanciu

    Hello Max,

    Sorry I’ve been traveling outside town today.
    I can’t really tell you why some packages work or do not work in MacOS since I have actually no experience with the MacOS systems (it is a matter of preferences, I can’t stand the i-something… nor the experience and I find it frightening the move that Microsoft makes with Windows toward the same interface).

    But what you need to know is that in the case of FlatCAM beta, it is forbidden to have PyQt5 and PyQt6 side by side, installed at the same time. One way to bypass this, if you really need PyQ5 installed (because the latest version of not-yet-released-FlatCAM-beta, my working copy, is made to work with PyQt6 framework) then it will be advisable to create a Python virtual environment (read about this on the net there is a ton of information regarding the subject) specifically to run FlatCAM beta and you will install in that virtual environment only the packages required by FlatCAM beta.

    Furthermore, since it looks like you are stuck with something related to the Google OR-Tools, recently I made this package optional so it is OK if you don’t install it (the app is aware if you install or not the OR Tools) although the performance of the optimizations will not be so good with the other available options.

    Best regards,
    Marius

    LE: pytest module will help with nothing since I have no tests made for FlatCAM beta.

  7. max xam reporter

    Hi Marius,

    I suppose you modify only TclCommands to fix my issues, can I copy from 8.9.95 to 8.9.94 ?

    In this case I will try to run 8.9.94?

    Greetings.

    Max

  8. max xam reporter

    Hi Marius,

    you are right, now the 8.9.95 Evo is starting with virtualenv

    and loading the script…. again some errors but so tired and happy to see FlatCAM running again.

    After creating the python3 -m venv flt and activate

    with source flt/bin/activate , I moved in the unzipped folder 8.9.95 from comman line and run

    python -m pip install -r requirements.txt

    Now it’s dinner time, tomorrow I will continue…

    Thanks again for your support.

    Max

  9. Marius Stanciu

    Hello Max,

    Try to use the latest commit, I fixed those issues. It looks like when you use the command milldrills you used the argument -diatol which is used only locally in the Tcl command and it was wrongly passed to the handler method. But now you can use this argument safely.

    Best regards,
    Marius

    LE: You can get the latest commit using the same link: https://bitbucket.org/marius_stanciu/flatcam_beta/get/Beta_8.995.zip
    LLE: Actually you did not used the argument -diatol and the app was trying to delete somethings that did not exist. Yet, the fix should take care of that too.

  10. max xam reporter

    Hi Marius,

    a new issue, isolate don’t generate output

    isolate bottom_traces_grb -dia $laser_d -passes $laser_passes -overlap $laser_overlap -combine 1 -outname trace_iso_geo

    join_geometries seems don’t generate output maybe because trace_iso_geo is missing:

    join_geometries laser_etch_geo trace_iso_geo holes_geo cutout_grb_cutout

  11. max xam reporter

    Hi Marius,

    the script is working fine now.

    After finished, in the gui, if I move with the mouse zooming out or in happens :

  12. Marius Stanciu

    Hi,
    Should be fixed now. I got stuck in something that I wanted to add in the Script Editor (I want to highlight all words that are the same as the one clicked but somehow it eludes me, everything get highlighted but the one clicked).
    Anyway, it may be required to delete the Preferences files now since I also fixed another issue regarding changing the colors in Preferences.

  13. max xam reporter

    Hi,

    cncjob is not more working, I introduce -spindlespeed 150, and I had error, I removed it but it the same see below

  14. Marius Stanciu

    If you use the latest commit, you may need to delete the Preferences (with the application closed) and try again.

  15. max xam reporter

    I delete the whole content of the folder .Flatcam in the homedir,

    but the cncjob cannot write output file

  16. max xam reporter

    Hi ,

    it seems that changing the gaps number from 4 to 2 the issue happens again.

    cutout cutout_grb -dia $laser_d -margin 0.1 -gapsize 0.4 -gaps 2

    After in the gui interface when I use the trackpad going forwar with 2 fingers, it must reproduce zoom out, it gives the error below:

    2022-01-17 22:19:22.701257
    Traceback (most recent call last):
    File "/Users/max/flt/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 596, in event
    points = ev.touchPoints()
    AttributeError: 'QTouchEvent' object has no attribute 'touchPoints'

  17. max xam reporter

    Hi Marius,

    I want to use the gcode for laser and not cnc.

    Do you have any idea how to stop the laser during transfer movements ?

  18. Marius Stanciu

    Hi,

    Regarding the error you get. Like I said you need to check the allowed parameters using the command help tcl_command.
    E.g, for cutout:

    > help cutout 
    
TCL command 'TclCommandHelp' executed.

    Creates board cutout from an object (Gerber or Geometry) with a rectangular shape.

    > cutout name [-dia <float>] [-margin <float>] [-gapsize <float>] [-gaps <str>] [-outname <str>]
   
      name <str>: Name of the object.
  
      [-dia <float>: Tool diameter.][-margin <float>: Margin over bounds.][-gapsize <float>: Size of gap.][-gaps <str>: Type of gaps. Can be: 'tb' = top-bottom, 'lr' = left-right and '4' = one each side.][-outname <str>: Name of the object to create.]> cutout new_geo -dia 1.2 -margin 0.1 -gapsize 1 -gaps "tb" -outname cut_geo
    

    As you can see, the -gaps parameter can take only those values: “tb”, “lr” and '4'. You tried to use a value of 2 which is not allowed. I just added a check so a Tcl error is raised if the user tries to use something else and the script is aborting with a significant message.

    Those changes are in the latest commit.

  19. Marius Stanciu

    Do you have any idea how to stop the laser during transfer movements ?

    Yes, you need to use a preprocessor that allows to do that. I have just added a new Tcl command named list_pp which will list the names of all the available preprocessors.

    Read the help for the cncjob or drillcncjob Tcl commands on how to use it. You need a preprocessor for laser so use one that has laser in its name.

  20. max xam reporter

    Hi Marius,

    I installed the last commit and try gaps “lr” it’s working.

    I am using grbl, and I see in Tcl commans: GRBL_laser.

    I have no idea how to use preprocessor and I don’t find any help.

    Sorry let me know.

    Thanks in advance.

    Max

  21. Marius Stanciu

    Hello Max,
    It is just that you use the parameter -pp GRBL_laserfor cncjob Tcl command. Read the help cncjob output….

  22. max xam reporter

    Great!!!!!

    …but 3 questions:

    1. I use zfocus -150 but it show 150, my zhome is upper and after home I go down with G0 z-150… but I have seen in the gcode that never moves Z, so I think it doesn’t matter.
    2. my suggested engraving feed rate is 100 and it set correctly, but I have seen G01 F60.00 where is defined ?
    3. some thing Feedrate rapids: 1500.0 mm/min it’s not used,but where is defined ?

  23. Marius Stanciu

    BTW, please write down here the command and parameters that you have used so we can talk on the same wavelength…

  24. max xam reporter

    Hi Marius,

    see below 3 parameters , with laser_z used twice

    set laser_d 0.125

    set laser_z -150.0

    set laser_feed 100.0

    cncjob laser_etch_geo -z_cut $laser_z -z_move $laser_z -feedrate $laser_feed -dia $laser_d -spindlespeed 150 -pp GRBL_laser -outname laser_etch_cnc

  25. Marius Stanciu

    Hello Max,
    Regarding the issues enumerated in the latest post with the issues report:

    1. Depending of the preprocessor used it is possible that some of the cncjob parameters are not used by that preprocessor. In the case of ‘laser’ preprocessors there are parameters like: z_cut, z_move, feedrate_z, feedrate_rapid that are not used except the GRBL_laser_Z preprocessor that allow the move on Z axis with the parameter z_move but only on the start of work. Basically (with the exception mentioned) the ‘laser’ preprocessors allow the laser to move only on the X-Y plane (they are for laser cutters) and assumes that the focusing of the laser is done manually by he user. Since you want to do a Z move for focusing the only choice is to use the ‘GRBL_laser_Z’ preprocessor.
      I’ve updated a bit the header of the laser preprocessors to show this information for future users.
    2. The used feedrate Fxxx is on the each G01 line. Due of compatibility issues (have to make all work) some times you may find pieces of Gcode that looks that have no meaning just like the line G01 F60.00 which immediately after is cancelled by the line G01 F100.00. So no worry.
    3. I’ve remove the reference to ‘Feedrate rapids’ in the header of GRBL laser preprocessors since that parameter is used only by Marlin controllers (which do not understand fast move command G0 and need a specifically defined value for the fast movement - aka ‘rapids’).

  26. max xam reporter

    Hi Marius,

    thanks a lot for your support.

    Today I will move everything on my linux Fedora machine connected to the Laser-Cnc and if everythin it’s working fine I will try etching a pcb with laser

    Have a nive day.

    Max

  27. max xam reporter

    Hi Marius,

    in the gui interfaceon Mac when I use the trackpad going forward with 2 fingers, it must reproduce zoom out, it continue to give the error below:

    2022-01-19 19:32:10.096447
    Traceback (most recent call last):
    File "/Users/max/flt/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 596, in event
    points = ev.touchPoints()
    AttributeError: 'QTouchEvent' object has no attribute 'touchPoints'

    Under linux reproducing the same movements, the zoom is working properly.

  28. Marius Stanciu

    Sorry, can’t test on MacOS. As long as the issue is not present in Windows there is nothing I can do.

  29. max xam reporter

    Can I help you?

    Can you introduce some info in the log files to help to understand ?

    Can I debug using Pycharm ?

  30. Marius Stanciu

    Hello Max,

    I guess it is something difficult like the TCL commands running in another thread which makes setting the UI for newly created objects crash somewhere. Unfortunately I have no idea where to start or how to debug this and I am not going to dedicate more time on Tcl commands other than making the commands themselves work. Sorry but I already put too much time into this and there some other things quite important to fix in the app with the limited time that I have available.

  31. max xam reporter

    Hi Marius,

    I understand you, but the issue is not depending from the script or Tcl commands, it happens after opening FlatCAM in the virtualenv:

    source /Users/max/flt/bin/activate
    python /Users/max/flatcam95/FlatCAM.py
    

  32. Marius Stanciu

    Hi,
    Are you saying that immediately after you start FlatCAM, if you use the mouse to zoom you get that error and there is no visible zoom on screen?

    If you only checked with the trackpad please connect an external mouse and use the mouse wheel to try the zoom feature.

    Furthermore, can you try using the Zoom In and Zoom Out entries from the View menu in the MenuBar? You could also try to use the keyboard keys: = amd - which should yield the same zoom in/out result.

    Post what you get in each of those situations. Thanks.

  33. max xam reporter

    Hi Marius,

    with external mouse using the wheel or using the keyboard = or - everything it’s working fine.

    With trackpad the problem seems on touch event. If after start the mouse is showing the arrow, if I touche the trackpad the arrow become a red crosshair if I move forward and backward the zoom in and out is working, if I release the trackpad and touch again the issue is coming out.

  34. Marius Stanciu

    Hello Max,

    This is not a FlatCAM issue, it is an upstream problem that the VisPy module has. I will see if I can get in touch with the developers from VisPy, usually they are very responsive.

  35. Marius Stanciu

    Hello Max,
    Could you please uninstall the vispy package and then install the package that I just uploaded?
    Tell me if that is fixing the issue. I have made a modification to VisPy and if successful then I will make a pull request on the VisPy project.

  36. Marius Stanciu

    Yes, don’t worry about the version number, it is actually based on 0.9.4.
    All you need to do, after you activate the environment, is to uninstall the previous version of vispy and then:

    pip install path_where_the_package_is/vispy-0.7.4.dev59dirty-cp39-cp39-win_amd64.whl
    

  37. max xam reporter

    (flt) max@macMax:~$ pip install ~/Marius/vispy-0.7.4.dev59dirty-cp39-cp39-win_amd64.whl
    ERROR: vispy-0.7.4.dev59dirty-cp39-cp39-win_amd64.whl is not a supported wheel on this platform.

  38. Marius Stanciu

    Oops … forgot about that… I am using Windows you are using MaxOS and build system is different… Sorry!
    I will give you the zip with the sources and you will build the whole thing on your system. A moment.

  39. Marius Stanciu

    It took a while to see how I generate an archive .tar.gz in Windows.
    You need to install it like this:

    pip install path_where_the_package_is/vispy-0.9.4.1.tar.gz
    

    If it asks for certain packages then you need to install them. Like: setuptools, setuptools-scm, cython, freetype-py etc

  40. max xam reporter

    (flt) max@macMax:~$ pip install ~/Marius/vispy
    Processing ./Marius/vispy
    Installing build dependencies ... done
    Getting requirements to build wheel ... done
    Preparing metadata (pyproject.toml) ... done
    Requirement already satisfied: kiwisolver in ./flt/lib/python3.9/site-packages (from vispy==0.7.4.dev59+dirty) (1.3.2)
    Requirement already satisfied: freetype-py in ./flt/lib/python3.9/site-packages (from vispy==0.7.4.dev59+dirty) (2.2.0)
    Requirement already satisfied: hsluv in ./flt/lib/python3.9/site-packages (from vispy==0.7.4.dev59+dirty) (5.0.2)
    Requirement already satisfied: numpy in ./flt/lib/python3.9/site-packages (from vispy==0.7.4.dev59+dirty) (1.22.1)
    Building wheels for collected packages: vispy
    Building wheel for vispy (pyproject.toml) ... done
    Created wheel for vispy: filename=vispy-0.7.4.dev59+dirty-cp39-cp39-macosx_11_0_x86_64.whl size=1393752 sha256=aa36c6e23c9f296d1f5208040f9d76d2f0934a246080776c3618192084c38aad
    Stored in directory: /private/var/folders/gc/m3dcslxs0b3f_tjv3kv8rsk80000gn/T/pip-ephem-wheel-cache-yxo93vhc/wheels/b7/4d/ee/39f9809f4b295e106f36b320dda09119d323f0683d944f9914
    Successfully built vispy
    Installing collected packages: vispy
    Attempting uninstall: vispy
    Found existing installation: vispy 0.9.4
    Uninstalling vispy-0.9.4:
    Successfully uninstalled vispy-0.9.4
    Successfully installed vispy-0.7.4.dev59+dirty

    ……. then

    2022-01-20 17:23:30.229361
    Traceback (most recent call last):
    File "/Users/max/flt/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 601, in event
    pos = [_get_qpoint_pos(p.pos()) for p in points]
    File "/Users/max/flt/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 601, in <listcomp>
    pos = [_get_qpoint_pos(p.pos()) for p in points]
    AttributeError: 'QEventPoint' object has no attribute 'pos'

  41. Marius Stanciu

    I don’t know how things are done in MacOS but those are the packages that I have in the virtual environment built for VisPy:

  42. Marius Stanciu

    2022-01-20 17:23:30.229361
    Traceback (most recent call last):
    File "/Users/max/flt/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 601, in event
    pos = [_get_qpoint_pos(p.pos()) for p in points]
    File "/Users/max/flt/lib/python3.9/site-packages/vispy/app/backends/_qt.py", line 601, in <listcomp>
    pos = [_get_qpoint_pos(p.pos()) for p in points]
    AttributeError: 'QEventPoint' object has no attribute 'pos'
    

    Ok. I’ll look into it. I’m working blindly here so…

  43. max xam reporter

    Hi Marius,

    one question, if I use Inkscape for manual drawing and after import like geometry, how can I use post procesoor to generate gcode, laser in my case?

  44. Marius Stanciu

    Hi Max,

    A SVG file imported into FlatCAM beta as a Geometry object can be processed by a cncjob Tcl command just like any other Geometry say one generated by an isolation.

  45. Marius Stanciu

    Hello Max,

    What am I suppose to see in the above?
    Also please use the formatting, it is very hard to read on just a pile of characters. Use the Icon <> in the menubar when writing messages and paste the code inside the box that is included. It should format the posted log as code and make it easier to read by keeping the lines as lines.

  46. max xam reporter

    Hi Marius,

    I am working to find a way to draw mechanical drawing to reproduce with laser. Inkscape is good to manipulate picture so I decided to use Solidworks, that I already use for 3d printer, exporting in dxf.

    After I import the dxf file like object, but the dimensions were the doble, so from command line I scale and after isolation from the Gui I make cncjob from command line passing parameter -pp GRBL_laser but the output is for Mach3 see below

    cncjob origine.DXF_iso_combined -z_cut -150 -z_move -150 -feedrate 100 -dia 0.125 -spindlespeed 150 -pp GRBL_laser -outname laser
DEBUG 20220121_161659 *** TCL command 'TclCommandCncjob' executed.
DEBUG 20220121_161659 *** ToolMilling.mtool_gen_cncjob()
DEBUG 20220121_161659 *** AppObject.new_object()
DEBUG 20220121_161659 *** Calling object constructor...
DEBUG 20220121_161659 *** Creating CNCJob object...
DEBUG 20220121_161700 *** 0.038570 seconds before initialize().
DEBUG 20220121_161700 *** Creating a CNCJob out of a multi-geometry
Indexing geometry before generating G-Code...
Starting G-Code for tool with diameter: 0.125MM.
Finished G-Code generation... 11 paths traced.
[SUCCESS] G-Code parsing in progress...
Parsing GCode file. Number of lines: 500
Creating Geometry from the parsed GCode file. ...
[SUCCESS] G-Code parsing finished...
[SUCCESS] Finished G-Code processing...
DEBUG 20220121_161700 *** New object with name: laser. 0.052939 seconds executing initialize().
New object with name: laser. 0.052939 seconds executing initialize().
DEBUG 20220121_161700 *** camlib.CNCJob.bounds()
DEBUG 20220121_161700 *** Moving new object back to main thread.
DEBUG 20220121_161700 *** on_object_created()
DEBUG 20220121_161700 *** on_object_created --> OC.append()
DEBUG 20220121_161700 *** FlatCAMCNCJob.gcode_header()
DEBUG 20220121_161700 *** CNCJobObject.build_ui()
DEBUG 20220121_161700 *** CNCJobObject.build_ui()
DEBUG 20220121_161700 *** CNCJobObject.build_ui()
[SUCCESS] CNCjob created: laser
DEBUG 20220121_161737 *** CNCJobObject.build_ui()
DEBUG 20220121_161740 *** CNCJobObject.build_ui()
[SUCCESS] Loaded Machine Code into Code Editor...
DEBUG 20220121_161740 *** ######################### Starting the EDITOR ################################
[WARNING] Editor is activated ...

    G-CODE GENERATED BY FLATCAM vUnstable - www.flatcam.org - Version Date: 2021/2/7)

(Name: laser)
(Type: G-code from Geometry)
(Units: MM)

(Created on Venerdì, 21 Gennaio 2022 at 16:17)

(This preprocessor is the default preprocessor used by FlatCAM.)
(It is made to work with MACH3 compatible motion controllers.)

(TOOL DIAMETER: 0.125 mm)
(Feedrate_XY: 100.0 mm/min)
(Feedrate_Z: 100.0 mm/min)
(Feedrate rapids 1500.0 mm/min)

(Z_Cut: -150.0 mm)
(Z_Move: -150.0 mm)
(Z Start: None mm)
(Z End: 15.0 mm)
(X,Y End: None mm)
(Steps per circle: 16)
(Preprocessor Geometry: default)

  47. max xam reporter

    Hi Marius,

    1. the doble dimensions imported, doesn’t matter, I can use scale with factor 0.5 and is working
    2. the cncjob seems don’t load the -pp parameter and use the default. I trying to make a script but coming out a lot of other problems, so if you can tell me how to execute the cncjob from command line to load GRBL_laser

  48. Marius Stanciu

    The issue in the cncjob Tcl command where it did not use the parameters when applied on an imported Geometry (or created in GUI) is fixed.
    BTW, in order for the autocomplete to bring up the updated names for the preprocessors you need to delete the preferences files after the app was closed.

  49. max xam reporter

    Hi Marius,

    the Preprocesor GRBL_Laser is terminated with the last command End MoveZ, that goes to lose the previous focusing.

    if the Preprocessor is default, the field End Move Z is enabled, in my case I set to -150:

    If I select Preprocessor GRBL_Laser the field End Move Z is not visible

    G-CODE GENERATED BY FLATCAM vUnstable - www.flatcam.org - Version Date: 2021/2/7)

(Name: origine.DXF_iso_combined_cnc)
(Type: G-code from Geometry)
(Units: MM)

(Created on Sabato, 22 Gennaio 2022 at 18:15)

(This preprocessor is used with a motion controller loaded with GRBL firmware. )
(It is for the case when it is used together with a LASER connected on the SPINDLE connector.)
(This preprocessor makes no moves on the Z axis it will only move horizontally.)
(The horizontal move is done with G0 - highest possible speed set in the GRBL controller.)
(It assumes a manually focused laser.)
(The laser is started with M3 command and stopped with the M5 command.)

(Feedrate: 100.0 mm/min)
(Steps per circle: 16)
(Preprocessor Geometry: GRBL_laser)

(X range: -0.0625 ... 20.0625 mm)
(Y range: -0.0625 ... 20.0625 mm)

(Laser Power - Spindle Speed: 150.0)

    G21

    G90


    G17


    G94

    ……..last commands

    M5


    M5


    M5

    G0 Z-150.00

  50. Marius Stanciu

    Hello Max,
    You should open a new issue about this problem since now you are talking about the usage from GUI and since until now we discussed here issues regarding your usage of Tcl scripts, things are becoming confusing for someone that may want to check on this issue.

  51. max xam reporter

    Hello Marius,

    I have some troubles to manage the script in Mac osx and linux.

    The path for the files are the same and in linux and osx you can use the “~” tilde to point to your home folder that are :

    for osx ~ is corresponding to /Users/max/

    for linux ~ is corresponding to /home/max

    but if I use the “~” in the script file it cannot load the gerber files.

    I have seen is existing the TclCommands get_path but I don’t know if I can use to solve the issue.

    Do you have any idea?

    Thanls in advance.

    Max

  52. Marius Stanciu

    Hi Max,
    Really this is a thing of Tcl and not FlatCAM Evo (beta).
    You can read more here:
    https://tcl.tk/man/tcl8.5/tutorial/Tcl35.html
    https://tcl.tk/man/tcl8.5/TclCmd/tclvars.htm#M5
    Maybe this? https://stackoverflow.com/questions/11884832/how-to-get-the-home-directory-from-a-variable-in-expect

    LE: https://wiki.tcl-lang.org/page/env
    https://wiki.tcl-lang.org/page/HOME

    LLE: you may need to first do a:

    cd your_path_with_the_~_symbol
    followed by:
    open_gerber my_gerber_in_the_path.gbr

  53. Log in to comment