Thursday, 10 October 2019

Building Duplo Walls

My friend in China had a problem with his Duplo build, when building walls with Duplo my code would create models that were not particularly strong, the repeated patterns of bricks would cause "fault lines" to appear in the model.  Whilst there is some ability to deal with this in the code (using a brick discard function for repeated layers), it did not help to solve this particular "fault line" issue.   Consequently I added a function to randomly discard some of the bricks in each layer, to break up the repeating pattern.  Whilst this may not be ideal for the majority of model builds (as smaller bricks tend to decrease the strength of the overall model), in this particular instance it does increase the strength of Duplo walls.

Tuesday, 1 October 2019

Optimising Lego ldraw Duplo Models

What I also needed to do was to optimise the Duplo model to remove repeated 1x1 bricks (as I'd done previously with the Lego models) - the code looks for the definition of 1x1 bricks using the value assigned to the layer matrix; where this value is derived from the dictionary of brick parts - for the Lego conversion this value was 914 - for Duplo - which uses less brick shapes it was 909 - consequently it was relatively easy to fix, allowing for the removal of repeating 1x1 bricks.  Here's Yoshi in Duplo glory!  If anyone is interested with working with Duplo models let me know.

Sunday, 22 September 2019

Creating LDraw Duplo Models

I got an email from someone in China asking if I could make my 3D model to ldr file conversion work for Duplo bricks - he'd already had a go and included some .dat file for 1x1 and 1x2 Duplo bricks but I needed to tweak the code a bit to make it work - with Duplo, the models are less likely to be physically possible to build (at least with the bricks he initially wanted to use - 1x1,1x2,2x2,2x4) but the code tweaks were less complex than I expected.  A couple of examples of Duplo models built using my revised script below:

Thursday, 22 August 2019

Creating More Sculptures - Build Like An Egyptian!

Following a presentation on Lego sculpture I wanted to look at creating some Lego sculptures using some of the models that you can download for free from various online model libraries.  These included TurboSquid, SketchFab, Sketchup's 3D Warehouse and CGTrader.  I went with a bit of an Egyptian theme and downloaded the following models from the various websites

I converted them into Lego models using the process I've outlined here and using the instructions and code on GitHub.  I then rendered the animations in Studio 2.0 (which took a few hours) but I was fairly happy with the results.

Saturday, 3 August 2019

Creating Lego Sculptures - Those boots were made for building!

I wanted to see how flexible my scripts were for building Lego models from a 3D model that I downloaded from the internet.  Ideally I wanted to see if I could convert a 3D model that had been created from a 3D scan, so I selected a file on SketchFab and ran it through my 3D polygon > Coloured voxel > Ldr file pipeline that I've documented here and that's available on github

The final result was rendered in BrickLink's Studio

Wednesday, 24 July 2019

Unreal Lego

I've been looking at importing LDR files into Unreal Engine 4.  I haven't used Unreal Engine since version 3 so I was pleasantly surprised by how easy it is to import assets into Unreal Engine in the latest version.  In the past you had to use esoteric .psk files and the like - now you can simply import .fbx files.

The main problem I had was getting the colours in.  Blender does not seem to include the colours when it exports an .fbx file and I couldn't work out how to bake the colours in using Blender - in the end I had to resort to using Maya to export the FBX file.

Wednesday, 3 July 2019

Instructing A Dolphin

I recently offerred to build an set of instructions for a Lego Dolphin that a London AFOL friend had made - the model was faily straightforwards and I'd originally built the initial model in LDCAD.  Previously I've used LPub3D to create instructions but this time I thought I would use Studio 2.0.  Studio is improving all the time and the instruction tools looked pretty good so I thought I would give it a go.  

The Step Editor and page design tools are very intuitive, allowing for straightforwards drag and drop and I was able to create a 50 step instruction set fairly easily to build the dolphin model.  As a first attempt I was fairly pleased with the output, which was easy to export a PDF file.   The only caveat is if you are using flexible parts - whilst Studio is beginning to support flexible parts but not all them currently so for some flexible parts (like PF cables that I used in my Robot Car here) you might still have to use LPub3D.