extrad

What is it?

extrad is a little Perl script which takes a Radiance scene file and splits it up by the objects' material. All primitives with the same modifier will be saved into a separate file.

extrad is probably the first Perl script I've ever wrote. At the time I experimented with SiVIEW, a Radiance plug-in for AutoCAD. It had the annoying habit of saving all of the exported Radiance scene to the same file.

While SiVIEW is dead now, other modellers do the same thing, so extrad is still useful to have.

Usage

Below is the help output.

[axel@adele tmp]$ extrad.pl
Break up big Radiance scene file by material.
Usage: /home/axel/bin/extrad.pl --help
       /home/axel/bin/extrad.pl [-v] file.rad

       -v, --verbose  explain what is being done, useful for debugging
       -h, --help     display this help and exit

Example

Splitting up an exported Radiance scene from Ecotect.

$ ls
example.rad
$ extrad.pl example.rad

244 blocks written to 7 files.
$ ls -l
total 128
-rw-rw-r-- 1 axel axel 35554 Aug  7 12:29 ConcBlockPlaster.rad
-rw-rw-r-- 1 axel axel  1718 Aug  7 12:29 ConcSlab_OnGround.rad
-rw-rw-r-- 1 axel axel  2853 Aug  7 12:29 DoubleGlazed_LowE_AlumFrame.rad
-rw-rw-r-- 1 axel axel 54075 Aug  7 12:23 example.rad
-rw-rw-r-- 1 axel axel 12085 Aug  7 12:29 FramedPlasterboard.rad
-rw-rw-r-- 1 axel axel  1665 Aug  7 12:29 Plaster_Insulation_Suspended.rad
-rw-rw-r-- 1 axel axel   564 Aug  7 12:29 SingleGlazed_TimberFrame.rad
-rw-rw-r-- 1 axel axel   652 Aug  7 12:29 void.rad

Radiance materials are treated the same as geometry primitives, so unless patterns or textures have been applied, they will all end up in void.rad. In most cases you can just rename it to something like example.mat.

Subsequent editing, e.g. renaming of materials, can easily be done with search-and-replace in a text editor or with UNIX tools such as sed.

Download