POV-Ray : Newsgroups : povray.general : Rounded edges... Server Time
16 Nov 2024 19:17:08 EST (-0500)
  Rounded edges... (Message 1 to 3 of 3)  
From: -KK-
Subject: Rounded edges...
Date: 1 Sep 2003 18:04:29
Message: <3f53c26d@news.povray.org>
I am trying to create a pillar with slightly rounded edges.
Scene text below....
However, the edges meting at the apex are not equally
curved, and those joinig the 2 prisms are not curved at all.
Can anyone help me?
TIA

global_settings{assumed_gamma 1.4}
#include "colors.inc"
camera {location <0,5,-10> look_at -y*.8 angle 12}
light_source{<-5,10,-10> colour White}
background{colour LightBlue}

#macro RSquare(p1,p2) 32,  // rounded square for use with bezier_spline
    <-p1,-p2>,<-p1,0>,<-p1,0>,<-p1,p2>,    <-p1,p2>,<-p1,p1>,<-p1,p1>,<-p2,p1>,
    <-p2,p1>,<0,p1>,<0,p1>,<p2,p1>,        <p2,p1>,<p1,p1>,<p1,p1>,<p1,p2>,
    <p1,p2>,<p1,0>,<p1,0>,<p1,-p2>,        <p1,-p2>,<p1,-p1>, <p1,-p1>,<p2,-p1>,
    <p2,-p1>,<0,-p1>,<0,-p1>,<-p2,-p1>,    <-p2,-p1>,<-p1,-p1>,<-p1,-p1>,<-p1,-p2>
#end

union{
  prism {conic_sweep bezier_spline 0, -1, RSquare(1, 0.8)}
  prism{linear_sweep bezier_spline -1, -1.2, RSquare(1, .8)}
//  sphere{y*0.2,0.3}
  texture{pigment{Yellow}
          finish{specular 0.4}
  }
}


Post a reply to this message

From: Mike Williams
Subject: Re: Rounded edges...
Date: 2 Sep 2003 02:28:26
Message: <rF8WfJAYVDV$Ew4v@econym.demon.co.uk>
Wasn't it -KK- who wrote:
>I am trying to create a pillar with slightly rounded edges.
>Scene text below....
>However, the edges meting at the apex are not equally
>curved, and those joinig the 2 prisms are not curved at all.
>Can anyone help me?
>TIA

I think that those problems may be unavoidable as long as you are using
prisms. You could achieve the effect using cylinders and spheres to do
the rounding, something like this:-


global_settings{assumed_gamma 1.4}
#include "colors.inc"
camera {location <0,5,-10> look_at -y*.8 angle 12}
light_source{<-5,10,-10> colour White}
background{colour LightBlue}


#declare H=1;   // Height of pyramidal section
#declare W=1;   // Width
#declare B=0.2; // Height of base section
#declare R=0.05; // Roundness of edges

              
// Calculate the angle of the face, so we know how far to translate it
#declare Theta = atan2(H,W)+radians(90);

#declare Side = union {
  cylinder {<W-R, 0, W-R> <0,H-R,0>, R}     // sloping 
  cylinder {<W-R, 0, W-R> <R-W, 0, W-R> R}  // horizontal
  cylinder {<W-R, 0, W-R> <W-R, -B, W-R> R} // vertical
  sphere {<W-R, 0, W-R>, R}                 // corner
  box {<W-R,0,W-R*2> <R-W,-B,W>}            // lower face
  triangle {<W-R,0,W-R> <0,H-R,0> <R-W, 0, W-R> // sloping face
    translate <0,R*sin(Theta),-R*cos(Theta)> 
  }
}

union {
  object {Side}  
  object {Side rotate y*90}  
  object {Side rotate y*180}  
  object {Side rotate y*270}  
  sphere {<0,H-R,0>, R} // vertex
  texture{
    pigment{Yellow}
    finish{specular 0.4}
  }
  translate -H*y
}



-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Tom A 
Subject: Re: Rounded edges...
Date: 3 Sep 2003 09:19:00
Message: <3f55ea44@news.povray.org>
-KK- wrote:

> I am trying to create a pillar with slightly rounded edges.
> Scene text below....
> However, the edges meting at the apex are not equally
> curved, and those joinig the 2 prisms are not curved at all.
> Can anyone help me?
> TIA
> 
> global_settings{assumed_gamma 1.4}
> #include "colors.inc"
> camera {location <0,5,-10> look_at -y*.8 angle 12}
> light_source{<-5,10,-10> colour White}
> background{colour LightBlue}
> 
> #macro RSquare(p1,p2) 32,  // rounded square for use with bezier_spline
>     <-p1,-p2>,<-p1,0>,<-p1,0>,<-p1,p2>,    <-p1,p2>,<-p1,p1>,<-p1,p1>,<-p2,p1>,
>     <-p2,p1>,<0,p1>,<0,p1>,<p2,p1>,        <p2,p1>,<p1,p1>,<p1,p1>,<p1,p2>,
>     <p1,p2>,<p1,0>,<p1,0>,<p1,-p2>,        <p1,-p2>,<p1,-p1>, <p1,-p1>,<p2,-p1>,
>     <p2,-p1>,<0,-p1>,<0,-p1>,<-p2,-p1>,    <-p2,-p1>,<-p1,-p1>,<-p1,-p1>,<-p1,-p2>
> #end
> 
> union{
>   prism {conic_sweep bezier_spline 0, -1, RSquare(1, 0.8)}
>   prism{linear_sweep bezier_spline -1, -1.2, RSquare(1, .8)}
> //  sphere{y*0.2,0.3}
>   texture{pigment{Yellow}
>           finish{specular 0.4}
>   }
> }

I've used superelipsoids as pillows - sorry, don't remember the 
parameters.  Looked fine.

Tom A.


Post a reply to this message

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