SketchUp: Quick and dirty poché for sectional views

While putting together a demo SketchUp file to use in our booth at the AIA National Convention last month, I worked out a nifty little technique that I think is worth sharing. Here’s hoping you think it’s nifty, too.

The problem I was trying to solve was this: SketchUp’s Section Plane Tool cuts away parts of a model to show sectional views, but it doesn’t “fill in” the spaces between wall surfaces, floor slabs and other areas that are intended to be solid in a design. Often, architects will blacken or hatch these interstitial areas to help their drawings read better. This filling-in is called poché, and SketchUp simply doesn’t offer an automatic way to do it.

By default, SketchUp thickens section cut lines, but the spaces between the faces aren’t filled in (above).

Sometimes, it’s useful to show section cuts with solid shading.

I wanted the SketchUp file I was preparing to look “pochéd” no matter where it was sliced. Furthermore, I wanted that poché to carry over when the model was inserted into LayOut.
 


 
I started by using the Section Plane Tool to cut a section through the model (as seen below). I oriented my view to be perpendicular to the section cut by right-clicking the section plane object and choosing Align View. Since I wanted this to be a true, scalable orthographic view, I turned off perspective (Camera > Parallel Projection). Finally, I created a new scene; doing so made navigation easier, and was necessary for creating a viewport in LayOut later on.

An overall view of the model

After adding a Section Plane, I right-clicked and chose Align View.

This is the right view of the model (above), but true orthographic projections don’t include perspective.

Choosing Camera > Parallel Projection from the menu bar turned off the perspective.

Now for some work with Styles: As this would be a black and white, sectional view, I chose to apply the HiddenLine style from the “Default Styles” collection that ships with every copy of SketchUp. This style uses thickened edges to indicate cut-through faces, but (as I mentioned earlier) it doesn’t fill in the areas between them. Perhaps more annoyingly, edges which exist beyond the section cut still show up in cut-through areas (see below). This is visually distracting and not at all acceptable for professional work. If I’d turned in drawings that looked like this in architecture school, my professor would’ve made me run laps around the studio.

Applying the HiddenLine style turns the model black and white, but there are problems.

Edges which exist beyond the plane of the section cut are plainly visible. This isn’t desirable.

Revelation #1: Monochrome is the answer

This helpful post from last year gave me the idea to use the Monochrome face style to automatically turn the “fronts” of my faces white and the “backs”, black. See the following image for a visual explanation of what I did.

I selected the Monochrome face style and chose white and black for the default front and back face colors.
The above settings work well, except where faces are “inside-out”.

Hmm. It was clear that I had a little cleanup work to do; some of my faces were oriented so that the back-side was facing out (above). To make it easier to see what I was doing, I changed the Back Color to something lighter than black, then spent a few minutes turning the offending faces right-side-out by right-clicking them and choosing Reverse Faces. I ended up turning off Section Plane object visibility (View > Section Planes) to make faces easier to select.

Temporarily changing the default Back color to yellow made it easier to see what I was doing.
I spent a few minutes reversing the offending faces.
When I was done, I set the Back color back to black.

Revelation #2: Slim down section cuts

My next problem was easy to solve. The thickened-edge effect that makes section cuts stand out looked too heavy when combined with my newly-pochéd in-between areas, so I made them thinner. You’ll find this setting in the Modeling tab of the Styles dialog box (see below).

The default section cut thickness setting of “3” looks too heavy when combined with poché.
A setting of “1” looks much better.

Revelation #3: Hide Section Planes

While I was in this section of the Styles dialog box, I made sure Section Plane objects would never be visible when my style-in-the-making was applied. I deselected the Section Planes checkbox.

Uncheck the Section Planes checkbox while you’re in this section of the Styles dialog box.

Revelation #4: Eliminate roundness shading

The next challenge I faced was a little trickier. In the following image, notice the shading gradient that defines the curvature on the underside of the Eames lounge? On a true, linework-only drawing, this shading wouldn’t be visible.

The shading in the above image looks nice, but it isn’t appropriate for the drawing type I’m trying to create.

This shading is an automatic result of SketchUp’s built-in rendering engine. It’s usually very useful, but I wanted to get rid of it. After messing around for a few late-night minutes, I figured out how. The key is to do two things:

  • Turn on “Use sun for shading”. This tells SketchUp to use its shadow engine to render faces, even if shadows are turned off (which they probably should be).
  • Move the Dark slider all the way to the right. A setting of 100 for Dark means that shadows basically aren’t visible. This eliminates all curve shading in your model.
Turning on “Use sun for shading” and setting the Dark value to 100 effectively eliminates roundness shading.

Having removed the shading, I’m left with pure black and white linework.

Revelation #5: Set Profiles to “1”

In keeping with my earlier discovery of the benefits of setting my Profile thickness to “1” (instead of “0”), I did so. This allowed curved, multi-faceted surfaces to appear outlined without making the boundaries of every group and component in my model look too thick. The images below show the before and after. Much better.

With Profiles turned off altogether, some rounded objects aren’t visible.
Control Profile settings in the Edge section of the Styles dialog box.
With Profiles turned on and set to “1”, rounded shapes like the lamp on the left are clearly visible.

One more thing

I wanted a nice, thick base for my house to sit on, so I modeled one. Since the base was hollow, the poché trick worked here as well.

I added a thick base to the model.

When everything was set, I created a new style and called it “Section Cut”. With this style applied, things looked just the way I wanted them to, no matter where I cut through my model.

Short section through the same building
The poché trick works just as well on plan sections.

How to Autocomplete Email Addresses in Apps Script

When composing Gmail conversations, the auto-complete feature allows us to see our matching personal contacts as we type and quickly make our contact selections. This time-saving feature can be duplicated when creating Google Apps Script applications. For instance, if you design an application that requires sending emails, you can leverage this auto-complete feature by using a personal contact list.

Defining the Requirements

By observing the behavior while composing Gmail conversations, we can define the requirements of our application.

1. As the user begins typing, a list of matches based on first and last name and email address need to appear under the text box. In other words, the user can begin typing the contacts first name, last name, or their email address.

2. If the desired contact email is listed at the top of the matching list, the user can simply press the Enter key to select it.

3. Another option is to click on any of the contacts in the list.

4. Just in case the user would like to enter an email that is not in their contact list, they may enter the email and press the Enter key.

As an added feature if the email is not formatted correctly, then the invalid email is ignored and not selected. For our application when emails are selected, they will be compiled in a separate list on the right where only the email address is stored. If an email is selected by accident, the user can remove the email by clicking on it.

Designing the Application

The application was designed to mimic the behavior of composing Gmail messages. By doing so, the application avoided the use of buttons, providing an improved user experience.

1. Apps Script Services

The Apps Script’s Spreadsheet Service was used to store a user’s contact data. The Ui Service provided the application interaction with the user, and the Contacts Service was leveraged to gather all the user’s contacts. You may apply a Google Apps domain only filter for the contacts by changing the global variable to “true” in the script.

2. Visualize the Layout

Before writing code, the layout was sketched out to include a text box, some space beneath to list matches, and an area to the right to display the selected emails.

3. Choose your widgets

A text box widget was chosen to allow email entry, and two open list boxes were leveraged to display contact matches and selected emails. List boxes provided the use of click handlers to process email selections.

4. Challenges

To mimic the Gmail auto-complete behavior, the text box needed the ability to handle both keystrokes and a pressed Enter key. To accomplish this, a KeyUpHandler calls a function to identify contact matches via a search. The same function used an e.parameter.keyCode == 13 condition to determine when the enter key is pressed.

[php]<span>//create text box for auto-complete during email lookup in left grid</span>
var textBox = app.createTextBox().setName(<span>’textBox'</span>)
.setWidth(<span>’330px'</span>).setId(<span>’textBox'</span>);  
var tBoxHandler = app.createServerKeyHandler(<span>’search_'</span>);
tBoxHandler.addCallbackElement(textBox); textBox.addKeyUpHandler(tBoxHandler);
…function search_(e){ var app = UiApp.getActiveApplication(); app.getElementById(<span>’list'</span>).clear();
var searchKey = new RegExp(e.parameter.textBox,<span>"gi"</span>); 
<span>if</span> (searchKey == "") app.getElementById(<span>’textBox'</span>).setValue(<span>”</span>);
var range = sheetOwner.getRange(1, 1, sheetOwner.getLastRow(), 2).getValues(); var listBoxCount = 0;
var firstOne = <span>true</span>; <span>for</span> (var i in range){  
// if first/last name available, display name and email address <span>if</span>
(range[i][0].search(searchKey) != -1 || range[i][1].search(searchKey) != -1){ <span>if</span>
(range[i][0].toString()){ app.getElementById(<span>’list'</span>).addItem(range[i][0].toString()+ 
‘ .. ‘+range[i][1].toString(), range[i][1].toString()); 
var listBoxCount = listBoxCount + 1; } <span>else</span> { // else just display the email address 
app.getElementById
(<span>’list'</span>).addItem(range[i][1].toString()); var listBoxCount = listBoxCount + 1; }  
<span>if</span> (firstOne) var firstItem = range[i][1].toString(); var firstOne = <span>false</span>;
} }  
// set the top listbox item as the default <span>if</span> (listBoxCount &gt; 0) app.getElementById(<span>’list’
</span>)
.setItemSelected(0, true);
<span>
// if enter key is pressed in text box, assume they want to add</span> <span>// the email that’s not in the list</span> <span>if</span>
(e.parameter.keyCode==13 &amp;&amp; listBoxCount &lt; 1 &amp;&amp; searchKey !== <span>""</span>) { …[/php]

As this application shows, Apps Script is very powerful. Apps Script has the ability to create applications which allow you to integrate various Google services while building complex user interfaces.

 

You can find Dito’s Email Auto-Complete Script here. To view a video demonstration click here. You can also find Dito Directory on the Google Apps Marketplace.

SketchUp Pro Case Study: Dan Tyree

Dan Tyree is an extremely prolific home designer who uses Sketchup Pro with LayOut for his presentations and documentation. He’s designed homes throughout the world. Dan writes:

I started using CAD products when they were still running on a DOS platform; I spent many years using expensive programs, but still struggled to find a good way to present in 3D for my clients. I started using Sketchup Pro as a solution for presentations, and used the DWG exporters to continue the drawings in CAD. I quickly realized that LayOut would allow me to completely eliminate my CAD program—I could create construction documents directly from the presentation model.

The Reese Residence designed in SketchUp and presented in LayOut

We use Sketchup and LayOut to create amazing presentations for our clients. We are able to show the design in rendered views or immersive videos. Clients are able to picture what the final product will be in vivid detail. We provide the SketchUp file to clients so they can experiment with colors, or just browse through their new home design. We post images and videos of the design on the client’s page (on our website) for their review.


LayOut provides everything we need to create construction documents.

Next, we take the SketchUp model and link it to a LayOut document in order to start developing the construction drawings. These drawings include full-color renderings and perspective views, as well as traditional black and white parallel projections. The interaction between the two products allows us to offer changes throughout the process, even right up to the moment of final printing.

“Skiatook”, presented in LayOut

PDF and CAD files are exported from LayOut. These are made available for our clients to download from our website. SketchUp and LayOut have made presenting a design and creating construction drawings a streamlined process, and have allowed us to provide an affordable custom design product.