Sunday 29 December 2019

No Studs Here! (In Search Of Studless Models - Part 5)

Personally, I think the appeal of studless models is that, generally, they just look nicer, and more "polished", so they appear as if they have been finished with a "human touch".  Hence giving a computer the ability to create studless models might begin to blur the boundaries between computer generated models and human created models. 



As the brick matrix was now being randomly created (as opposed to selecting an LDraw part and calculating the brick matrix) it was now much easier to swap out bricks for similar bricks - so swapping a 1x1 standard brick for a 1x1 cylinder brick or  a 1x2 standard brick for a 1x2 grill brick or 1x2 with embossed bricks became much simpler.  Sloping roof tiles were set to only be added at the top of the models (because of the issues with the height of sloping roof tiles noted previously) 

Having managed to track (most of) the available studs in a build I could begin to apply colours to the model to make it more visually pleasing.  I also wanted to include some transparency as that can make the renders look more interesting, especially with the photoreal renderers that are becoming increasingly available.  Distributing the colours over the height of the the design meant adjusting for the max height of the model.  For shorter models (under 5 units high) I coded to add more blue, which helps to break up the green floor of the other models


Thursday 26 December 2019

What! A Stud? (In Search Of Studless Models - Part 4)

Isolating the available studs in a model requires that you analyse the whole column of bricks above any given stud - by analysing each layer in the column of your build matrix it's possible to isolate where the studs should be available - however my current code is not flawless - in the model below there are a couple of studs that are not identified (one above the base layer and one above the 1x2 wall texture brick).

Monday 2 December 2019

Imaginary Bricks! (In Search Of Studless Models - Part 3)

I'd returned to just using 1x1 tiles to try to isolate stud availability.  I had been using my brickalo code to generate the models that I would then try to add tiles to, however my brickalo code was an unmanagable mess (of my own making) so I decided to rewrite my code to better support the isolation of studs within a model.

Initially my new code focused purely on the placement of tiles on "imaginary" studs of imaginary bricks!  I coded a mechanism of creating a numpy matrix that could represent the bricks and plates added to a model (without actually bothering to add the brick to the LDraw model).  However it quickly became apparent that having made a functional matrix that could track imaginary bricks and plates - I may as well use it to add real bricks to the LDraw model.  It's worth noting that this approach was very different to the code I'd used for brickalo.  

With brickalo, the code selected a random LDraw part (from a list of parts) and then drilled down into the part to work out what the dimensions (1x2,2x2,2x4 plate or brick etc) of the LDraw part were which then allows the code to calculated the part matrix which is then added to the larger build matrix.  With my new code, that I was using for tile placement, the part matrix is randomly generated, and the corresponding part selected according to the dimensions and size of the randomly generated part matrix.   As it turns out, this new approach would allow for the selection of  many more variations of similar parts.