585,875 active members*
4,132 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2005
    Posts
    1662

    just another python gcode thing

    Here's a counterbore companion to Dan Falcks boltcircle.py. The toolpath is simple and not extremely efficient. However it appears to be reliable. The user is left to make some decisions and a small bit of math. The idea was to leave the program as flexible as possible for a wide range of mills. It can also place counterbores at any coordinate in a one-at-a-time-copy-and-paste kind of way.

    The included help files make some mention of a commented gcode file. This isn't implemented so far.

    John T has put up a more elaborate counterbore program on the wiki. It does some pretty cool tricks. That same wiki page has a surprising gedit/emc trick. Can't wait to try it out.
    http://wiki.linuxcnc.org/cgi-bin/emc...ode_Generators
    Attached Files Attached Files
    Anyone who says "It only goes together one way" has no imagination.

  2. #2
    Join Date
    Sep 2004
    Posts
    149
    I will try out your code this weekend. I'm glad that you have found python to be fun to program in. If you're interested in the gedit plugins, I plan on adding a bit more to the wiki, showing how to do a python gui that talks to the editor.
    Keep on hacking!

    Dan

  3. #3
    Join Date
    Apr 2003
    Posts
    307
    I'm going to try to learn Python.
    I haven't really done much programming since, well, Basic and Turbo Pascal.
    I've got Python 2.5 and a book that I am working thru.
    I want to try to extract those Hershey fonts they were talking about.
    Be able to display a table to choose from and then output a scalable Gcode.
    Does that sound doable for a newb or should I work up to it?

    Chris

  4. #4
    Join Date
    May 2005
    Posts
    1662
    Quote Originally Posted by cbcnc View Post
    I've got Python 2.5 and a book that I am working thru.........

    Does that sound doable for a newb or should I work up to it?
    Hopefully that question was addressed to Dan I'm also a newb.

    The program above was a learning exercise and part of the motivation for posting it was to get feedback on the content and style. The code is mostly "borrowed". Books and tutorials put me to sleep.

    btw a rewrite is underway. The next version will be much cleaner and will do much more.
    Anyone who says "It only goes together one way" has no imagination.

  5. #5
    Join Date
    Apr 2003
    Posts
    307
    There is something to going through and programming things yourself as a learning excercise.
    I had the thought though that there's obviously code to take numbers and turn them into gcode.
    Are there any independant modules or scripts or are they all just in the individual scripts?

    Chris

  6. #6
    Join Date
    Sep 2004
    Posts
    149
    I have found that studying other people's code helps me the most. That makes it easy to see what does and doesn't work. You could look at a working program and change it slightly to see what happens. Keep a reference book or web site handy to check the things that you don't understand.
    As far as converting the fonts, I don't know what it would involve, but if you really have an interest in that project- yes go for it. But, look for some other conversion programs first, to see how others have done it.
    important things to learn for CAM and python- string formatting and file input and output. It seems to me that the math routines in python are really intuitive, so you will pick up on that pretty easily.
    Work on the gui routines after you understand strings and file io.

    Dan
    P.S. I am no expert in python. I just really like it a lot and find it easy to understand (now).

  7. #7
    Join Date
    Feb 2007
    Posts
    514
    Quote Originally Posted by cbcnc View Post
    There is something to going through and programming things yourself as a learning excercise.
    I had the thought though that there's obviously code to take numbers and turn them into gcode.
    Are there any independant modules or scripts or are they all just in the individual scripts?

    Chris
    Do a google on "ttt truetype tracer" and you will find what you seek... It is in C by could be done in python... heck I might even do it...

    John

  8. #8
    Join Date
    Apr 2003
    Posts
    307
    Dan- I will look into some other code as I would like to learn. Yes, string formatting, manipulation and file IO are things that would be important with the Hershey fonts. They are written in a arcane text code format and would need to be translated. Then to a gcode file.
    The reason I'm interested in those fonts is that they are a classic style in a single stroke font. Point to point format. And Free to use.

    John- I have seen the True Type Tracer utility.
    I know, I don't want to reinvent the wheel here. But I want to learn and that might mean trodding ground that has been gone over already.
    If you don't mind, I will look at your code that you have on the wiki.

    Chris

  9. #9
    Join Date
    Feb 2007
    Posts
    514
    Chris,

    That's what I put the code up there for. I found a lot of snippets and learned from them faster than from a book. So I posted what I learned on wiki...

    Enjoy
    John

Similar Threads

  1. simple python g-code generators
    By Dan Falck in forum OpenSource Software
    Replies: 0
    Last Post: 11-26-2007, 11:37 PM
  2. what is this thing for?
    By bigal in forum CNC Machine Related Electronics
    Replies: 35
    Last Post: 07-08-2005, 01:05 PM
  3. Replies: 0
    Last Post: 03-10-2005, 07:46 PM
  4. What is this thing? And what 'exactly' does it do?
    By DAB_Design in forum Benchtop Machines
    Replies: 7
    Last Post: 09-17-2004, 09:42 PM
  5. gcode to gcode converter
    By july_favre in forum Uncategorised CAM Discussion
    Replies: 4
    Last Post: 05-25-2004, 12:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •