Finally, I choose the following pragmatic solution. Driving OpenSCAD from MATLAB.
Below are the steps:
- Open OpenSCAD.
- In OpenSCAD, open the file 'myfile.scad'.
- From MATLAB, write the OpenSCAD commands in the file 'myfile.scad' to load two STL files of the objects, position them correctly, and apply the boolean operation.
- OpenSCAD will automatically detect the file has changed and update its view.
- From MATLAB, capture a screenshot.
- Repeat steps 2 to 5 until you have enough pictures to create a short movie.
- Use a MATLAB function to compile the pictures into a small movie.