Using variables and maths functions in .rad files

Dear Radiance experts,

When defining the geometry of objects in .rad files, is it possible to use variables and basic maths functions (especially trigonometric functions)? Standard bash syntax doesn't seem to work in that case (i.e. xPos = 5 and $xPos).

Specifically, the coordinates of some of my objects change as a function of angle. So instead of recalculating all the x, y, and z coordinates by hand it would be really useful to just define a new angle and let Radiance's oconv program use the updated Cartesian coordinates.

I somehow have this deep belief that this should be possible :slight_smile:

If you know a clever way to do this, please let me know.

Best wishes,
Michael

···

--
Michael Bannert, Dipl.-Psych.
Vision & Cognition Lab, Centre for Integrative Neuroscience, Univ. of Tübingen & BCCN Tübingen
Otfried-Müller-Str. 25, 72076 Tübingen, Germany
Phone: +49 - (0)7071 / 29 - 89031

Dear Michael,

Have you had a look at the xform command?
http://radsite.lbl.gov/radiance/man_html/xform.1.html

It might just do what you are trying to achieve.

Best,

Giovanni

////////////////////////////////////////////////
Giovanni Betti

···

-----Original Message-----
From: Michael Bannert [mailto:[email protected]]
Sent: 23 August 2013 08:52
To: Radiance general discussion
Subject: [Radiance-general] Using variables and maths functions in .rad files

Dear Radiance experts,

When defining the geometry of objects in .rad files, is it possible to use variables and basic maths functions (especially trigonometric functions)? Standard bash syntax doesn't seem to work in that case (i.e. xPos = 5 and $xPos).

Specifically, the coordinates of some of my objects change as a function of angle. So instead of recalculating all the x, y, and z coordinates by hand it would be really useful to just define a new angle and let Radiance's oconv program use the updated Cartesian coordinates.

I somehow have this deep belief that this should be possible :slight_smile:

If you know a clever way to do this, please let me know.

Best wishes,
Michael

--
Michael Bannert, Dipl.-Psych.
Vision & Cognition Lab, Centre for Integrative Neuroscience, Univ. of Tübingen & BCCN Tübingen Otfried-Müller-Str. 25, 72076 Tübingen, Germany
Phone: +49 - (0)7071 / 29 - 89031

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general