POV-Ray : Newsgroups : povray.general : Giving thickness to plane surfaces - is it possible : Re: Giving thickness to plane surfaces - is it possible Server Time
1 Aug 2024 04:14:47 EDT (-0400)
  Re: Giving thickness to plane surfaces - is it possible  
From: Kenneth
Date: 28 Mar 2006 05:35:00
Message: <web.44291087f9154f14b9b66bb80@news.povray.org>
"yatdave" <nomail@nomail> wrote:
> Is there a way to go about giving thickness to plane surfaces?  I've got a
> model in which a bunch of steel plates are modelled as planar surfaces with
> no thickness.  In reality, these steel plates can be an inch or so thick.

If you don't mind remaking your plates, a good way to achieve what you're
looking for is to use an isosurface object. It allows true surface
displacement. With it, you can take a basic plate shape and either build up
the surface or "eat into" it, using math functions (or POV's built-in
patterns.). Sounds complicated, but it's not. Even an image_map can be
converted into a function.

Here are some examples. First, I'll turn an image_map into a function (mine
is a square shape, and it can be any size)
#declare my_pigment_function_1 =
function{
 pigment{
  image_map{"crater.bmp" map_type 0 interpolate 2 once}
    scale 2.5
    rotate 90*x
    translate <-1.25,0,-1.25>
             }
                     }

Here's POV's CELLS pattern turned into a function...
#declare my_pigment_function_2 =
function{
 pigment{
  cells scale .025
                     }
             }

And the same with POV's CRACKLE pattern...
#declare my_pigment_function_3 =
function{
 pigment{
  crackle scale .07
                     }
             }

Here are some examples of their use (I've posted the renders over at p.b.i):

#1--the basic plate shape:
isosurface{
 function{y} // a simple plane
max_gradient 1.1 // the default value
contained_by{box{<-1,-.05,-1>, <1,0,1>}}
texture{...whatever..}
                }

The contained_by shape is what gives the isosurface it's plate-like form
here. The thickness of the plate is actually determined by the -.05 value.
(It's like a lower-y-boundary; if it were zero, the plate would disappear.)

#2--the basic plate shape with other "plates" built up on it...
isosurface{
 function{y - my_pigment_function_2 (x,y,z).gray * .2}
max_gradient 279
contained_by{box{<-1,-.02,-1>, <1,.3,1>}}
texture{...whatever..}
                }

Here, my_pigment_function_2 is SUBTRACTED from function y--which actually
builds UP the surface. Seems kind of counter-intuitive, eh? The .2
multiplier at the end determines the height (or thickness) of the 2nd
function. Also note the changes in the contained_by box's y values. I
changed -.05 to -.02 to make the plate a bit thinner on the bottom.  And
<1,0,1> has been changed to <1,.3,1>, since the added elevation now needs
some "room" to grow. It's the *other* y-boundary. (Reducing this y-value
would clip off part of the added elevation.) Also note the wildly different
max_gradient value required. That's because the cells pattern (or its
function) has basically straight vertical surfaces....not a great idea for
isosurfaces. It may still show some small holes or artifacts. (The
<x,y,z>.gray is a bit hard to explain; I'll leave that to the POV docs.)

#3--the plate shape with a crater added!

isosurface{
 function{y - my_pigment_function_1 (x,y,z).gray * .4
max_gradient 2.8
contained_by{box{<-1,0,-1>, <1,.3,1>}}
texture{...whatever..}
                }

Here, the "lower-y-boundary" value can be safely raised to zero or slightly
above, since the crater function adds a good deal of height. (The slightly
bumpy surface is a result of the limited black-to-white "resolution" of a
256-bit gray-scale image. Making a larger image wouldn't improve that. A
16-bit grey-scale image would.)

#4--the crater with a crackle pattern function overlaid (this uses three
functions)...

isosurface{
 function{y
  - my_pigment_function_1 (x,y,z).gray * .4 // crater
  + my_pigment_function_3 (x,y,z).gray * .02 // crackle
max_gradient 3.2
contained_by{box{<-1,0,-1>, <1,.3,1>}}
texture{...whatever..}
                }

Here, I wanted the crackle function to eat INTO the surface, so I ADDED it
to the others.

I'm actually not that adept at using isosurfaces, so hopefully others will
add to (or streamline) my examples.

Ken Walker


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.