Pocketing Update

April 25, 2007 · Filed Under MeshCAM Development · Comments Off 

CRW_4869-2

I’m just finishing up another week in Hong Kong and China so MeshCAM development has been a bit slow.  The pocketing code is still underway but I needed to come up with a better way to input the outlines to test.  DXF files are an obvious choice since I can generate them with any CAD program.  I had written a 2D DXF reader in Python some time ago but since MeshCAM now includes Lua for scripting I thought it would be good to port it to Lua and continue testing with that.  This has several benefits:

  1. Learn more Lua. 
  2. Write infrastructure code to call specific Lua functions from C++.  Currently, MeshCAM executes an Lua script in its entirety with the interpreter being setup and destroyed for each file that is executed.  This new code can be used to add a lot of expandability to MeshCAM-for instance, I now think that all new input file types will be implemented in Lua.
  3. Have a working DXF reader to read 2D files.  If I decide to let users load outlines and profiles to be cut I can use this code. 

The code is about half-ported and I’m liking Lua more and more as I use it.

Fixed Islands

April 13, 2007 · Filed Under MeshCAM Development · 7 Comments 

Fixedislands

 

The fix for the bad islands below turned out to be pretty straightforward after staring at the code for a few hours.  I have two large outstanding items to do now.  First, take an unordered set of outline and island curves and order them into something that can be calculated.  An example is below:

Concentricpockets

 

If you take each of the concentric rings and extract the edge curves then you’ll get a set of alternating outline and island curves.  One of the few citical things for the boolean approach that I’ve taken is that if the curves are not ordered properly then the outermost island will destroy the inner pockets and leave them uncut.  The code to organize this should be relatively straightforward and should not require any new code– just the existing polygon boolean code.

For what it’s worth, the approach in the winding number paper I linked to before doesn’t have this requirement. 

The last item is the path linking.  This will probably be a little more complicated but I’m sure I can find a doc in my collection outlining a couple of approaches that can be implemented with little effort.

 

More Pocketing

April 12, 2007 · Filed Under MeshCAM Development · 7 Comments 

Pocketwisland

I got the island code working pretty well.  It took a while since I went back to clean up some of the hacked-together test code that I wrote earlier.  Islands only took a couple dozen lines of code but they aren’t totally worked out yet.

Badpocket

The shot above shows one of the outstanding problems where a pocket, in purple, and an island, in red, nearly coincide.  This case causes some problems currently but I don’t expect much trouble resolving it.