en it

su2rad.rb

This page describes the use of the Ruby script su2rad.rb for the popular and free-of-charge 3D modelling software Sketchup.

Download Link

The current version is 0.0d: download

This is an update release with plenty of fixes and a few new features:

  • new by color and by layer export modes
  • preferences dialog (no hacking of Ruby code)
  • simple material library
  • plus: location.rb a script to replace the locations dialog of Sketchup Pro on the poor man’s version (the Google boys won’t like me for that).

It is released under LGPL.

Installation

  1. Download su2rad_v00d.zip from the link above.
  2. Unzip the files.
  3. Drop su2rad.rb, su2radlib (folder!) and if you want location.rb into your ‘Plugins’ directory. This should be something like
    • /Library/Application Support/Google Sketchup 6/Sketchup/Plugins on a Mac
    • C:/Program Files/Google/Google Sketchup 6/Plugins on Windows
  4. Restart SketchUp or type load ‘su2rad.rb’ at the Ruby prompt.
  5. Voila! You should have a new ‘Radiance’ entry in the ‘Plugins’ menu.
  6. Have fun.

Features

What it does

  • su2rad can help you to create Radiance scene descriptions from SketchUp models.
  • exports faces as polygons not just triangles and quads (even with holes)
  • exports saved view points/perspectives
  • exports components and groups as separate files
  • creates Radiance project file structure
  • creates field description for numeric evaluations (rtrace input files)
  • imports rtrace results as 3D surface (just for the fun of it …)
  • resolves conflicts in material assignments (see below)

What it does not

  • It will not teach nor tell you how to use Radiance. You have to know that.
  • no backface material (see below)
  • no proper material conversion
  • no textures
  • no mirroring (‘flipping’) of instances
  • no support for artificial lighting
  • no animation

What it might do (planned features)

  • replacement of component instances with pre-canned Radiance files
  • lookup of material definitions from library file
  • support for '-mx’ etc of xform (mirror)

Configuration

NOTE: With version v00d there is a preferences dialog in the Radiance menu. There is no need to edit the configuration file directly. I have updated the section on configuration options on the code.google.com site. Please refer to this site for information about the available options.

Menus and Dialogs

Menu Entries

The script creates the following menu entries

  • Plugins - Radiance - export scene
  • Plugins - Radiance - export selection
  • Plugins - Radiance - material conflicts - count This only counts the faces with problematic material assignment, but does not change it.
  • Plugins - Radiance - material conflicts - resolve! This will change the material assignment: if only one material is assigned the front material is copied to the back and vice versa, if there are two conflicting assignments the back material is replaced by the front material.
  • Plugins - Radiance - numeric - import results Use this to import files with rtrace results as 3D surface into your scene. The file has to list on point per line in the format x y z v or x y z dx dy dz v. The values have to be separated by white-space characters.

Dialogs

Export Options

After the start of the export function you will see a first dialog to set the export options of su2rad.

Here you should check in particular that the export directory and scene name are those you want (they are taken from the Sketchup file and scene name). The text boxes show only a small part of the directory path. You have to click into the field and move the curser to the right to see the rest.

Depending on you installation of replmarks you will see the global coords option or not. There is no point in offering an option when it’s not actually available.

The default values for these option can be set in the config section at the top of the script.

Render Options

If you have selected to see the Radiance options the following dialog will appear:

These are the standard rad options you should be familiar with. Note that the scene size spec is only 3 values long (xmax, ymax and zmax). The default values are taken from the Sketchup scene size which might be too large for the part you want to export.

su2rad creates a sky description for you Radiance scene. The defaults for the sky type (and location) are taken from the shadow settings of your scene. If you want to use the scene for daylight studies with Radiance it’s worth checking that the exported values are correct.

A Good Sketchup Model

Materials

SketchUp allows you to assign different materials to the front and the back of a polygon or not to use any material at all. Radiance requires one material per polygon which can lead to conflicts.

su2rad.rb performs the following tests to identify the material of a polygon:

  1. If a polygon has only one material directly assigned (front or back) that material is used.
  2. If it has front and back material the front is used. If the two materials are different it is most likely to cause undesired effects so a warning is printed to the Ruby console.
  3. If no material is assigned to the polygon the material of the enclosing group or component instance is used. This ascends the levels of nested groups until a material is found.
  4. If no material has been found at all the material sketchup_default_material (a medium grey) is used for the polygon.

Use directly assigned materials only where necessary (for example the glass in a window component) and assign the same material to both sides of the polygon. Do not assign a material to the rest of the elements. Use the group/component colour instead. This should avoid most differences between Radiance scene and Sketchup model. Use the material conflicts menu to count and resolve/remove conflicts before exporting.

Geometry

Build the Sketchup model as you would create a Radiance scene. You can group elements to handle them as one entity or assign materials but only component instances can be reused in !xform commands and need to be exported only once (if not mirrored).

Do not mirror instances. This is not fully supported yet and a mirrored instance has to be exported in a separate file.

input/exporters/su2rad.txt · Last modified: 2008/03/17 00:05 by tbleicher
Recent changes · Show pagesource · Login