PDA

View Full Version : blender to gcode :: mGcodeGenerator



yoyoek1
12-23-2009, 08:18 AM
hi. I am the author of mGcodeGeneratora
wiki.linuxcnc.org/cgi-bin/emcinfo.pl?GcodeGenerator
this is a cam-type program.

you have any comments or suggestions to the program?
write it !
that allowed me to create something more useful.

SBC Cycle
12-23-2009, 07:53 PM
I don't use Linux, EMC2 or Blender but your project makes me want to try it! Very cool, thanks for sharing.

yoyoek1
12-24-2009, 04:51 AM
I don't use Linux, EMC2 or Blender but your project makes me want to try it! Very cool, thanks for sharing.

I am sorry.
I did not write anywhere that it is a generator gcoda.
and from this file, you can move to any machine that reads gcody unnecessary emc.
what the Linux is it is not required. windows may be.
I do not have Windows and I do not know where the scripts directory of Blender:)

that is required is a blender:)

cyclestart
12-24-2009, 06:56 AM
The last time I looked at Blender, maybe 4 years ago (?), it was very difficult to learn. It's also very powerful software. More powerful software than needed for most mechanical parts ? Who do you see as the user for this gcode software ? People wanting to make cnc art pieces might be interested.

btw: I tried to download but the file was corrupt (empty). It's written in python ?

yoyoek1
12-24-2009, 07:40 AM
The last time I looked at Blender, maybe 4 years ago (?), it was very difficult to learn. It's also very powerful software. More powerful software than needed for most mechanical parts ? Who do you see as the user for this gcode software ? People wanting to make cnc art pieces might be interested.

btw: I tried to download but the file was corrupt (empty). It's written in python ?

host server is often down :( try later
this blender is not a simple application
but in contrast to the other is open
I have chosen a blender as a base that it has a lot of importers. dxf, svg, ai, ps, ....
having with him a little turns out to be pleasant
who has to use it. hyyy all? those who can not afford or do not want to buy expensive software
dxf, import into blender, and we have gcode:)
yes software, plugin is written in Python

cyclestart
12-24-2009, 08:21 AM
Open and python.
Excellent :)

Maybe after Christmas I'm back with a photo to show..
No promises ;)

mbf550
02-02-2010, 12:35 PM
hi yoyoek1,

I have downloaded your script and made some first experiences with. Primarly I was looking for a 3D generator and for this purpose does not work bad.

Great job!

Some comments
- In Windows, there are some type cast warnings, do not appear under linux. Code seems to run correctly.

- tool length check (not only diameter) could be useful. When going down to 0 level, spinle or tool shaft destroys milled structure

- parametric size and 0 position do not work on all machines (e.g. some viewers).

- gcode size is heavily enlarged by the line numbers and the feed rate in front of each code -> slows down my emc2

So I already modified sligthly your code for my purposes, but I did not really got in depth with the algorithm.

yoyoek1
02-03-2010, 03:51 AM
at last, user :)

me by you will send me the modified script and I will marge it with my newest version ?

about problems under windows. I don't use it and don't have it. sorry
tool length is good idea. I will have it on mind.

mbf550
02-07-2010, 02:55 PM
Hi yoyoek1

worked this weekend again on the bake3d part.

- Corrrected the issue with the missing (int) cast by making a "round" function.

- modified the layer generation. My linux emc2 machine is a bit slow and while parsing same z height, maximum speed cannot be achieved. Now only first point until last point on z_layer is in workpath, not additional points, where z is smaller, but set to z_layer

- already in last version: use Feed rate only, when changing, not before each command and different format (no parametric), but could remain as is for emc2

- added a few comments, what is happening.

Hope, you can find and merge the differencies. Sent to your mail adresses at wp.com and d3p.pl

mbf550
02-10-2010, 06:44 AM
Hi yoyoek1,

got a bit deeper into the code.

- have now realised a primitive tool length check which will now prevent a collision with the shaft or the mill head

- made some analysis, why somehwen the z_buff is not setup correctly. It always happens when in the grid is aligned with the edge of a triangle/quad. Could not find a workaround up to now. Maybe it is also linked with the fact, that makeZBufferFromObjects internally again sets up its mesh, but I am not shure about this.

Vverve
03-05-2010, 09:13 AM
Very interesting script , bravo! guy's . I am looking forward testing result of both scripts on the cnc at work ,I will probably have questions after testing. I do think Blender could become the best cad (...+cam!!!) in linux... I am surprise of seeing the poor interest of cnc users for what seems to me marvelous free solution!!!! may be they are too busy trying to hack,download,crack,learn window'$ big cad/cam programs....
Keep up the good work!!!
Keep us informed please!!!

lezdep
03-08-2010, 11:31 PM
Blender wasn't designed as 3D CAD and missing some basic tools. Like exact dimensions
for example. It really is 3D modeling tool, not CAD. Salome is more appropriate. But it lacks parametric modeling at current time.

mbf550
03-11-2010, 05:07 AM
worked again on the 3d z_buff.
Think I could improve behaviour.

Vverve
03-12-2010, 09:58 AM
lezdep , take a look there:
www.rab3d.com/tutorial_started.html


.. I did a few test on cnc at work with both script and the cnc/mach3 did what it should , no weird code where add .I`ve only tested 3D .

I do not write or even understand python script and the cnc world is pretty new to me... just to let you know that I wont be able to help your precious work untill i do my homework and study a bit more. Testing is all i could do ...for now! Maybe you got a link to someplace where I could start learning python and eventualy help! As I am a bit mixed up in my poor knowledge of cnc ,blender terms & function , I just dont want to take your time to teach those to the newbie I am!!! so I will be back when i will be shure
that I got precise terms for precise questions!!

Time is precious for everybody .
Keep it alive!!!

mbf550
03-12-2010, 12:35 PM
the trouble with z_buff is probably not visible on the first look.

And you will find it only in finer resolution. Compared in attached image is the original toolpath in black and the path of my modified script highlighted with improved behaviour.

Python itself you will find here.
http://www.python.org/doc/

The blender specific parts of the libraries and interfaces, you will find here.
http://www.blender.org/documentation/249PythonDoc/

And thanks for your link!

mbf550
03-26-2010, 08:33 AM
yoyoek1 has added multipass option for 2/2.5d operations

(version 0.1.74 http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?GcodeGenerator ).

Simple and nice feature!

yoyoek1
10-04-2010, 05:19 AM
new release :) 0.1.81
EMC Documentation Wiki: GcodeGenerator (http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?GcodeGenerator#download)

problems such as shown in the attached file solved:)
plus a little different changes

SweetJustice
11-09-2010, 10:55 PM
Yoyoek1, any plans to support Blender 2.5 in the near future?

jackm
11-15-2010, 07:54 PM
I tryed it in 2.5 all i had to do to get it to work was install python-tk this was on linux
edit sorry wrong info this machine has 2.49a not 2.5
Jack

kivig
06-03-2011, 11:30 AM
Yoyoek1, any plans to support Blender 2.5 in the near future?

That would be awesome!

jm82792
07-08-2011, 10:16 PM
I love Blender and have been using it for a few years. Keep at it!
I really dislike 2.49, I hope you get it to 2.5 soon :)

yoyoek1
07-29-2011, 07:45 AM
new release, new functions:
- pockets :)
- work manager :)

http://wiki.linuxcnc.org/uploads/menu_0.2.01.jpg

efret
08-04-2011, 03:56 PM
I stumbled on your project and it looks like a good and more importantly open solution to peoples CAM needs. So I wanted to test it out, but I'm getting tons of indentation errors. Is this due to my version of python?

edit: problem solved I just needed to install python 2.5.2 for some reason.. I think.

Thanks

precastguy
08-06-2011, 10:12 AM
yoyoek1
This blender set up looks awesome. Hope to get involved but have to learn python and blender. I think you are to something that has so much potential!!!

elseed
08-21-2011, 10:53 AM
Well, I tried mCodeGenerator in Blender 2.59.0 and I can't seem to find the script. Has anyone had luck with 2.5?

elseed

Helder
08-24-2011, 06:57 PM
Well, I tried mCodeGenerator in Blender 2.59.0 and I can't seem to find the script. Has anyone had luck with 2.5?

elseed

It only works in blender 2.49b with python 2.6 or 2.7. Blender 2.59 uses python 3.2.

go to Index of /release/Blender2.49b/ (http://download.blender.org/release/Blender2.49b/) chose the version for your OS. And Python Python 2.7 Release (http://www.python.org/download/releases/2.7/)

Menu is located in the scripts window under wizards.

Happy Blending

Helder
08-24-2011, 09:47 PM
hi. I am the author of mGcodeGeneratora
wiki.linuxcnc.org/cgi-bin/emcinfo.pl?GcodeGenerator
this is a cam-type program.

you have any comments or suggestions to the program?
write it !
that allowed me to create something more useful.


Hi yoyoek1

I'm trying to generate gcode from a mesh, but i only want to generate the horizontal edges for example. I developed the following work flow:

Create the desired mesh
Select the edges and edge loop
Separate edges from mesh (new object)
Bake gcode

But the code is not correct because it doesn't take into account the tool diameter. i attached an image to explain.A crude work around is to scale along x, y.

I was getting this error: RuntimeError: maximum recursion depth exceeded in cmp

So i add this to the code: import sys sys.setrecursionlimit(5000)

yoyoek1
09-20-2011, 08:35 AM
Hi yoyoek1

I'm trying to generate gcode from a mesh, but i only want to generate the horizontal edges for example. I developed the following work flow:

Create the desired mesh
Select the edges and edge loop
Separate edges from mesh (new object)
Bake gcode

But the code is not correct because it doesn't take into account the tool diameter. i attached an image to explain.A crude work around is to scale along x, y.

I was getting this error: RuntimeError: maximum recursion depth exceeded in cmp

So i add this to the code: import sys sys.setrecursionlimit(5000)

hi sorry for my lag in response.
you need to use "bake gcode" in 3d bake section.
tips:
- try to use triangles
- try to experiment with seb detect and sub pass

script is making that toolcompensation what you describe in images
look fb - ver 0.1.6 (serwer testowy) > tool size :) - detale (http://www.yoyo.ghost.pl/fb/?&tag=mGcodeGenerator&id=1115&subPage=detale)
you need only set up object correct and bake by correct button.
if you will have more problems send me a blend file I will try to help you some how.

Helder
09-22-2011, 07:43 AM
hi sorry for my lag in response.
you need to use "bake gcode" in 3d bake section.
tips:
- try to use triangles
- try to experiment with seb detect and sub pass

script is making that toolcompensation what you describe in images
look fb - ver 0.1.6 (serwer testowy) > tool size :) - detale (http://www.yoyo.ghost.pl/fb/?&tag=mGcodeGenerator&id=1115&subPage=detale)
you need only set up object correct and bake by correct button.
if you will have more problems send me a blend file I will try to help you some how.


Hi!. Congratulation on this amazing script! What i was trying to do is sort of a hack in 2d/2.5d bake edges option.I just need the x or y direction edges. The script was not made to be used through the work flow i described.Thats why i separated the edges.This option would be great. Or a merge between 2d/2.5d and 3d.Just an idea.I will send you a blend file with an example

Thanks

jm82792
02-11-2012, 03:06 PM
I'd absolutely love to see a version for 2.6
I know the API is different and documentation for it is obscure but the UI is so much better.
Have you considered starting a kickstarter project?
Many people are fond of using them for various CNC machines and such. If you have the spare time you could raise the funds to hopefully justify your time spent on porting to 2.5 with some extra features.

j3n4
02-18-2012, 09:20 AM
I hope new version for blender 2.5 too! ;)

winner
04-03-2012, 07:31 AM
+1 for a Blender 2.6 version. Is possible to make a 5axis version of the script? How hard will be? Already is a free 5 axis solution but unfortunately is only for Gmax (windows, proprietary software) http://www.cnc-toolkit.com/

j3n4
04-03-2012, 07:43 AM
For beginner:
If you export from blender in .stl and using heeeksCNC for generating the code, is a good point for start.
If someone need CAD/CAM CNC software, i have tryed HeeksCAD/CNC, for beginner is very good.
I have maked a Ubuntu release that contains EMC2, HeeksCAD/CNC, gCam, PyCam, Blender, Eagle, Meshlab.
All in one distribution ready to go, live CD, and installer ubuntu linux.
Is on my site: http://hitechfree.com/easycnc.iso

I hope can help.
Bye
j3n4