Problem panelizing excellon

Issue #226 new
Todd Stellanova created an issue

I'm trying to use the panelize command to panelize an excellon file.

My script looks something like this:

open_excellon ${DrillFileName} -outname AllDrills panelize AllDrills -box OneBox -columns 2 -rows 1 -outname AllDrills_panelized

First of all, I run into an exception while running this:

[ERROR][MainThread] Exec command Exception: '3'
Python traceback: <type 'exceptions.KeyError'>
  File "/Users/todd/bin/flatcam/camlib.py", line 2804, in create_geometry > tooldia = self.tools[drill['tool']]['C']
  File "/Users/todd/bin/flatcam/FlatCAMObj.py", line 749, in merge > exc_final.create_geometry()
  File "/Users/todd/bin/flatcam/tclCommands/TclCommandPanelize.py", line 107, in initialize_local_excellon > FlatCAMExcellon.merge(obj, obj_init)
  File "/Users/todd/bin/flatcam/FlatCAMApp.py", line 1055, in new_object > initialize(obj, self)
  File "/Users/todd/bin/flatcam/tclCommands/TclCommandPanelize.py", line 124, in execute > self.app.new_object("excellon", local_outname, initialize_local_excellon)
  File "/Users/todd/bin/flatcam/tclCommands/TclCommand.py", line 269, in execute_wrapper > return self.execute(args, unnamed_args)
    while executing
"panelize AllDrills -box OneBox -columns 2 -rows 1 -outname AllDrills_panelized"

This appears to be bug here:

https://bitbucket.org/jpcgt/flatcam/src/936eb63ba1c2b5035ea37e7deaa05fb3012c3ddb/tclCommands/TclCommandPanelize.py?at=master&fileviewer=file-view-default#TclCommandPanelize.py-107

Should that line read "objs" and not "obj" ? Making that change I am able to avoid the exception, but no panelized geometry is created.

Since I'm unable to panelize drills, my panelization is blocked. I am able to successfully panelize mill commands.

Comments (10)

  1. Marius Stanciu

    Hi Todd!

    I used your file and it is not working as you said. But I did imported in another software (Sprint Layout) and exported it. The exported file was panelized in FlatCAM without issues.

    Therefore, there is something that KiCAD is doing when exporting Excellon files that FlatCAM panelization function do not like. Actually when I tried to load your file into Camtastic (Altium Designer, the EDA software that I use) it will not load correctly no matter what I tried.

    The workaround is to load your Excellon files generated in KiCAD into a software that can open them correctly (like Sprint Layout).

    Attached is the exported version of your file, that do work in FlatCAM panelization process. https://www.dropbox.com/s/lw0lhi8x2iidxym/ntc-chip-stm32-flasher_sprint.drl?dl=0

  2. Todd Stellanova reporter

    Thanks for the info Marius. Can you tell me which version of flatcam worked for you for panelization? The version I pulled from master did not seem to be functional.

  3. Marius Stanciu

    I am aware that the version from bellow is no longer actual (there were other fixes since this commit) but I use a modified version of this:

    https://bitbucket.org/Denvi/flatcam/downloads

    My modified version mostly adds some corrections on the drill diameters (FlatCAM is made with imperial system in mind and metric system is supported by conversion) to reduce the number of decimals, also I added a manual toolchange procedure and also added the possibility to generate negative (and positive black) .SVG files. Those SVG files I open with Inkscape and then print PDF's that I use to make the required exposure films for UV method of doing PCB's. If you want to use it, here it is: https://www.dropbox.com/s/020r6m04zs45hml/Denvi-flatcam.zip?dl=0

    If you want to use it, make sure to install first the VisPY package with:

    pip install https://github.com/vispy/vispy/archive/master.zip

    Also make sure that when you try to do panelization you use all the parameters. I use a command like this:

    'panelize -excellon_file_name -box box_file_name -spacing_columns 0 -spacing_rows 0 -columns 2 -rows 2'

    The '0' and '2' parameters will depend on your preferences. Use 'help panelize' command to see the syntax.

  4. Todd Stellanova reporter

    I've compared master branch and the version referenced by Marius, and it appears that some of the panelization code may have been broken by the shift to the "new architecture" for tclCommands. From what I can tell there were no existing unit tests for panelization, so perhaps that's why the problem went undetected.

    I've opened a pull request that appears to fix the problem on master: https://bitbucket.org/jpcgt/flatcam/pull-requests/58/add-panel-instances-to-panelization-list/diff

  5. Juan Pablo Caram repo owner

    @thrusty , @marius_stanciu , is this resolved?

    What was the result of the discussion about it having to do with the format of the source file (it worked with files from a different CAD program)?

  6. Log in to comment