Voxelization update

Last time I showed you how I managed to voxelize an obj file and display it on our simulator. However, I had a few issues with the cube, because it wouldn’t detect the vertical faces. This week after battling with geometry for longer than I’d like to admit, I finally managed to add horizontal rays that are orthogonal to each voxel located on the side of the cylindrical grid. As expected, we can now see the coloured vertical faces of the cube:

However, more unexpectedly, even the other models looked better on the simulator, for example the Charmander I used in my previous post:

Without horizontal rays
With horizontal rays

It is quite visible on thin forms, if you look at the tail for example it has much more volume and it more visible on the second version.

The voxelizer is not done yet, because I have to input an obj file which dimensions are smaller those of our grid and with centered coordinates. For now I do those modifications manually on Blender, but I would like to add a feature that automatically process the obj file, regardless of its original dimensions and coordinates. It is basically a simple homothety, it shouldn’t be that difficult.

Moreover, I’m still thinking about how to manage the colors inside the volume, because the obj file only specify the colors of the face since the volume is not supposed to be transparent. I could for example colorize the voxel with the color of the face it is the closest to, which is what I’m doing at the moment, but only taking into account the faces that are directly above or below, hence the blue color inside the cube. I could also try to make a smooth color transition on the voxels located between two faces with different colors. I will try to do some tests to determine which way looks better on the simulation.

Finally, for now the voxelizer only work for images, but it should work for animations too. At first I wondered what type of file would I have to take in input, since the OBJ file format does not support animation, but I then learned that Blender could export an animation in one obj+mtl file for each frame, which is ideal because then I would just have to run the algorithm for each obj file.

Text printing:

Another feature we wanted to add was the possibility of displaying a chosen string on the outer cylinder of LitSpin with only a text input. I wrote a quick python script that took in input a string and outputs the png file with the string written in a 8*8 pixel font. However the font is too small to look good, so probably we will have to make our own font adapted to our display system if we want to implement this feature.

Leave a Reply

Your email address will not be published. Required fields are marked *