We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › G-code export library
Page Index Toggle Pages: 1
G-code export library (Read 2627 times)
G-code export library
Sep 8th, 2009, 2:41pm
 
Hey,

I'm working on a g-code export library that outputs code for a 2,5 or 3 axis CNC milling machine. It analyse any given 3d geometry (with ortho function) and exports a g-code file.

You need to specify up to 2 tool diameters - for roughiing and finishing phases, output file name and material thickness (if not specified the whole model will be exported as one file not as part files if needed)


Besides of exporting a default tool path I have implemented a genetic algorithm for path optimisation, which can be accessed separately with specifying number of generations to be optimised. (need some improvements).
More detailed description comming soon.

agata
Re: G-code export library
Reply #1 - Sep 9th, 2009, 5:32am
 
thats nice, when will it be done ?
Re: G-code export library
Reply #2 - Sep 9th, 2009, 10:02am
 
It is done more or less. But as I'm new to the forum i cant't post a link yet Wink
Re: G-code export library
Reply #3 - Sep 9th, 2009, 10:39am
 
Sample code:

import PGCode3D.*;
G_code_export gc;

void setup()
{
size(200, 200, P3D); // both P3D and OpenGL are supported
gc = new G_code_export (this,6,3,”cnc_code_nowe”,200);
//T01 – 6mm, T02 – 3mm, material thickness – 20 cm
background(255);
stroke(255);
fill(0);
}

void draw()
{
ortho(); // use ortho for the cprrect geometry to be exported
translate(width/2, height/2);

pushMatrix();
rotateY(PI/6);
rotateX(PI/6);
translate(width/2, height/2,-height/2);
box(30);
popMatrix();

gc.print_data(); //println the model data
if(keyPressed){
gc.change_settings(5,3000,150,3);
// 5-offset above material, 3000 – spindle speed, 150 – feed rate, 3 – layer thickness
gc.optimise_path(1000); //optimise throughout 1000 generation
gc.export(); //will println “generated” when the view analysis is completed and “file written” for the complete export
exit();
}
}
Re: G-code export library
Reply #4 - Sep 9th, 2009, 10:47am
 
Here is the link:
http://agataguzik.wordpress.com/2009/09/09/pgcode3d-library-for-processing/

Hope it can be useful.

agata
Page Index Toggle Pages: 1