Featured Lego of the Day: 590 Engine Company No. 9

An old LEGO city set of mine, 590 is built and rendered in POV-Ray from the original instructions.

When I saw that the featured set of the day on Brickset was Engine Company No. 9, I was excited. LEGO set 590 is one of two large city sets I owned as a child, the other being the 588 Police Headquarters. Even better, I had built the set in POV-Ray some years back. Realizing I’d never published it, I decided it was time to right that wrong.

A blast from the past.
Engine Company No. 9 is a fun little set. I was never much of a fireman as a kid. My normal stable of play was police, spy and military—my growing up an Army brat could be to blame. As such, I only own a couple fireman sets. Contrast that to the half dozen police sets. There aren’t any spy or military sets, so those were personal creations.

Even so, Lego set 590 is still great, and I enjoyed building it as a kid. Plus, the parts were great additions. Those red bricks were part of more than a few space ships I created. Robots, computers and the like were often filled with red bricks. That baseplate also came in handy in many of my town creations. If only we had the internet back then, I’d have quite a few creations to share.

[Image]590 Engine Company No. 9 by Steven Reid, on Flickr

As you may have noticed in my last blog post, I updated the render of this set. Besides rendering in a larger size, I was dabbling with POV-Ray’s radiosity. Radiosity allowed me to create images with more accurate colors and shadows. There is a drawback, though, as the images take forever to render. This one took over a day and still had artifacts. After adjusting the exposure, I was able to reduce the artifacts to create a pleasing final image.

Fun with stickers.
Modeled back in 2009, I still remember Engine Company as a fun build. I had most of the pieces already modeled. Most of the work I did went into the stickers. I got pretty good at adding them in POV-Ray back then. Usually I use thin boxes with an image, such as the flag, that I insert into this set. In this case, though, not all are that simple.

Although the flag is an image map, for many of the stickers I change the colors to match my LEGO materials. To do that, the image is a GIF—a PNG could be used too—that I built with a limited color index. Within POV-Ray I set each of the colors in the index to the LEGO texture I need. For example, below is the POV-Ray code I used for the flames:

// stickers
#declare st_flames_e = box {
  texture {
  material_map {
  gif "pics/fire.gif"
  texture {l_black} // 0
  texture {l_white} // 1
  texture {l_yellow} // 2
  texture {l_orange} // 3
  texture {l_red} // 4-15
  rotate <90,0,90>
  scale <G,W,W>
  translate <-1.5*W,-WR,0>
#declare st_flames_s = object {st_flames_e rotate 90*z}
#declare st_flames_w = object {st_flames_e rotate 180*z}
#declare st_flames_n = object {st_flames_e rotate -90*z}

As you can see, I actually created four stickers. The first one defines the sticker and its texture in the default position. The last three declarations rotate the image for each of the other orientations I need. The cool part of declaring stickers this way is that if I update my textures, I don’t have to update my images.

When a sticker isn’t an image.
Now, for the rest of the stickers I didn’t use images at all.
Instead, I created each using SDL—POV-Ray’s scripting language. For the title and numbers, they are simple boxes with text printed on them. The numbers are actually two boxes, due to the outline needed. It is an easy process, and it ensures that the stickers look good at any resolution. That is the downside to using images, although POV-Ray does a good job of smoothing out the artifacts.

Although it may look like one, the clock isn’t an image either. One of the more complex stickers I’ve created, I’m surprised I didn’t use an image. Sometimes I need a challenge, and the clock was a fun puzzle to solve. Using cylinders, loops and text materials, POV-Ray builds the clock in realtime. This isn’t much of a problem on the faster computers of today, but was noticeable back in the late 90s. The results looked good and show off the power of SDL. Hard to believe what you can do with some basic math. Below is the full code for the clock.

#declare sticker_clock = union {
  cylinder {0,-.001*y,W material{lc_white]
  difference {
  cylinder {0,-.0011*y,W}
  cylinder {1*y,-1*y,W-.12}
  cylinder {0,-.0011*y,.05}
  box {<-.03,0,W-.25>, <.03,-.0011,-.07> rotate -360/60*7*y}
  box {<-.03,0,W-.45>, <.03,-.0011,-.07> rotate -360/12*10.116*y}
  box {<-.01,0,W-.25>, <.01,-.0011,-.07> rotate -360/60*33*y}
  #local hour = 1;
  #while (hour < 13)
  box {<-.02,0,W-.12>, <.02,-.0011,W-.2> rotate -360/12*hour*y}
  text {
  ttf "ariblk.ttf" str(hour,0,0) .001, 0
  rotate 180*z rotate -90*x
  #if (hour > 9)
  translate <.6,0,-.3>
  translate <.3,0,-.3>
  rotate 360/12*hour*y
  scale .15
  translate <0,-.0011,W-.3>
  rotate -360/12*hour*y
  #local hour = hour + 1;
  #local hour = 0;
  #while (hour < 60)
  box {<-.01,0,W-.12>, <.01,-.0011,W-.17> rotate 360/60*hour*y}
  #local hour = hour + 1;
  translate <WR,-WR,0>

Pretty neat, huh. Broken down a bit, the first few cylinders build black outline and white clock face. The cylinder and three boxes print the clock hands. The next while loop builds each hour and corresponding tick mark. The last while prints all the second tick marks. Put it all together and you get a nice looking clock.

Looking back to look forward.
Although I had a lot of fun building these models, they were a bit of pain at times. As the parts grew more complex, it took me longer to model them. In some cases, I ended up using other libraries to fill in the gaps. Visualizing each brick’s location, I would position them by counting studs. At times it was tedious work, but the results were worth it. But, the render times were becoming a problem.

For that reason, I shifted from POV-Ray to Blender. If you’ve following my blog, you’ll find I used Mecabricks to build my sets. I had started to use LDD and LEOCAD to get away from hand placing parts. But the resulting code wasn’t very readable. I often had to tweak the code to get better results. Plus, the workflow was cumbersome.

When I ran across Mecabricks, I was looking for a better way to export my LDD models. But, to my surprise, it was actually more fun to build within the interface. As an added benefit, the Blender results were super fast and photorealistic. As you can tell, I was hooked.

Yet, I still missed what I created in POV-Ray. Mecabricks still lacks a lot of the older parts I need for my models. As frustrating as they could be, I enjoyed creating parts using SDL. My Blender skills are weak, and even a few basic parts I’ve created took too long. This means a lot of models are incomplete. That’s okay, it’s still fun to build and design something new.

Which brings us back to today. As much time as I spend on Mecabricks, it is fun to share these old models too. These images are part of my history—a little bit of me. They may not be perfect, but they were fun to build. It’s fun sharing them again. There is more to come!

Comments on this article:

No comments so far.

Write a comment:

Type The Letters You See.
[captcha image][captcha image][captcha image][captcha image][captcha image][captcha image]
not case sensitive