Getting dropcutter to work

For my CAM project I was using a 3D offset of the parts to compensate for the tool diameter. But i have recently have incorporated a new feature so 3D assemblies of blocks can be represented in 3D. For the automatic assembly (courtesy of Carlos Sánchez) I cannot use the offset surfaces but I have to use the original meshes.

One way of machining a 3D mesh is dropcutter algorithm, that in a nutshell works by modeling the milling bit and setting the z-depth at each XY location so the model is barely touched by the tool. As meshes are made of triangles, each feature of them is tested for contact: edges, facets and vertices. The feature with the highest z-depth value will set it for that particular location.


I have found a lot of insight and useful information in Anders Wallin blog. Though my initial approach was to adapt his monocam's C# code to Java, I ended up with a buggy result. Anders released later a C++ library, opencamlib, that is most likely a much improved version, but I did not test that. Instead I built from scratch my own Java version that now seems to begin to behave properly.  It was not too hard as I am only implementing the ball-nose cutter (that is why you see the yellow spheres above representing the tip of the cutting bit).

You can can have a better view of the above here:



And in case you are wondering what the hell this part is, you can see where it will fit in:


Comments

Popular posts from this blog

VFD control with Arduino using RS485 link

How to get sinusoidal s-curve for a stepper motor

Importing OpenSCAD designs into Onshape