This is the code and the building instructions for a Lego CNC Milling Machine that I constructed in 2016. It cuts out a 3D Model from a oasis foam. The 3D-resolution of the cut-out-3D-model is comparabile with a 5mm-Voxel represenation of the model.
https://www.youtube.com/watch?v=qYAj9Uz0zNU
https://www.youtube.com/watch?v=myIkMpsWyjk
First you need to build the machine. You can find the instructions as a Lego Digital Designer File in the /lego digital designer directory or you can simply follow the uploaded PDF A list of parts and bricks you need is at the end of the pdf.
In the next step you can convert your 3D Model into a file of numbers. The program is written in the Blender Game Engine and the last Blender Version that supported the Blender Game Engine was Version 2.79b. The blender file is /Datenberechner.blend You can exchange the green 3D Model with your Model. Make sure to name your model "Gube". For the program to work you need to make a Save.txt file and configure the path to the file on line 25 and 35. After that you can click into the 3D Viewport and hit P to start the game engine. The game engine will then convert your model to Data. This process might take up to half of an hour.
The programm is written in Small Basic with the EV3 Basic Extension. An installation and tutorial guide you can find here in this YouTube series: https://www.youtube.com/watch?v=myFKfOA4XbQ The Small Basic Code file you can find under /EV3-program/EV3-program.sb Here you also have to replace the path with your directory to the Save.txt
After the Save.txt is finished, you can then connect your EV3 Brick to your PC and run the Small Basic script. The cutting process should then take about 3 hours.