Generate a Radiance picture using rtrace instead of rpict under Windows

Hi,

I’m working through Axel Jacobs' excellent 'rtcontrib' tutorial and I want to generate a Radiance picture using rtrace instead of rpict. For your information, I'm under Windows 7 with the latest Radiance binaries downloaded from the NREL Openstudio website: http://openstudio.nrel.gov/getting-started-developer/getting-started-radiance

When I try this:
vwrays −ff −vf view1.vf −x 1024 −y 1024 | rtrace ‘vwrays −d −vf view1.vf −x 1024 −y 1024‘ −ffc scene.oct > view1.hdr

I obtain this error message:
rtrace: fatal - command line error at 'vwrays'

Then I use double quotes...
vwrays −ff −vf view1.vf −x 1024 −y 1024 | rtrace "vwrays −d −vf view1.vf −x 1024 −y 1024" −ffc scene.oct > view1.hdr

...and I obtain this error message:
rtrace: fatal - command line error at 'vwrays −d −vf view1.vf −x 1024 −y 1024'

Any advice on how to solve or work around this problem would be greatly appreciated !

Thanks in advance,

François Cantin

stagiaire en architecture, M Arch, MSc Arch
[cid:coarchitecture3-reduit29.jpg]
1175, Lavigerie, bureau 400, Québec, Qc, G1V 4P1
T (418) 653 8484 #224, F (418) 653-6189
E [email protected]<http://[email protected]>
http://www.coarchitecture.com

Ce message électronique de même que tous les fichiers attachés qu'il contient sont confidentiels et destinés exclusivement à l'usage de la personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci de le retourner à son émetteur. La publication, l'usage, la distribution, l'impression ou la copie non autorisée de ce message et des pièces jointes qu'il contient sont strictement interdits.
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.

Hi Francois,

Yeah, Windows doesn’t always support some of the more elegant ways we can shuttle input and output around to unix programs. Here’s a snippet of Ruby code from the OpenStudio Radiance daylight sim program, which uses rtcontrib as well. You can see that if running on Windows, the script does the vwrays call and stores it as a variable (vwrays_out) and then passes that in, later. If running on Mac or Linux, the second command takes the form of Akel’s from his tutorial.

puts "computing daylight coefficients for #{space_name}"
            view_def = ""
            dims = options.dims
           view_def ="-x #{dims} -y #{dims} -vf #{Dir.pwd}/numeric/#{space_name}.sns"
            if /mswin/.match(RUBY_PLATFORM) or /mingw/.match(RUBY_PLATFORM)
              vwrays_out = `vwrays -d #{view_def}`.strip
              exec_statement("vwrays -ff #{view_def} | rtcontrib #{rtrace_args = "#{opts_map}"} -V- -fo -ffc #{vwrays_out} -f tregenza.cal -bn 146 -b tbin -o #{binDir}/#{space_name}_treg%03d.hdr -m skyglow model_dc.oct")
            else
              exec_statement("vwrays -ff #{view_def} | rtcontrib #{rtrace_args} -n #{simCores} -V- -fo -ffc $(vwrays -d #{view_def}) -f tregenza.cal -bn 146 -b tbin -o #{binDir}/#{space_name}treg%03d.hdr -m skyglow model_dc.oct")

I hate to suggest another dependency to make this work, but that’s how we did it for our purposes. Maybe some savvy Windows users know a workaround that can be employed directly in the Windows shell. ?

- Rob

···

From: François Cantin [mailto:[email protected]]
Sent: Monday, June 25, 2012 11:23 AM
To: [email protected]
Subject: [Radiance-general] Generate a Radiance picture using rtrace instead of rpict under Windows

Hi,

I’m working through Axel Jacobs' excellent 'rtcontrib' tutorial and I want to generate a Radiance picture using rtrace instead of rpict. For your information, I'm under Windows 7 with the latest Radiance binaries downloaded from the NREL Openstudio website: http://openstudio.nrel.gov/getting-started-developer/getting-started-radiance

When I try this:
vwrays −ff −vf view1.vf −x 1024 −y 1024 | rtrace ‘vwrays −d −vf view1.vf −x 1024 −y 1024‘ −ffc scene.oct > view1.hdr

I obtain this error message:
rtrace: fatal - command line error at 'vwrays'

Then I use double quotes...
vwrays −ff −vf view1.vf −x 1024 −y 1024 | rtrace "vwrays −d −vf view1.vf −x 1024 −y 1024" −ffc scene.oct > view1.hdr

...and I obtain this error message:
rtrace: fatal - command line error at 'vwrays −d −vf view1.vf −x 1024 −y 1024'

Any advice on how to solve or work around this problem would be greatly appreciated !

Thanks in advance,

François Cantin

stagiaire en architecture, M Arch, MSc Arch

[cid:[email protected]]

1175, Lavigerie, bureau 400, Québec, Qc, G1V 4P1

T (418) 653 8484 #224, F (418) 653-6189

E [email protected]<http://[email protected]>

Ce message électronique de même que tous les fichiers attachés qu'il contient sont confidentiels et destinés exclusivement à l'usage de la personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci de le retourner à son émetteur. La publication, l'usage, la distribution, l'impression ou la copie non autorisée de ce message et des pièces jointes qu'il contient sont strictement interdits.
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.

Hi,

I am trying the same code as François but in my case I’m running it on Linux so I should not have that problem. Nevertheless, I have also proved both methods with single and double quotes and I obtain the same error messages. Do you know what could be the problem?

Thank you in advance,
Irene

Hi Irene,

under LINUX, you can just use rtpict, which is a relatively new Perl script that uses rtrace for HDR images. I use it all the time. It has replaced rpiece in all of our UNIX scripts.

Under LINUX, it has a -n option for multi-threading. I suggest you run it on a thumbnail first to populate the ambient file.

Cheers
Axel

I recently made an enhancement to rtpict that automatically runs an overture calculation if an ambient file is provided, or randomizes the ray samples if all you are asking for is an output picture. (As I’m sure you know, rtpict is also designed to extract other data such as depth, surface normals, etc.) This avoids some of the issues with non-linear speed-up, bringing the performance on par with rpiece in most (but not all) cases.

The man page is attached.
-Greg

P.S. The original error message seems related to using single-quotes rather than back-quotes, which are needed for command substitution.