## Using images for scaling and geometry patterns in SketchUp

This post was actually inspired by a question in my Basecamp presentation: Could we use images to create or modify geometry in SketchUp? As it turns out, this is actually quite easy since SketchUp version 2018. This year's version of SketchUp includes a new class in Ruby, the ImageRep. Contrary to the regular Image class (which you can use to work with images as entities in SketchUp), the ImageRep class goes further and allows you to look at images on a pixel by pixel basis. This is basically what we need to be able to read pixel color values and then use those to create or modify geometry. As you can see in the code snippet below, this is reasonably straightforward once one figures out the basic geometric behavior. The code even stretches the image by the (x and y) dimensions of the selected geometry. One part that needed to be resolved was that color information in an image contains red, green, and...

## Beautiful Functions in SketchUp

Scripting geometry (as described in Chapter 7) can make things look very interesting (and quite beautiful) with a rather small amount of actual code. You can see this in the patterned panel example or in the pulled brick post. Both of those examples use a combination of sine and cosine functions to create a "wavy" pattern that nicely undulates shapes and geometry. There are other functions, however, some of which you likely remember from algebra and trigonometry classes. But even without delving too deeply into this, I thought it would be useful to have a reference for some interesting functions that may be of use. The interactive examples shown below use the following grid of 1 inch cubes in SketchUp that were simply scaled vertically according to the lines of code that are included at the bottom of this post. Obviously you can use this approach for other purposes and in other ways, too, but this is a good way to...

## Pulled Brick Design Options

I came across brick wall designs today where the architects were considering various options with pulled bricks. This design approach has been used before in many different ways but the basic principle is always the same: In a brick wall that is dominated by stretchers, you insert strategically placed headers which then protrude a little bit beyond the brick wall surface. This creates a very nice pattern with interesting shadows. The first image below shows such a design in a SketchUp model: Given that in reality these are placed manually it may be reasonably easy (and therefore not too costly) to vary the extend of their extension beyond the surface and thereby create more interesting undulating patterns. One such pattern is shown below: As it turns out, this is very easy to do by simply modifying some of the scripts from Chapter 7 and combining coding with a carefully created SketchUp model. The secret for success is having a component type (the...