- Home /
How to mill out an object
Hello all, I'm working on a project that involves milling an object based on a set of data. For example, I have a 3-axis (X,Y,Z) milling machine model in unity with a data set telling it to cut a spiral, and the program would replicate the axis data. The issue I am running into is how to exactly "Mill" out an object, or cut away at it at runtime, as if it were a real machine cutting on a piece of metal.
I've tried object manipulation options such as ray-marcher, and I have also tried doing a voxel cube, but on all the tutorials I have looked at, it is unclear how to hide the unseen faces so as not put a strain on resources, while still detecting collisions and deleting cubes as the mill comes by. Thanks!
It sounds like you'd like to let players sculpt objects with the milling machine in-game. There are probably things on the asset store to help with that, but you might be able to cheat a little if your output shapes are known ahead of time.
Who supplies the cutting data, you or the player?
Answer by trapazza · Sep 12, 2018 at 09:40 PM
Probably the best option would be voxels as you mentioned.
As for the strain on resources, you could organize the voxels into "depth layers" in such a way that the outermost voxels would belong to layer 0 while innermost voxels would belong to layer_count - 1.
This way you'd only test collisions from voxels in current_layer and display voxels in both current_layer and current_layer + 1.
Just an idea.
Your answer
Follow this Question
Related Questions
Voxel Mesh has Lines Between the Voxels 1 Answer
CombineMeshes() Not Working Properly? 0 Answers
Invisble Faces 1 Answer
Could anyone tell me what's wrong with my voxel rendering? 1 Answer