Crash when try to mill slots

Issue #417 resolved
Stefan Lechner created an issue

I’v a gerber/execlon export from KiCad. flatCam build from source today branch Beta running on Ubuntu 20.04

It’s great, I got almost anything managed but those 3 weird 0.8mm slots.

flatCam shows me the slots, it also detects them and list it in the tools table.

But when I try to mill this slot, I get an internal error.

object (geometry) failed because:  

Traceback (most recent call last):
  File "/usr/share/flatcam-beta/FlatCAMApp.py", line 2824, in new_object
    return_value = initialize(obj, self)
  File "/usr/share/flatcam-beta/flatcamObjects/FlatCAMExcellon.py", line 1261, in geo_init
    assert geo_obj.kind == 'geometry' "Initializer expected a GeometryObject, got %s" % type(geo_obj)
AssertionError

Any hit, how to get around this ?

Comments (8)

  1. Marius Stanciu

    Hello Stefan,
    It will help to mention the following:

    • flatcam version you are using
    • OS you are using (I guess is Unix-like but …)

    Thanks,
    Marius

  2. Marius Stanciu

    @Stefan Lechner
    In any case, I found the issue and it is present in my working copy, too. And it was a quick fix.
    Since you are running the app from sources you can do the following:

    • locate the file /usr/share/flatcam-beta/flatcamObjects/FlatCAMExcellon.py
    • edit it and go to line 1261
    • replace the line:

    assert geo_obj.kind == 'geometry' "Initializer expected a GeometryObject, got %s" % type(geo_obj)
    with:
    assert geo_obj.kind == 'geometry', "Initializer expected a GeometryObject, got %s" % type(geo_obj)

    The fix is by adding a missing comma between:
    the comparison geo_obj.kind == 'geometry' and the string "Initializer expected a GeometryObject, got %s" % type(geo_obj)

  3. Stefan Lechner reporter

    Great, thanks a lot this fixed the issue.

    Btw. ok I wrote the “dev coordinates” in text form but it was there:

    I’v a gerber/execlon export from KiCad. flatCam build from source today branch Beta running on Ubuntu 20.04

    Now I’ll go over to mill, thanks again

  4. Marius Stanciu

    Hi Stefan,

    It must have been the late hour. Anyway, the Beta branch is not to be used. Use the provided source bundle in the Downloads section. I use the Beta branch for work and things may be broken.
    For example, currently this is the situation, things are broken due of changes, This is why for a while I did not pushed things to Beta branch until things were ready for a new release, but some people complained that I work in private.
    Seems that I should return to that practice…

  5. Stefan Lechner reporter

    Hi Marius,

    first, a big thank you to spend your time to this project. Then thanks for fixing this issue.

    But it seems that I have to clarify some things. I’m a professional java developer, working on large projects, knowing all those problems, when doing bigger refactoring. We’ve setup quality gates to know at any time how the health of our projects is.

    For the moment, I’m very busy in my work, it’s a kind of 8-10PM, so I was not able to share my finding with the public. But I made a clone and I’m working on this clone.

    Imho a beta, must not be stable not even feature complete. It’s a working branch that needs a lot of testing to get ready for release. Thats the reason why I reported this issues.

    If you don’t want to have reports on this branch, I’ll no longer report those and fix them my self, sending you a pull request when done. My major problem is python and a useable dev environment. But in the mean time I found PyCharm, which is a well known environment to me.

    So please don’t stop pushing things to this branch…

  6. Marius Stanciu

    Hi Stefan @Stefan Lechner ,

    As opposite to you, I’m doing developing in my free time and my coding style is really lacking. I kind of throw it to the wall and hope to stick 🙂 But that is prone to errors.
    Furthermore, this program ate my free (and not so free) time like crazy, in an insane amount. I may have to slow down the pace since there are other things to do.
    That will solve the problem with minor things like missing commas and so on who appear due of fatigue and working late in night.

    Reporting bugs is awesome, and really, really helps !!! That’s one of the things that I think is a necessary contribution and the minimum that someone that uses this free software can do. The only thing is that I was very much preferring that this to be done not on the working copy but on the latest “release”/build (sources zip bundle in Downloads).

    This repository is not mine, it belongs to the program author JP Caram, and although he kindly gave me the right to write I felt that creating too many branches might be seen as an abuse.
    Especially since I don’t think that FlatCAM proper will ever be what is Beta. Beta is almost a different program based of course on FlatCAM and initially I wanted to fork it and create it as a new product but the program author asked me to keep it as FlatCAM and name it Beta, due of personal reasons.

    But in the end I think that the solution will be to have the Beta branch as the “stable” version and start to do the working on version branches who get eventually merged into the Beta ‘master’ branch.

    I also use PyCharm as IDE and it’s awesome (barring some performance issues but easy overcome by using a good PC).
    If you can contribute, even have ideas, please do. I think we all will enjoy seeing something that can exit hobby only area and enter also into the professional area.

    Right now I am thinking to those features for the future:

    • a machinist tool who will give us the freedom to do limited mechanical work - like milling a front panel for a case
    • adding tear drops to Gerbers (might not be that easy due of possible violations of clearances with a possible copper ground pour).
    • improve the PDF parser so it can parse PDF’s with PCB patterns that have ground planes (right now it malfunction in those cases)
    • ability to import a image in background and use the Gerber editor to trace it (reverse engineer a PCB)

    And something that I might not do without help:

    • a embedded GCode simulator
    • import directly a Eagle .brd file and generate all the Gerbers and Excellon files inside the app
    • import an ASCII export of PCB from Altium and generate all the Gerbers and Excellon files inside the app

    Have a great day,
    Marius

    PS: If you look at the Beta repo, I just updated it with fixes and new FlatCAM tools (corner makes tool and etch compensation tool) and also new features like multi-tool isolation with rest machining (isolate with bigger tool then what can’t be isolated will be passed to the next tool) or ability to add exclusion zones for travel who will be bypassed by going either around or over (the tool will avoid going in those areas) and many GUI changes. It’s basically more or less the 8.993 version.

  7. Marius Stanciu

    And Stefan,
    if you have the time and would like to help, there is a need to review the PDF parser which will certainly benefit from someone else’s review.
    Thanks,
    Marius

  8. Log in to comment