POV-Ray : Newsgroups : povray.general : Giving thickness to plane surfaces - is it possible Server Time
1 Aug 2024 06:18:14 EDT (-0400)
  Giving thickness to plane surfaces - is it possible (Message 1 to 6 of 6)  
From: yatdave
Subject: Giving thickness to plane surfaces - is it possible
Date: 27 Mar 2006 23:05:01
Message: <web.4428b531cc6d48184a366980@news.povray.org>
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.
I'd like to be able to render the sides of these plates, but am not able to
model them explicitly.  I know in the world of RenderMan, there are
diplacement shaders that can be used to vary the elevations of polygon
surfaces.  Is there something analogous in POVRay?  Is there some other way
I can basically extrude these surfaces?  Any help would be appreciated.
Thanks.


Post a reply to this message

From: Warp
Subject: Re: Giving thickness to plane surfaces - is it possible
Date: 28 Mar 2006 00:56:18
Message: <4428d002@news.povray.org>
yatdave <nomail@nomail> wrote:
> Is there a way to go about giving thickness to plane surfaces?

  That depends on the primitives you are using to model those surfaces.
(You say 'plane', which is in itself a primitive in povray, but I guess
that's not necessarily explicitly the povray primitive you are using
(and I would bet any amount of money that someone will write an answer
assuming you referred to a 'plane' primitive explicitly) but you are
using some planar surface, you just failed to tell which. Triangle
meshes? Polygons? Planes? What?)

  There's no way in POV-Ray to automatically take a surface and
extrude it (that's a job for a modeller). If you want to "extrude"
a surface, you'll have to do it in your modeller or "by hand" with
the SDL by creating another surface parallel to the one you want
to extrude, facing the other direction. (If the surface is actually
a "solid" object, you'll probably want to use the 'intersection' of
these objects.)

  *Assuming* you were using 'plane' primitives explicitly (if you
aren't, just take this as an example), it would be like this:

intersection
{ plane { y, 0 } // the original plane
  plane { -y, .1 } // creates a thickness of 0.1
}

-- 
                                                          - Warp


Post a reply to this message

From: Slime
Subject: Re: Giving thickness to plane surfaces - is it possible
Date: 28 Mar 2006 02:27:57
Message: <4428e57d$1@news.povray.org>
Sounds to me like you want a lot of box{}es. If you want something
mathematically similar to displacement shaders, you might be able to use an
isosurface, but that's probably overkill.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Kenneth
Subject: Re: Giving thickness to plane surfaces - is it possible
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

From: Kenneth
Subject: Re: Giving thickness to plane surfaces - is it possible
Date: 28 Mar 2006 06:35:00
Message: <web.44291e77f9154f14b9b66bb80@news.povray.org>
Oops!  Left out a closing bracket after the functions...

#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..}
                 }

and here too...

 #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..}
                 }

Ken


Post a reply to this message

From: yatdave
Subject: Re: Giving thickness to plane surfaces - is it possible
Date: 28 Mar 2006 14:25:00
Message: <web.44298c2bf9154f149f664bf30@news.povray.org>
Thanks to everyone for your responses.  I appreciate it.

The primitives are indeed triangles.  My apologies for the vagueness in the
posting - I'm not a modeller, rather just a lowly engineer.  The model I
have is output from engineering analysis software, so I have no control
over the model generation itself.  I can apply textures and pigments and
lighting and all that fun stuff, but that's about it.  Based on all of your
responses, it sounds like this one's going to be beyond my direct control.
Think I'll have to talk to the programmers that do have some control over
model generation on this one.

Thanks again.


Post a reply to this message

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