POV-Ray : Newsgroups : povray.newusers : Strategy for Prism edge rounding? Server Time
23 Dec 2024 06:28:30 EST (-0500)
  Strategy for Prism edge rounding? (Message 1 to 2 of 2)  
From: Alan1961
Subject: Strategy for Prism edge rounding?
Date: 30 Jan 2010 10:40:00
Message: <web.4b64514d6f6eb208f4e06caf0@news.povray.org>
Is there a simple practical generic approach to rounding off edges on a prism?
 My apologies if I'm asking a simple question and I'm not looking for "the
answer" but simply ideas to be explored.    I'm new to Pov and I've just been
exploring bezier spline prisms before starting my first real project.    However
I would like to be able to construct things with a reasonable degree of photo
realism and for what I would like to do the sharp mathematical 90 deg edges on
Pov geometric shapes and prisms look OK but not great to me.    I appreciate
that for rounding cuboid edges I can probably use SuperEllipsoids.
Ideally I'm looking for solutions where the geometry is "correct" so that things
like shadows and CSG ops fall out OK.

For example, assuming I really like the prism shape in the sample below (it's
just an example!), if I wanted the edges rounded off (say 0.1 radius) what is my
best approach?   Do I really need to start thinking in terms of meshes and
patches?


Many thanks for any tips,

Alan

#version 3.6;
#include "colors.inc"
global_settings {  assumed_gamma 1.0 }
// ----------------------------------------
camera
{
   location  < -9, 12, -10>
   direction 1.5*z
   right     x*image_width/image_height
   look_at   <0.0, 0.0,  2.0>
}
background { color rgb <0.1, 0.3, 0.8> }
light_source { <-40, 30, -30> color White*0.3}
light_source { <+40, 30, +10> color White*0.5}
// ----------------------------------------
plane {  y, -1e-6 pigment { color rgb <0.7,0.5,0.3> } }
#declare Texture=texture {
     pigment {color rgb <0.2,0.5,0.2> }
     finish {
       ambient 0.1              // ambient surface reflection color [0.1]
       diffuse 0.6              // amount [0.6]
       brilliance 1.0           // tightness of diffuse illumination [1.0]
       phong 0.5                // amount [0.0]
       phong_size 40            // (1.0..250+) (dull->highly polished) [40]
       metallic 0.8 //[Amount]  // give highlight color of surface
       reflection {1.0 metallic 1.0}
     }
   };
prism {
        linear_sweep            // or conic_sweep for tapering to a point
        bezier_spline           // linear_spline | quadratic_spline |
cubic_spline |
        0.0,                   // height 1
        0.5,                    // height 2
        10*4,                    // number of points
 <0.0, 0.0>,<1.3, 1.3>,<2.7, 2.7>,<4.0, 4.0>,
 <4.0, 4.0>,<4.0, 4.7>,<4.0, 5.3>,<4.0, 6.0>,
 <4.0, 6.0>,<4.0, 6.8>,<3.3, 8.0>,<2.5, 8.0>,
 <2.5, 8.0>,<1.4, 8.0>,<1.8, 5.8>,<1.0, 5.0>,
 <1.0, 5.0>,<0.7, 4.7>,<0.4, 4.5>,<0.0, 4.5>,
        <0.0, 4.5>,<-0.4, 4.5>,<-0.7, 4.7>,<-1.0, 5.0>,
        <-1.0, 5.0>,<-1.8, 5.8>,<-1.4, 8.0>,<-2.5, 8.0>,
        <-2.5, 8.0>,<-3.3, 8.0>,<-4.0, 6.8>,<-4.0, 6.0>,
        <-4.0, 6.0>,<-4.0, 5.3>,<-4.0, 4.7>,<-4.0, 4.0>,
        <-4.0, 4.0>,<-2.7, 2.7>,<-1.3, 1.3>,<0.0, 0.0>
 //open
texture{Texture}
}
union
{
 #declare dx = -5; #while (dx < 5)  cylinder{ <dx,0,0 >  <dx,0,10> 0.01
pigment{Red } } #declare dx = dx + 0.5; #end
 #declare dz = 0;  #while (dz < 10) cylinder{ <-5,0,dz>  <5,0,dz > 0.01
pigment{Blue} } #declare dz = dz + 0.5; #end
 no_shadow
}


Post a reply to this message

From: Leroy Whetstone
Subject: Re: Strategy for Prism edge rounding?
Date: 31 Jan 2010 23:21:06
Message: <4B665666.9020100@joplin.com>
Alan1961 wrote:
> Is there a simple practical generic approach to rounding off edges on a prism?

  No!

A while back there was a fury of prizm rounding. But I haven't seen a 
'simple practical generic approach'. The mesh approach cann't be called 
simple. I wrote one. Meshs have their own problems.

Good Luck!
   and
Have Fun!


Post a reply to this message

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