RSS

Archive for the ‘CAM/CNC’ Category

CAD/CAM Application - proof of concept

Thursday, January 28th, 2010

A proof of concept demo of a Computer Aided Machining package I did in the summer of 09.  Written in C++ using good ‘ol MFC for the UI.  The objective was to load and display STL files, define cutter geometry and calculate collisions and contacts between them to generate 3d cutter movements over the STL triangles.

That worked!

Next step was to provide simulation of the cutter actually removing material.  I’ve been intruiged by this algorithm since I first saw it in action over 10 years ago and after looking for ways to achieve it on the Z-buffer I finally settled on my own solution (which, actually, must be the way to do it)…

That worked too (see inset in the image above).

The solution involves 2 set-up steps:

1) raytracing through the material, to generate solid depth information (depth at which it enters, depth at which it exits)  The color information is taken from the point it enters.

2) raytracing through the cutter as above, but taking the color information from the point at which it exits.

Because these scene is rendered without perspective, it’s possible to transform the cutter rays through space and subtract them from the model rays, which makes the actual “material removal” code really quite pacey as there’s no realtime ray tracing invovled.

Next step was to wrap it in a front-end with dialog forms for managing and defining stock material, boundaries, cutters, cutter paths and outputting CNC programs.

MFC has been around so long it’s hard to ignore it, but ultimately I’d consider using a cross platform solution because the rest of the code is.

Where next?

When I have some time to commit to it, I’ll try and push it onwards with the ability to create different types of cutter paths, picking out features such as sharp corners and drilled holes etc.  But it may just stay as yet another experiment…