POV-Ray : Newsgroups : povray.text.tutorials : Rounding off edges : Re: Rounding off edges Server Time
10 May 2024 06:05:32 EDT (-0400)
  Re: Rounding off edges  
From: Larry Fontaine
Date: 7 Sep 1999 18:27:57
Message: <37D58FCA.26E36B46@isd.net>
TigerHawk wrote:

> About a week ago I started creating a toilet model in pov-ray (yes,
> I know it's been done, but I wanted my own toilet :) via a text editor.
> I did not want to use a modeller because I'd be able to move things
> around better (I suppose I could make peices of it in a modeller, but
> the scaling may be off, etc. Besides, I like CSG). The problem I have
> encountered is the smoothing of the edges. Now, I know I can use a
> superellipsoid for the tank and tank lid, but what about the seat and
> the top of the base? Using cylinders and such makes the edges very sharp
> (OUCH!) and I am wondering how might one go about smoothing them
> out? Superellipsoinds can't do rounded cylinder shapes (or can they?) so
> I am kind of stuck
>
> I thought about using CSG of the difference of a square and the side of
> a cylinder, and using that and differencing that with another object,
> but that would only make a mold for a straight-edge.
>
> Any ideas?
>
> Tim Soderstrom
> TigerHawk
> Tig### [at] SticNet

Use these macros if you like:

A visual explanation of the macros is in p.b.t

#macro roundbox (X1,Y1,Z1,X2,Y2,Z2,R)
#local T=0;
#if (X1>X2) #declare T=X2; #declare X2=X1; #declare X1=T; #end
#if (Y1>Y2) #declare T=Y2; #declare Y2=Y1; #declare Y1=T; #end
#if (Z1>Z2) #declare T=Z2; #declare Z2=Z1; #declare Z1=T; #end
merge {
   cylinder { <X1+R,Y1+R,Z1+R>,<X1+R,Y1+R,Z2-R>,R }
   cylinder { <X1+R,Y1+R,Z1+R>,<X1+R,Y2-R,Z1+R>,R }
   cylinder { <X1+R,Y1+R,Z1+R>,<X2-R,Y1+R,Z1+R>,R }
   cylinder { <X2-R,Y1+R,Z1+R>,<X2-R,Y1+R,Z2-R>,R }
   cylinder { <X1+R,Y1+R,Z2-R>,<X2-R,Y1+R,Z2-R>,R }
   cylinder { <X2-R,Y1+R,Z1+R>,<X2-R,Y2-R,Z1+R>,R }
   cylinder { <X1+R,Y1+R,Z2-R>,<X1+R,Y2-R,Z2-R>,R }
   cylinder { <X2-R,Y1+R,Z2-R>,<X2-R,Y2-R,Z2-R>,R }
   cylinder { <X1+R,Y2-R,Z1+R>,<X1+R,Y2-R,Z2-R>,R }
   cylinder { <X1+R,Y2-R,Z1+R>,<X2-R,Y2-R,Z1+R>,R }
   cylinder { <X2-R,Y2-R,Z1+R>,<X2-R,Y2-R,Z2-R>,R }
   cylinder { <X1+R,Y2-R,Z2-R>,<X2-R,Y2-R,Z2-R>,R }
   sphere { <X1+R,Y1+R,Z1+R>,R }
   sphere { <X1+R,Y1+R,Z2-R>,R }
   sphere { <X1+R,Y2-R,Z1+R>,R }
   sphere { <X1+R,Y2-R,Z2-R>,R }
   sphere { <X2-R,Y1+R,Z1+R>,R }
   sphere { <X2-R,Y1+R,Z2-R>,R }
   sphere { <X2-R,Y2-R,Z1+R>,R }
   sphere { <X2-R,Y2-R,Z2-R>,R }
   box { <X1,Y1+R,Z1+R>,<X2,Y2-R,Z2-R> }
   box { <X1+R,Y1,Z1+R>,<X2-R,Y2,Z2-R> }
   box { <X1+R,Y1+R,Z1>,<X2-R,Y2-R,Z2> }
   bounded_by { box { <X1,Y1,Z1>,<X2,Y2,Z2> } }
} #end

#macro roundcylinder (H,R1,R2)
merge {
   cylinder { <0,0,0>,<0,H,0>,R1-R2 }
   cylinder { <0,R2,0>,<0,H-R2,0>,R1 }
   torus { R1-R2,R2 translate <0,R2,0> }
   torus { R1-R2,R2 translate <0,H-R2,0> }
   bounded_by { cylinder { <0,0,0>,<0,H,0>,R1 } }
} #end


Post a reply to this message

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