[Radiance-general] Simulating Perforated Metal

Georg Mischler [email protected]
Wed, 24 Jul 2002 20:03:45 -0400 (EDT)


dela wrote:

> Hi everyone!
>
> I'm trying to simulate perforated metal and would
> like to know if anyone knows of any examples where
> this has been done.  (or if this has been discussed
> in a previous digest)

Use this:

----------------------------------------------------------
{
	perforate.cal
    Perforation function for approximately horizontal sufaces,
	for use in a mixfunc. Foreground is solid, background the holes.
	Set background to empty for a true perforation, or to a different
	material for polka dots.

	Relative hole size is determined by A1.
    Size of single circle is 1 - scale as required (eg. 0.05m).

	x_hole cuts holes in x-direction (through the y-z plane)
	y_hole cuts holes in y-direction (through the x-z plane)
	z_hole cuts holes in z-direction (through the x-y plane)

    Georg Mischler 30. 04. 1993
}

`xn = mod(Px, 1) - 0.5;
`yn = mod(Py, 1) - 0.5;
`zn = mod(Pz, 1) - 0.5;

`outofcirc(x, y, r) = if(sqrt(x*x + y*y) - r, 1, 0);

z_hole = `outofcirc(`xn, `yn, A1);
x_hole = `outofcirc(`yn, `zn, A1);
y_hole = `outofcirc(`zn, `xn, A1);

{ end of perforate.cal }
----------------------------------------------------------

Then define a mixfunc as follows (for horizontal sheets):

  void mixfunc z_perforation
  6 some_material void z_hole perforate.cal -s 0.05
  0
  1 0.4

where "some_material" is whatever you want your metal to
look like.


Have fun!

-schorsch

-- 
Georg Mischler  --  simulations developer  --  schorsch at schorsch.com
+schorsch.com+  --  lighting design tools  --  http://www.schorsch.com/