su2rad.rb - update of the Sketchup to Radiance converter

Dear fellow polygon benders and ray wranglers.

I have updated the download version of my su2rad Sketchup to Radiance
exporter. All those who have downloaded it in the past are advised to
get the new version because of the bug fixes it contains. Many thanks
to those who have tested the script and reported success and failure.

Download link: http://su2rad.googlecode.com/files/su2rad_v00d.zip

Some noteworthy new features

   * export by group, by color or by layer
   * import of rtrace results into Sketchup (as 3D fields)
   * experimental material library feature
   * experimental luminaire/geometry replacement feature

Please be aware of the experimental state of this script. The exported
scenes still contain the occasional error and you should always verify
the created geometry.

I have also bundled a small script that replaces the 'locations' dialog
(Sketchup Pro feature) on Google Sketchup. It has no database of country
and city coordinates but it allows the simple setting of longitude and
latitude values for the model. If you're only interested in this script
you can get the Ruby file here:

location.rb: http://su2rad.googlecode.com/svn/trunk/location/location.rb

I haven't updated the online documentation yet but the features should
be easy enough to understand without it.

Have fun!

Thomas

Thomas Bleicher wrote:

Dear fellow polygon benders and ray wranglers.

I have updated the download version of my su2rad Sketchup to Radiance
exporter. All those who have downloaded it in the past are advised to
get the new version because of the bug fixes it contains. Many thanks
to those who have tested the script and reported success and failure.

Hi Thomas,

There seems to be a problem with this new version. When I export, it creates a bunch of materials but names them all "default_material". Perhaps the new material library function is causing this? Is there a way to get the previous version back? On the google site, you have a ver_c but you also made a ver_d prior to the current one, which worked great for me. I hope you still have that earlier ver_d, because I overwrote mine and this one doesn't work for me yet and I was hoping to use your script this week!

Let me know, and thanks for updating it. Maybe I'm just not using the material library function properly?

- Rob

There seems to be a problem with this new version. When I export,
it creates a bunch of materials but names them all "default_material".

I couldn't reproduce Rob's problem here but there is a situation
where something similar happens (semi-)intentionally:

In 'by layer' export the script uses the layer of the polygons
to define the material. I assume that most imports from CAD will
keep the layer assignment as it was and so you could use this
to create layers like 'concrete', 'wall internal', 'wall external'
which after the export would be assigned to materials of the same
name (or the Radiance save version with spaces replaces by '_').

At the moment the only thing the exporter can do is to create a
dummy material file with all of these layer/material names aliased
to the default material. Hence the unmodified export will be grey.
You now should use the references in the 'material.rad' file to
create your own material file. The simplest way is to replace it
with a standard file that contains default material descriptions.
As long as your layer names match the material names this should
work out of the box.

I was planning to add a function to read existing material files
and use the definitions in this file. However, for that I have to
write a parser for Radiance syntax in Ruby and that's not at the
top of my TODO list right now.

Perhaps the new material library function is causing this? Is there
a way to get the previous version back? On the google site, you have
a ver_c but you also made a ver_d prior to the current one, which
worked great for me.

I do not remember a previous v00d but I referred to everything since
v00c as 'v00d'; it just never had a release date next to it.

You can go to the google code site and check the existing revisions
here:

  http://code.google.com/p/su2rad/source/list

Then you can use any SVN client to get the revision you want or
use your web browser to get them individually.

Maybe I'm just not using the material library function properly?

The only thing you could do right now is place a Radiance material
file next to the material's '*.skm' file in your Sketchup installation.
The content of this file would be use instead of the replacement
so the names have to match! It's not my preferred way to handle
materials but it was possible without 'understanding' the contents
of the file and therefore quick and easy to do.

NOTE: I have found another problem with the material assignment
       that causes the rendering of the scene to fail due to missing
       material definitions. This happens with the 'by color' mode
       and is fixed in the current SVN.
       I also noticed that the 'by color' mode does not behave as
       it's supposed to do. This might be related to components and
       therefore not such a problem but I see that I have to work on
       this for a while before a 0.1 release.

Anyhow, I hope it still helps some of you out there.
Thomas

···

On 20 Mar 2008, at 21:09, Rob Guglielmetti wrote:

Dear radiance community,

I have been trying to get the su2rad plugin from Thomas Bleicher working on OS X. However, at
startup it displays these error messages in a UI.messagebox in sketchup 6:
undefined method `file_loaded?' for main:Object
/Users/Casper/Library/Application Support/Google SketchUp
6/SketchUp/Plugins/location.rb:163

After I hit the 'ok' button the next messagebox appears:
undefined method `file_loaded?' for main:Object
/Users/Casper/Library/Application Support/Google SketchUp
6/SketchUp/Plugins/su2rad.rb:167

After that I get a load errors overview from sketchup displaying that it won't load these two files
due to the file_loaded error.

A little disappointed I try to load su2rad through the ruby console (load 'su2rad.rb') and to my
surprise it returns:

load 'su2rad.rb'

++ found preferences file '/Users/Casper/Library/Application Support/Google SketchUp
6/SketchUp/Plugins/su2radlib/config.rb'
++ applied preferences from '/Users/Casper/Library/Application Support/Google SketchUp
6/SketchUp/Plugins/su2radlib/config.rb'
true

So I try my luck and enter load 'location.rb' and this one also returns "true". In the "plugins"
menu a Radiance item is added as well as a location-item.

Even though it is working after all (my compliments to Thomas Bleicher), I wonder why I get
these error messages in the first place. Someone out there who knows?

Regards,
Casper Esmeijer

Hi Casper.

This basically means that the method 'file_loaded?' is not defined
yet when Sketchup loads the file 'location.rb'. This is a bit odd
because that's actually built into Sketchup these days (as far as
I know). How old is your Sketchup installation?

I can give you more advice on debugging this problem but please
let's do this off list. There's also an issue tracker on the
google code project site:

http://code.google.com/p/su2rad/issues/list

Please report as well where you got the su2rad scripts from. The
SVN repository is not much used so I don't bother with any form
of quality check for the HEAD release.

Regards,
Thomas

···

On 15 Apr 2008, at 21:28, Casper Esmeijer wrote:

Dear radiance community,

I have been trying to get the su2rad plugin from Thomas Bleicher working on OS X. However, at
startup it displays these error messages in a UI.messagebox in sketchup 6:
undefined method `file_loaded?' for main:Object
/Users/Casper/Library/Application Support/Google SketchUp
6/SketchUp/Plugins/location.rb:163