19.12.2016 Views

Architectural_Design_with_SketchUp

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6<br />

Creating Geometry<br />

Using Ruby Scripting<br />

In this chapter, we will create scripted geometry in <strong>SketchUp</strong>. Often called computational<br />

geometry, this is an exciting current topic that allows you to produce 3D shapes and arrangements<br />

that are impossible (or at least hard) to create by hand. Scripting in <strong>SketchUp</strong> also allows<br />

you to automatize repetitive tasks or facilitate data exchange <strong>with</strong> text files.<br />

Key Topics:<br />

NN<br />

NN<br />

NN<br />

NN<br />

NN<br />

NN<br />

NN<br />

NN<br />

What is computational geometry?<br />

Using Ruby Scripts in <strong>SketchUp</strong><br />

Working <strong>with</strong> multiline editors<br />

Introduction to Ruby<br />

Overview of <strong>SketchUp</strong>’s API<br />

Creating scripted geometry<br />

Transforming geometry<br />

Modifying geometry based on attractors<br />

Why Computational Geometry?<br />

Even to the most seasoned <strong>SketchUp</strong> user, some tasks are challenging to complete by hand,<br />

using only the tools <strong>SketchUp</strong> provides. A good example is the creation of copies of a component<br />

where all the copies need to be placed at locations that vary not only linearly (e.g., “place<br />

a copy every 16 inches”) but also in intervals that are determined by a formula (e.g., where<br />

the y coordinate is determined by the square of x—which, of course, results in the shape of<br />

a parabola; see Figure 6.1).<br />

Another example is a curved building whose window-shading devices need to be designed<br />

such that the degree to which they shade or open is determined by how far they deviate<br />

from the southern direction. (See Figure 6.2.)<br />

Such tasks can sometimes be accomplished using one of the available plugins. However,<br />

those plugins are usually limited to the supplied feature set and are hard or impossible to<br />

modify to your needs. As it turns out, some complex tasks may actually be easier to script in<br />

a few lines of code than to model by hand.<br />

229

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!