Working on Pencil Code

April 1, 2008 · Filed Under MeshCAM Development 

A few pencil toolpath problems have been pointed out in the last few days.  Pencil paths are difficult to make completely generic where they work well on any surface.  I’ve seen some very high end programs that generate strange paths on difficult surfaces.  It turns out that the standard MeshCAM model, called the "Cheese Whiz" model by some, is one of those tough cases.  Although it was something I made 4 years ago in about 3 minutes it’s turned out to be a model that exposes a number of problems with toolpath algorithms. 

 

steep 

Very steep areas can be difficult to find with the algorithm I use.  I would be simple to fix this but the time it would add to calculation would be significant.  I may have to add this at some point.

 

3 paths

Areas where multiple pencil lines come together are difficult to link properly.  There are different methods to deal with this but it’s not easy to make it right all the time.

 

same slope

This one takes a bit of imagination.  When you offset the surface with a ballmill the surfaces of the ball and the rope almost merge together.  This almost eliminates the type of feature that a pencil path is supposed to machine.

 

wavy

At first glance the path above looks wrong because it isn’t smooth but it is part of the model.  The ball and the rope are very roughly tessellated in the CAD program so the intersection is not necessarily as smooth as you would expect.  Because it’s a 3D path you really need to spin it around to full get it- 2D make it look very wrong.

 

A tighter tolerance would eliminate some of the trouble above but I’m now trying to discourage that so I have to make it work with less input data.

 

I point out all of the above because some of you have to be thinking, "How many times is he going to redo the pencil code?"  I’ve talked to a few other CAM developers and the general agreement is that CAM development is very much an iterative process.  You write code that works when you test it and wait for people to break it. Now you know a few ways to break it. 

 

The good news is that I’m getting better results with the new code.  Let’s hope everyone else does too.

Comments

4 Responses to “Working on Pencil Code”

  1. Adam Talbot on April 1st, 2008 9:42 pm

    Glad to see you are working on updating the pencil code. Sorry about being a pain, the last few bugs I have reported on, waterline, pencil code… Seemed to cause a few fires :-) Just want to say thank you for the great work you are doing Robert.

    feature request: Little one, I promise!
    Looking for a small mod to Pencil Cleanup. I guess I would call it Shadow Cleanup. Think of it as putting a light above the object and penciling the shadow cast by the object. Just a simple one pass that cut the last N of an inch that waterline missed. So in the case of the Cheese Whiz, it would just cut out around the outside, at the bottom of the stock. Same as Pencil Cleanup, just a whole lot dumber. Just an idea for, what I hope is a very easy peace of code.
    -Adam

  2. Robert on April 2nd, 2008 7:10 am

    More like a cutout pass right? I’ve got this in mind and it would be moderately straightforward to implement. The only thing is that I’m waiting for the code to stabilize for a while. Whenever I have to change my internal API for the toolpath code I have to change the code for all the toolpaths. Normally these changes are rare but they have been a common thing lately as I update the system a lot. I’m pretty sure this will be implemented in the mid-year timeframe.

    Thanks for the feedback. Like I said above- I need people to try and break it if I’m going to fix it.

    -Robert

  3. Randy on April 2nd, 2008 8:39 am

    Robert, your Cheese Whiz model is great test–undercuts and all. It’s actually pretty similar to many of my workpieces (especially the current locomotive wheel.)

    I cannot even imagine the code it takes to do the penciling, even conceptually. I am imagining that a pencil path point exists when two (or more) surface patches are tangent to the cutter at the same time.

    But seeming from recent events, rather than me breaking MC it’s much more efficient for me to get to you break it responding to my requests. :D
    Randy

  4. Jeff Demand on April 2nd, 2008 1:06 pm

    Robert,

    Reassuring words about deliberately breaking MC. Despite my history I usually do not try to break it, just bend it to my expectations. But some times I have a really bad day and broken software makes far less of a mess than dishes, furniture, and etc.

    So as not to fall too far behind Randy in the request department, how about a continuous 4 axis mode? Doesn’t even need pencil or waterline. My present work around technique is rapidly pushing me over the breaking edge again :-)
    Jeff