Postprozessing

Jono
2011-01-08
2013-03-08
  • Jono

    Jono - 2011-01-08

    Hello,

    I'm a German cabinetmaker, and my problem is, that our routers don't use normal G-code. Do you plan to add an postprozessing Script like they are used in other cam-systems or where can I find it?
    Pycam is the most powerful open source CAM I found sofar and I would love to try the results!

    btw I had Problems in runnig pycam under opensuse 11.3. It told me, that python-gtkglext1 is not available. in the opensuse-repositories I can only find python-gtkglext. I don't know, where the difference is, perhaps you can have a look at that. At the Moment I do my testing under wine, witch is painfully slow.
    Here is a link to the standard RPM, so you can easily take a look at the filelist.
    python-gtkglext.rpm

    Regards
    Herbert

     
  • Lars

    Lars - 2011-01-09

    Hi Herbert,

    can you point me to specific examples of the kind of postprocessing scripts, that you are looking for?

    regarding OpenSuSE: I added it to the list of distribution-specific installation hints: https://sourceforge.net/apps/mediawiki/pycam/index.php?title=Requirements#OpenSuSE

    Could you please verify this section?

    cheers,
    Lars

     
  • Jono

    Jono - 2011-01-11

    Hi Lars,

    Opensuse seems not to like pycam :)
    Next Problem, python-gtk as available (Version 2.14.0-4) the same as python-gtk2 ?
    Both python-gtk and python-gtkglext  (Version 1.1.0-116) are installed and I still get the following Messages:

    Psyco is not available (performance will probably suffer slightly)
    Enabled 2 parallel local processes
    Imported STL model: 75 vertices, 0 edges, 46 triangles
    Failed to initialize the interactive 3D model view.
    Please install 'python-gtkglext1' to enable it.

    About postprozessing, I need a way to modify the output to my needs without the need to touch the source code. Sheetcam in example uses lua to control the output. I don't know witch language fits best. I can send you some examples.
    Theoretically it can be done in python too, but i think it is to complicated for end users to perform adjustments.
    gcode.py is where it is done now I think.

    On Morbidelli and SCM-machines I need code like that:

    H DX=660 DY=95 DZ=12 -I C=0 T=0 R99 *MM /def BX=0 BY=-0 BZ=0
    *Post: SCM_V1.4.scpost
    *Date: 15.01.2010
    *Schrifttest(1)
    *Radiuskorrektur innen,white,T137: V-Fr_ser, 1 mm Durchmesser,1,5 mm Tief
    *
    F1
    C0
    G0 X=367.161 Y=46.495 Z=-0 V2000 S18000 T137
    G1 X=367.121 Y=45.63 Z=1.5
    G1 X=367.046 Y=45.05
    G3 X=366.62 Y=43.556 I=360.467 J=46.116 V1000
    G3 X=363.251 Y=41.046 I=362.945 J=44.974
    G1 X=363.173 Y=41.044 V2000
    G3 X=360.76 Y=41.671 I=363.283 J=46.429 V1000
    G1 X=359.622 Y=42.391 V2000
    G1 X=358.68 Y=43.196
    G1 X=357.919 Y=43.99

    this is 'near' standard gcode, but not the same. The G0 is a cycle, that includes the Tool-change (if necessary) tuns the spindle on (CW or CCW comes from the tooltable) makes alle Z-moves, the radius compensation and the first G1. C0 C1 and C2 are equivalent to G40-42.

    Homag and Weeke use a completely different code in their files:

    [H
    VERSION="4.0 Alpha"
    HP="1"
    IN="0"
    GX="0"
    BFS="1"
    GY="0"
    GXY="0"
    UP="0"
    FM="1"
    FW="800"
    ZS="20"
    HS="1"
    OP="1"
    MAT="WEEKE"
    DN="STANDARD"
    INCH="0"
    VIEW="NOMIRROR"
    ANZ="1"
    BES="0"
    ENT="0"
    _BSX=500.000000
    _BSY=300.000000
    _BSZ=19.000000
    _FNX=0.000000
    _FNY=0.000000
    _RNX=0.000000
    _RNY=0.000000
    _RNZ=0.000000
    _RX=500.000000
    _RY=300.000000

    [001
    l="500"
    KM="Länge in X"
    b="300"
    KM="Breite in Y"
    d="19"
    KM="Dicke des Werkstücks in Z"

    ]1
    $E0
    KP
    X=0.0
    Y=0.0
    Z=0.0
    KO=0
    .X=0.000000
    .Y=0.000000
    .Z=0.000000
    .KO=0

    $E1
    KL
    X=l
    Y=0.0
    .X=500.000000
    .Y=0.000000
    .Z=0.000000
    .WI=0.000000
    .WZ=0.000000

    $E2
    KL
    X=l
    Y=b
    .X=500.000000
    .Y=300.000000
    .Z=0.000000
    .WI=1.570796
    .WZ=0.000000

    $E3
    KL
    X=0
    Y=b
    .X=0.000000
    .Y=300.000000
    .Z=0.000000
    .WI=3.141593
    .WZ=0.000000

    $E4
    KL
    X=0
    Y=0
    .X=0.000000
    .Y=0.000000
    .Z=0.000000
    .WI=4.712389
    .WZ=0.000000

    <100 \WerkStck\
    LA="l"
    BR="b"
    DI="d"
    FNX="0"
    FNY="0"
    AX="0"
    AY="0"

    <105 \Konturfraesen\
    EA="1:0"
    MDA="SEI"
    STUFEN="0"
    OSZI="0"
    OSZVS="0"
    ZSTART="0"
    ANZZST="0"
    RK="WRKR"
    EE="1:4"
    MDE="SEI_AB"
    EM="0"
    RI="1"
    TNO="128"
    SM="0"
    S_="STANDARD"
    F_="5"
    AB="0"
    AF="0"
    VLS="0"
    VLE="0"
    ZA="-2"
    HP="0"
    SP="0"
    YVE="0"
    WW="1,2,3"
    ASG="2"
    KG="0"
    RP="STANDARD"
    RSEL="0"
    RWID="0"
    KAT="Fräsen"
    MNM="Fräsen"
    MX="0"
    MY="0"
    MZ="0"
    MXF="1"
    MYF="1"
    MZF="1"

    <101 \Kommentar\
    KM="WEEKE BHC"
    ??="0"
    !

    producing that kind of output is a pain in the ass :) lucky me I do not have a homag machine

    Some can run gcode, but then we have to take care of every machine and plc-specific option. Most times not easier.

     
  • Lars

    Lars - 2011-01-11

    Hi Herbert,

    Next Problem, python-gtk as available (Version 2.14.0-4) the same as python-gtk2 ?
    Both python-gtk and python-gtkglext  (Version 1.1.0-116) are installed and I still get the following Messages:

    That's weird.

    Could you check, which of the following import commands fails in an interactive python interpreter?

        import gtk.gtkgl
        import OpenGL.GL as GL
        import OpenGL.GLU as GLU
        import OpenGL.GLUT as GLUT
    

    Theoretically it can be done in python too, but i think it is to complicated for end users to perform adjustments.
    gcode.py is where it is done now I think.

    almost: "gcode.py" is just the remaining piece of the old GCode generator. Currently only "GCodeExporter.py" is in use.

    For now I did not plan specific postprocessing options. But they are obviously necessary for a lot of users.
    The next release (v0.4.1) is almost ready. Afterwards I will start to develop a plugin system that will also include postprocessing scripts.
    I took a quick look at SheetCAMs postprocessing scripts in lua and I think the same will be easily doable in python.

    From my point of view, machine-specific GCode generation will be possible with PyCAM within a few months. Until then you will need to be patient (or subclass "GCodeExporter" on your own).

    Thanks for your input!

    Please report back with your progress regarding the 3D view …

    cheers,
    Lars

     
  • Jono

    Jono - 2011-01-11

    Hi Lars,

    I'm making some progress here,
    first try I got that result

    >>> import gtk.gtkgl
    >>> import OpenGL.GL as GL
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named OpenGL.GL
    >>> import OpenGL.GLU as GLU
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named OpenGL.GLU
    >>> import OpenGL.GLUT as GLUT
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named OpenGL.GLUT

    so I thought, ok lets look for something like python-opengl, found and installed it. (version 3.0.0-5.2) and tried again.

    >>> import OpenGL.GL as GL
    >>> import OpenGL.GLU as GLU
    >>> import OpenGL.GLUT as GLUT

    Now the next problem: When I start pycam directly in the downloaded folder by ./pycam the Program comes up correct. So I thought build and install it with
    ./setup.py build
    ./setup.py install (as root)

    when I try to run pycam now (should be in the path now I thought) I get:

    Psyco is not available (performance will probably suffer slightly)
    Enabled 2 parallel local processes
    Failed to locate a resource file (pycam-project.ui) in !
    You can extend the search path by setting the environment variable 'PYCAM_DATA_DIR'.

    The file pycam-project.ui installed at /usr/local/share/pycam/ui not /usr/share/pycam/ui at my place. Don't know, what exactly went wrong there. I placed a link  in usr/share to usr/local/share to make it work, but I guess this is not the way it should be :)

    I will definitely looking forward to machine-specific GCode generation!

     
  • Lars

    Lars - 2011-01-12

    Hi Herbert,

    thanks for your feedback!

    I omitted the requirement "python-opengl" from the list of packages to be installed, because it is a dependency of python-gtkglext (on Debian). But technically this dependency does not seem to be necessary. The absence of this dependency in OpenSuSE's package indicates this as well. Thus I added it to the list of packages to be installed for PyCAM:
    https://sourceforge.net/apps/mediawiki/pycam/index.php?title=Requirements

    Regarding the path below /usr/local/share: I never noticed this. I added it now to the list of directories that PyCAM will scan for its UI files.

    btw: I noticed a problem with the debian package of python-opengl <v3.0.1. Thus maybe you will run into visual or other problems with your version of python-opengl. Please report back if you encounter any problems (and maybe also where you found a newer package for SuSE).

    Thanks for your hints!
    Lars

     

Log in to post a comment.