Pads not importing in RS-274-X Gerber files

Issue #688 open
Robert H created an issue

Win64, FlatCAM v8.994beta

Hi,

Can you tell me what is wrong with these Gerber lines? The file is rejected by FlatCAM as “probably not a Gerber file”, but I can load it just fine in an online PCB verification tool.

%FSLAX33Y33*%
%MOMM*%
%ADD10R, 1.422X1.422*%
G54D10*
G01X013970Y012065D02*
G55D03*
M02*

I am including the entire file generated by QCAD; this code snippet is the very first pad after the aperture descriptions (I renamed the aperture from 15 down to 10, and tagged on the END statement to figure what is obsolete/incorrect in the files from QCAD).

I can see the lines and holes just fine in FlatCAM (using just the Top layer until I figure what’s going on), but none of the pads are showing. All the pads (square and round) show up just fine in the online verification tool.

Thanks!

Comments (20)

  1. Robert H reporter

    I forgot to show what I have in my FlatCAM folder.

    Also, I installed Winpython64-3.11.4.0.

    (I’m having problems uploading images, so forgive me if my comment comes out all screwed up with multiple image copies)

  2. Robert H reporter

    I just noticed that I have only apertures 10, 11 and 13 listed in the properties for the top layer. Shouldn’t they all be listed there?

    I’m missing apertures 12, and 14 to 17.

  3. Robert H reporter

    Thank you so much Marius. So now I’m trying to figure out how to get those lines of code updated into FlatCAM.

    I’m a mainframe programmer by trade (retired) and dabble in C++, but I’ve never done Python, nor used BitBucket.

    I have VS 2022 v17.7.4 installed along with Python support, but I assume the integration is done via that Python download we had to do…?

  4. Robert H reporter

    Bitbucket instructions say I’m supposed to be able to pull the modified file into my local folder.

    But I see no PULL button on the page…?

  5. Marius Stanciu

    Hi,
    I can understand not being familiar with an environment.
    Here is a shortcut to the sources zip bundle: https://bitbucket.org/marius_stanciu/flatcam_beta/get/ca630be1490151bc6461a0fcc73cd0c11fbe424c.zip

    WARNING: this is not a finished software, there are bugs. Some features are not finished. Tools Database is NOT working.

    In regards of how to use the sources you can watch this video:
    https://www.youtube.com/watch?v=doPdeA0YgzQ&ab_channel=MariusStanciu

  6. Robert H reporter

    I started over, uninstalled FlatCAM and WinPython and reinstalled:

    • Winpython64-3.11.4.0dot.exe
    • FlatCAM v8.994beta

    I followed that video to use the source files you linked. I get 2 errors when trying to start FlatCAM using those instructions (tried it both with and without .\ prefix)

    PS C:\Users\Papa\Downloads\FlatCAM\marius_stanciu-flatcam_beta-ca630be14901> python .\flatcam.py
    Traceback (most recent call last):
    
      File "C:\Users\Papa\Downloads\FlatCAM\marius_stanciu-flatcam_beta-ca630be14901\flatcam.py", line 9, in <module>
        from appMain import App
      File "C:\Users\Papa\Downloads\FlatCAM\marius_stanciu-flatcam_beta-ca630be14901\appMain.py", line 38, in <module>
        from shapely import Point, MultiPolygon, MultiLineString, Polygon, LinearRing, LineString
    
    ImportError: cannot import name 'Point' from 'shapely' (C:\Winpython64-3.11.4.0dot\python-3.11.4.amd64\Lib\site-packages\shapely\__init__.py)
    
    PS C:\Users\Papa\Downloads\FlatCAM\marius_stanciu-flatcam_beta-ca630be14901> python flatcam.py
    Traceback (most recent call last):
    
      File "C:\Users\Papa\Downloads\FlatCAM\marius_stanciu-flatcam_beta-ca630be14901\flatcam.py", line 9, in <module>
        from appMain import App
      File "C:\Users\Papa\Downloads\FlatCAM\marius_stanciu-flatcam_beta-ca630be14901\appMain.py", line 38, in <module>
        from shapely import Point, MultiPolygon, MultiLineString, Polygon, LinearRing, LineString
    
    ImportError: cannot import name 'Point' from 'shapely' (C:\Winpython64-3.11.4.0dot\python-3.11.4.amd64\Lib\site-packages\shapely\__init__.py)
    

    I kept a text logfile of all the package installations as a I followed the video. code snippet doesn't make a scroll window and I can’t upload a TXT or ZIP (it says only IMAGES are allowed). So I’ll only post it if you want to see it so I don’t clutter the thread.

  7. Robert H reporter

    Hmm, I can’t open the WinPython Control Panel. It keeps crashing.

    I'm going to uninstall everything and start over with Winpython64-3.9.10.0dot.

  8. Robert H reporter

    I redid everything with WinPython v3.9.10. I get the same 2 errors when I enter PYTHON FLATCAM.PY.

  9. Robert H reporter

    I’m certain that I had uninstalled Python from the Windows Apps list the first time.

    But since I installed v3.9.10, it no longer shows up there, and it keeps crashing when I try to open the WinPython Control Panel to check if PYQT5 and PYQT4 are there.

    There’s something wonky in my system….?

  10. Robert H reporter

    Uninstalled the Python language in Visual Studio 2022 to make sure that didn't interfere. Rebooted.

    Did another attempt; same errors:

    ...POINTING TO FLATCAM SOURCE FOLDER...
    
    python flatcam.py
    Traceback (most recent call last):
    
      File "C:\Users\Papa\Downloads\FlatCAM source\Files\flatcam.py", line 9, in <module>
        from appMain import App
    
      File "C:\Users\Papa\Downloads\FlatCAM source\Files\appMain.py", line 38, in <module>
        from shapely import Point, MultiPolygon, MultiLineString, Polygon, LinearRing, LineString
    
    ImportError: cannot import name 'Point' from 'shapely' (C:\Winpython64-3.9.10.0dot\python-3.9.10.amd64\lib\site-packages\shapely\init.py)
    

    I kept a summary of all the package installations and results:

    ...POINTING TO PYTHON PACKAGE FOLDER...

    python
    version3.9.10.0dot installed

    pip -v
    version 21.3.1 installed

    pip install .\GDAL-3.4.3-cp39-cp39-win_amd64.whl
    Successfully installed GDAL-3.4.3

    pip install .\matplotlib-3.5.2-cp39-cp39-win_amd64.whl
    Successfully installed cycler-0.12.0
    fonttools-4.42.1
    kiwisolver-1.4.5
    matplotlib-3.5.2
    numpy-1.26.0
    packaging-23.1
    pillow-10.0.1
    pyparsing-3.1.1
    python-dateutil-2.8.2
    six-1.16.0

    pip install .\rasterio-1.2.10-cp39-cp39-win_amd64.whl
    Successfully installed affine-2.4.0
    attrs-23.1.0
    certifi-2023.7.22
    click-8.1.7
    click-plugins-1.1.1
    cligj-0.7.2
    colorama-0.4.6
    rasterio-1.2.10
    snuggs-1.4.7

    pip install .\Rtree-1.0.0-cp39-cp39-win_amd64.whl
    Successfully installed Rtree-1.0.0

    pip install .\Shapely-1.8.2-cp39-cp39-win_amd64.whl
    Successfully installed Shapely-1.8.2

    pip install dill
    Successfully installed dill-0.3.7

    pip install pyopengl
    Successfully installed pyopengl-3.1.7

    pip install ortools
    Successfully installed absl-py-2.0.0
    ortools-9.7.2996
    protobuf-4.24.3

    pip install svg.path
    Successfully installed svg.path-6.3

    pip install simplejson
    Successfully installed simplejson-3.19.1

    pip install freetype-py
    Successfully installed freetype-py-2.4.0

    pip install lxml
    Successfully installed lxml-4.9.3

    pip install ezdxf
    Successfully installed ezdxf-1.1.0
    typing-extensions-4.8.0

    pip install qrcode
    Successfully installed pypng-0.20220715.0
    qrcode-7.4.2

    pip install reportlab
    Successfully installed reportlab-4.0.5

    pip install svglib
    Successfully installed cssselect2-0.7.0
    svglib-1.5.1
    tinycss2-1.2.1
    webencodings-0.5.1

    pip install pyserial
    Successfully installed pyserial-3.5

    pip install pikepdf
    Successfully installed deprecation-2.1.0
    pikepdf-8.4.1

    pip install pywin32
    Successfully installed pywin32-306

    pip install pyqt6
    Successfully installed PyQt6-Qt6-6.5.2
    PyQt6-sip-13.5.2
    pyqt6-6.5.2

    pip install vispy
    Successfully installed hsluv-5.0.4
    vispy-0.14.0

    pip install foronoi
    Successfully installed foronoi-1.0.3
    graphviz-0.20.1

    pip install networkx
    Successfully installed networkx-3.1


    Kept a list of all packages installed:

    pip list
    Package Version

    absl-py 2.0.0
    affine 2.4.0
    attrs 23.1.0
    certifi 2023.7.22
    click 8.1.7
    click-plugins 1.1.1
    cligj 0.7.2
    colorama 0.4.6
    cssselect2 0.7.0
    cycler 0.12.0
    deprecation 2.1.0
    dill 0.3.7
    ezdxf 1.1.0
    fonttools 4.42.1
    foronoi 1.0.3
    freetype-py 2.4.0
    GDAL 3.4.3
    graphviz 0.20.1
    hsluv 5.0.4
    kiwisolver 1.4.5
    lxml 4.9.3
    matplotlib 3.5.2
    msvc-runtime 14.29.30133
    networkx 3.1
    numpy 1.26.0
    ortools 9.7.2996
    packaging 23.1
    pikepdf 8.4.1
    Pillow 10.0.1
    pip 21.3.1
    protobuf 4.24.3
    PyOpenGL 3.1.7
    pyparsing 3.1.1
    pypng 0.20220715.0
    PyQt6 6.5.2
    PyQt6-Qt6 6.5.2
    PyQt6-sip 13.5.2
    pyserial 3.5
    python-dateutil 2.8.2
    pywin32 306
    qrcode 7.4.2
    rasterio 1.2.10
    reportlab 4.0.5
    Rtree 1.0.0
    setuptools 60.5.0
    Shapely 1.8.2
    simplejson 3.19.1
    six 1.16.0
    snuggs 1.4.7
    sqlite-bro 0.12.1
    svg.path 6.3
    svglib 1.5.1
    tinycss2 1.2.1
    typing_extensions 4.8.0
    vispy 0.14.0
    webencodings 0.5.1
    wheel 0.37.1
    winpython 4.6.20220116

  11. Marius Stanciu

    Hi,

    Using the sources bundle link that I’ve posted above, you can also use the latest version of WinPython, one based on Python 3.11.x.
    The error you get is because you use the Shapely 1.8.2 package. Upgrade that package using the Command Prompt and typing:
    pip install --upgrade shapely
    In the end you should have a 2.x version of Shapely.

    PS:
    I have never used the WinPython Control Panel so I can’t tell you why it crashed.
    Using the sources you will launch what will eventually be FlatCAM EVO so you don’t need to have FlatCAM 8.994 installed on your system.

  12. Robert H reporter

    Thank you very much Marius!

    Updated to Shapely v2.0.1

    python flatcam.py
    ModuleNotFoundError: No module named 'qdarktheme'

    pip install pyqtdarktheme
    Successfully installed darkdetect-0.7.1
    pyqtdarktheme-2.1.0

    python flatcam.py
    ModuleNotFoundError: No module named ‘qdarktheme.themes'

    Can’t find any link in google that says how to install the light and dark themes. So I did what they did here and commented out those lines.
    https://aur.archlinux.org/packages/flatcam-qt6#comment-848387
    but I would much have preferred to install whatever module I am still missing.

    ... Resistance is futile. You will be assimilated ...

  13. Robert H reporter

    Should I remain on Python 3.9.10.0dot?

    Or should I reinstall with v3.11.4.0dot?

    What do you recommend so that I don’t get stuck on some compatibility issue down the road?

  14. Marius Stanciu

    Hi,
    I think you should use WinPython based on Python 3.11.x, it is a little better in term of performance.

    In regards of the pyqtdarktheme package, it is always a good thing to look in the requirements.txt file in the sources.
    It is not always updated but it may give you hints.

    So in the case of pyqtdarktheme do this:
    pip install pyqtdarktheme==1.1.1

    The latter versions of this package changed too much the package and I preferred to keep using this older version.

  15. Robert H reporter

    Excellent (Mr Burns voice)

    Darktheme corrected, restored original AppMain.py and I’m a happy camper.
    :)

  16. Robert H reporter

    As a thank you for all this, I’ve added a comment in your video. I tried to document all the packages required, without getting into all the details and reasons so they still have to listen to your video.

    Hopefully the next guy like me with ZERO Python or Bitbucket knowledge will find things a tad easier.

    Cheers! ;)

  17. Log in to comment