Sunday 3 March 2019

ColouredVoxel2LDR Code on GitHub - Coloured Voxels Part 6

So I've posted my code and instructions to allow you to create LDraw .ldr files from textured 3D models on GitHub

https://github.com/pennyforge/ColouredVoxels2LDR

This includes a fix to remove (by merging into larger bricks) the spurious 1x1 bricks that could appear on the models (check out Yoshi's nose in the previous post for an example of this problem).

Hope you enjoy it - Let me know how you get on!



Friday 1 March 2019

Video Game Giants - Coloured Voxels Part 5

Although the conversion of Yoshi to a Lego Model works really well, what I'd realised previously is that there is a problem with the way my code scans the voxel slice as there is a tendency for the code to create lines of 1x1 bricks, when they could clearly be converted into a larger brick shape.  The problem is caused by the fact that my code scans the voxel slice horizontally then vertically on each consecutive layer (as this adds strength to the resulting model), however with coloured voxels it's possible for lines of coloured voxels on the edge of the model - the skin if you like - to be interpreted as a single 1x1 brick on one slice and as a larger brick on a subsequent slice - you can see this quite clearly on Yoshi's nose in the image below.


I wanted to try to remove this 1x1 brick anomaly from the models as it is likely to effect the strength of the model (you can see a column of 1x1 bricks on the left of Yoshi's nose) and it looks unnatural in the build, no one would really use a row of 1x1 bricks when larger bricks are available.  Consequently I was going to need to do a second pass on each voxel layer to try to remove these lines of 1x1 bricks.