GCode path compiler

My Dad is a machinist. He wants me to write a program for the computer that will load the GCode for his CNC mill and graphically compute and model in 3D the path of the bit. I have two options, I can use OpenGL or Blender. I would prefer Blender, but I don’t even know where to start. I think I should use Beizer curves, should I? If so, than how do I make a beizer curve? I already tried and I could only figure out how to make a nurbs curve. Thanks in advance for replies.

See this thread regarding stereolithography

https://blenderartists.org/forum/viewtopic.php?p=274261&highlight=cnc#274261

It might meet your needs,

LetterRip

This page has links to a dxf to g-code converter that is open source

http://www.sherline.com/CNClinks.htm

and to an stl to g-code converter.

So, from there you should probably be able to code what you need,

LetterRip

No no! Thanks for the links but I don’t think you quite understand. I want to load the gcode from a txt file and DRAW it in Blender.

Oh btw, by draw you might think I mean the text itself. I mean I want to DRAW the path the bit on the MILL will follow.

That would be an interesting project. I’ve only messed around with the game engine so far, but it seems like you could use extrusions, rotations and transforms to follow the gcode. You would be making a 3d object that would represent the bit cut. I’m just brainstorming here since I haven’t checked out the modeling side at all, but a cylinder with one half selected and transformed would represent a bit path.

Hey!!! You just gave me a great idea!!! Can I just set a block of metal (a rectangular mesh) and use a python script to run a cylindar around doing boolen operations? I know the polygon count would be extremely high when you where done, but that would rock if I could do it this way!

Can I run another script (the boolean script) to do the booleans? Can I use blenders internal one if not?

I just looked at the reference.

http://www.blender.org/modules/documentation/233PythonDoc/Blender-module.html

I’d say you have your work cut out for you.

Yes you can run the boolean script with yours - just use standard methods - ie

import BooleanScript
from BooleanScript import functionIwanttouse

etc.

LetterRip

How do I use Blender internal difference boolean function? I tried mega bool, and it does some things that are interesting to say the least. Blender booleans are allot better. One more thing, when I do a boolean operation I have to select the meshes in the right order, and it leaves the old mesh after it is done. Can I get around these?

The_Nerd, while Blender could do what you want after a fair amount of work, there are other programs out there that do exactly what you want.

A buddy of mine is a beginning CNC machinist, and I’m just starting to scratch the surface (so to speak) with CNC. I found a program called “CNC Simulator” which reads gcode and simulates the various cutters. It works well, and is very fast. And it’s free to boot. Edit: the link is http://www.cncsimulator.com/

Sorry to dredge up an old post, but I was searching for boolean-related stuff and stumbled across this thread.