I am developing a little software to simulate the motion of a 5-axis milling machine. This machine is made of three axes of translation and two axes of rotation (B and C, the part is loaded on C axis).
So far I would like now to simulate progressive stock removal (by iterating over a tool-path, re-discretized). The purpose is to simulate cutting of a stock by the milling tool to produce the final part.
I would like to use the OpenCascade's Voxel library for this. At first glance I can see the basical steps to follow :
1. Convert the TopoDS_Shape of the milling tool to a Voxel_BoolDS (name it toolVoxels)
2. Convert the TopoDS_Shape of the stock to a Voxel_BoolDS (name it stockVoxels)
3. For every machine position Mi in the tool-path to simulate, do :
3.1 Rotate stockVoxels by Mi.cAxisValue
3.2 Move toolVoxels to Mi (Mi's X Y Z B values)
3.3 Compute the stock removal step with a Voxel_BooleanOperation between stockVoxels and toolVoxels and store the resulting voxels in stockVoxels
3.5 Display the updated stockVoxels and toolVoxels
3.6 Wait for a delta time
Steps 1. and 2. are easy. For steps 3.1 and 3.2 I don't know if it's even possible by reading the docs. As things are made, I think it will be necessary to reconvert the moved tool and stock shapes to Voxel_BoolDS objects. The main problem with this is that the stock shape is changing during the simulation and I don't know it at each step so I can't create the new i-th stockVoxels.
Can anyone help ? Maybe voxels structures is not suited for this problem as I need to rotate/move them. Any hints for other methods ?