Material removal

Adam B

Looking around for some CAD
Hello , I am watching Your YT channel and You mentioned about material removal.
I implemented some very simple application for cnc program generation but this is specific process and i will need to implement calculation of removed material. And finally the best to display the stock.

I use c# and everything i wrote myself, - simple geometry operations, planes, lines intersections, mesh import and display with OpenGL. Currently i dont use OCC.

I started to implement oct-tree algorithm to calculate volume an display intersection of two objects and i am afraid it will be too slow.

I am wondering how OCC is calculating volume of complex bodies ? Does it use oct-tree algorithm ?

And how could be implemented material removal algorithm ? In my case the tool is simple cylinder moving from point A to point B in material, without rotation (only 3 axis movement). I had an idea how to do this but calculations with my "oct-tree" are so terrrible slow so i started thinking to drop everything and start again with maybe OCC or maybe use python interface to OCC in my c# application.
 

Quaoar

Administrator
Staff member
Hey @Adam B and welcome to the forum.

Material removal is a tough topic and, to confess, I've never implemented it myself. I heard about some successful implementations of it, and it was never based on B-rep geometry. I mean, precise Boolean subtraction is way too slow, and that is why OpenCascade core functions are not suitable to solve material removal in a viable way. Therefore, if you feel like developing things from scratch, you're good to go and I wish you success. Just a reference that might be helpful if you wanna implement the thing: [Sullivan, A., Erdim, H., Perry, R.N., and Frisken, S.F. 2012. High accuracy NC milling simulation using composite adaptively sampled distance fields. CAD Computer Aided Design 44, 6, 522-536.]

The idea of this paper is to use ADF (adaptively sampled distance fields) to represent the geometry and perform super-fast and super-robust Booleans on implicit functions. Then, at each frame, you polygonize the resulting function (stock minus the volume swept by a tool) with one of the conventional methods, such as marching cubes or dual contouring. Since the natural carrier for ADF is an octree, you're definitely looking in the right direction.

If you decide to follow this path, we shall be happy to learn from your experience and see how far can you get. I have a small implementation of octree here (see poly_SVO) but I left this prototype largely incomplete and mention it only if you have enough time and goodwill to mess around with someone else's spooky code.

I am wondering how OCC is calculating volume of complex bodies ? Does it use oct-tree algorithm ?
It's numerical integration which is supposed to be precise. Think of some Gaussian quadrature inside.

I had an idea how to do this but calculations with my "oct-tree" are so terrrible slow so i started thinking to drop everything and start again with maybe OCC or maybe use python interface to OCC in my c# application.
I would recommend you to do a small research and read some papers, especially, in the Computer-Aided Design journal. The paper I mentioned above is good to start off, but I'm sure it has some useful references and it should be referenced by other papers in its turn. Still, octree feels like the right choice.
 
Top