19.12.2016 Views

Architectural_Design_with_SketchUp

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Architectural</strong> <strong>Design</strong> <strong>with</strong> <strong>SketchUp</strong><br />

We can now take this geometry as the basis for further modeling. In this case, I used<br />

<strong>SketchUp</strong>’s standard Push/Pull tool to extrude the patterned panel (there is no need to do<br />

that using code!). When we placed the circles on top of the square face, their faces were<br />

automatically separated from the underlying face. This allowed me to use a single push/pull<br />

to finish the panel. A rendering could then look like Figure 6.14.<br />

Figure 6.14: Rendered panels<br />

You can get creative <strong>with</strong> this little bit of code if you replace some of the sin functions<br />

<strong>with</strong> cos or any other mathematical formula. You can also experiment <strong>with</strong> some of the factors<br />

that end up determining circle diameter (the last parameter in the add_circle method)<br />

or the expression between the brackets in the sine function.<br />

TIP<br />

One thing that may stump you when doing calculations in Ruby is Ruby’s reluctance to<br />

give a floating point value after dividing two integers. This is the reason you see to_f in a<br />

few places in the code. This little snippet converts any number to a “float,” a real number.<br />

Alternatively, you could initialize the variables <strong>with</strong> an extra digit, as in width = 36.0.<br />

Plotting Data from Text Files<br />

When you create geometry, parameters might need to come from a source outside of<br />

<strong>SketchUp</strong>. This would be the case if you had an Excel spreadsheet <strong>with</strong> x,y,z coordinates<br />

(as would be available from a LIDAR laser scan or from a land surveyor). You might also have<br />

other software (structural or other building analysis software) export parameters that you<br />

could use for geometry creation. In any case, let’s assume for this example that you had point<br />

coordinates stored in a text file in the following format:<br />

81.82821,16.42147,205.31<br />

83.07821,16.33147,204.91<br />

83.57821,10.31147,204.87<br />

82.20821,10.43147,204.50<br />

254

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

Saved successfully!

Ooh no, something went wrong!