Milling a drill object does not work - FlatCAM 8.5

Issue #240 new
Thomas Hondema created an issue

When I click the button Generate on the drill's geometry object nothing happens.

Comments (16)

  1. toms01

    same problem here:

    #!
    
    [DEBUG][MainThread] on_generatecnc_button_click--> FlatCAMObj.read_form()
    [DEBUG][MainThread] Object something.drl_mill_cnc has been promised.
    [DEBUG][Dummy-2] Running task: {'params': [<FlatCAMApp.App object at 0x7f1d98f4c938>], 'fcn': <function job_thread at 0x7f1d8921a668>}
    [DEBUG][Dummy-2] FCVisibleProcessContainer.on_change()
    [DEBUG][Dummy-2] new_object()
    [DEBUG][Dummy-3] Running task: {'params': [<FlatCAMApp.App object at 0x7f1d98f4c938>], 'fcn': <function job_thread at 0x7f1d8921a668>}
    [DEBUG][Dummy-3] Task ignored.
    [DEBUG][Dummy-2] Calling object constructor...
    [DEBUG][Dummy-2] Creating CNCJob object...
    [DEBUG][Dummy-2] 0.000438 seconds before initialize().
    [DEBUG] generate_from_geometry_2()
    [ERROR][Dummy-2] Abnormal termination of process!
    [ERROR][Dummy-2] <type 'exceptions.RuntimeError'>
    [ERROR][Dummy-2] maximum recursion depth exceeded
    [ERROR][Dummy-2] <traceback object at 0x7f1d89232f38>
    [DEBUG][Dummy-2] FCVisibleProcessContainer.on_done()
    [DEBUG][Dummy-2] FCVisibleProcessContainer.on_done()
    Traceback (most recent call last):
      File "/home/blubb/flatcam/FlatCAMWorker.py", line 62, in do_worker_task
        raise e
    RuntimeError: maximum recursion depth exceeded
    
  2. Thomas Hondema reporter

    Aah I see. Are you running on Linux/OSX? I'm running it on Windows but I'm having troubles running it from the cmd line.

  3. Juan Pablo Caram repo owner

    I have very little time to review this, but could you please update your description of the problem with a "minimal" example that will reproduce the problem? Please be minimal, use 1-2 holes, and be detailed, specify their diameter, coordinates, etc, and any other relevant options.

  4. toms01

    Hello jpcgt,

    i have the following minimal excellon-example out of Kicad 4.0.6:

    drill.drl:

    #!
    
    M48
    METRIC,TZ
    T1C1.000
    T2C3.200
    %
    G90
    G05
    T1
    X11.43Y39.37
    T2
    X5.08Y45.72
    T0
    M30
    

    Steps to reproduce: 1. Load excellon-file 2. "Mill Holes" 3. In drill.drl_mill push "Generate"

    => RuntimeError: maximum recursion depth exceeded

    Btw: Thank you for your great work!

  5. Juan Pablo Caram repo owner

    You are very welcome!

    Please also list the settings used to generate the milling geometry (tool diameters and so on) and for generating the CNC job.

  6. toms01

    ah... if i choose 0.9mm for the tool diameter at the "Excellon Object" for milling holes it works. if it is the same like the smallest hole it doesn't work, but it has to?

    => circle with radius 0?

  7. Juan Pablo Caram repo owner

    Yea, that's what I though. A circle with radius of 0 will vanish. Also, you don't want to use a milling bit for drilling. They are not designed for that.

    So:

    1. I though an error message would be shown when this happens. Apparently it is not being shown? What version are you using. The Windows installer, the latest source, other?
    2. The "Mill Holes" feature only makes sense for very large holes. Use a drill bit instead. If you use a milling bit for drilling it will wear out very quickly or break.

    Then, do we agree that the real problem here is just that nothing is happening when a proper error message or warning should display instead?

  8. toms01

    i'm using the latest version on a gentoo-linux and i get no warnings (only in the console-logs). You are absolutely right; there is no problem and i'd appreciate if a warning will be displayed. Sorry for waisting your time and thanks for all your help!

  9. Juan Pablo Caram repo owner

    On the contrary, this will save a lot of people a lot of time. In fact, this is a recurring problem: See #230 and #166.

    So we will leave this ticket open until it is properly fixed. Thanks.

  10. Thomas Hondema reporter

    @jpcgt I have confirmed my problem is the same as @toms01.

    Regarding the issue of using a mill as a drill its something I usually only do when I'm drilling a couple of holes all in different sizes to reduce the needed tool changes .

    For now I have a couple of workarounds for this problem:

    • Use the same drill for different sized holes.

    • Enter a slightly smaller size for the mill, this will increase the size of the actual holes though.

    • Use an even smaller mill.

    Although it would be nice to be able to mill a hole in the same size as the mill its not a priority for me personally. Having a clear error message would be nice improvement.

    Thanks for your time!

  11. Mike Evans

    I see another error that occurs before this step when running the Generate mill geometry step.

    This occurs in FlatCamObj.py plot_element(), line 1664. When holes have the same diameter as the drill, the element (LinearRing) object has no x,y values.

    Running from a terminal I see:

    Traceback (most recent call last):
    File "/home/mikee/Projects/flatcam-clone/FlatCAMObj.py", line 1667, in plot_element
    for sub_el in element:
    TypeError: 'LinearRing' object is not iterable

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/home/mikee/Projects/flatcam-clone/FlatCAMApp.py", line 1575, in on_object_created
    obj.plot()
    File "/home/mikee/Projects/flatcam-clone/FlatCAMObj.py", line 1741, in plot
    self.plot_element(self.solid_geometry)
    File "/home/mikee/Projects/flatcam-clone/FlatCAMObj.py", line 1668, in plot_element
    self.plot_element(sub_el)
    File "/home/mikee/Projects/flatcam-clone/FlatCAMObj.py", line 1686, in plot_element
    x, y = element.coords.xy
    AttributeError: 'list' object has no attribute 'xy'

    There is no error report in the command line window of FlatCam and the .mill object is produced but the plot is not updated.

    Running Create CNC job on the mill object causes a

    IndexError: list index out of range

    with no output in the command line window but no cnc object either.

    Whatever code creates the element (LinearRing) needs to check that it has coords.xy and deal with it before the plot_element() call and or a check for this in plot_element() should be added.

    if len(element.coords) == 0:

    will do that.

    To solve the immediate issue though:

    The generate_milling() method checks if tool size is greater than hole size and emits a warning, line 909. Changing this line to

    if self.tools[tool]["C"] <= tooldia:

    will emit a warning and stop processing the mill job.

    I’ll do a PR.

  12. Log in to comment