POV-Ray : Newsgroups : povray.newusers : How to get a rounding between two boxes : Re: How to get a rounding between two boxes Server Time
7 Jul 2024 07:20:44 EDT (-0400)
  Re: How to get a rounding between two boxes  
From: Stephen
Date: 29 Mar 2010 16:07:20
Message: <4bb10878$1@news.povray.org>
On 29/03/2010 8:01 PM, Harry H. Arends wrote:
> Thanks for the suggestions but that's to complicated for me.
> I am a novice and still trying things out.

It is the standard way to do it but another way of saying it is:

You need to make a mould to subtract (Difference) from the edge. First 
you create a cylinder whose radius is the one you want to round the 
edge. You then difference that from a box that is slightly larger (in 
width) than the cylinder (CSG0). (Difference the cylinder from a corner 
of the box) Now all you have to do ;-) is to put your original box in a 
CSG difference with CSG0 scaled to be larger than the edge of your box 
and placed so that it subtracts from the edge correctly.
Below is some code.
Note that I cannot visualise these things very well so I use a modeller 
and that is what produces the code. The texture is a standard one but of 
course you can use your own.


#declare CSG1 =
difference {
   box {  // Box0
     < -0.5000000, -0.5000000, -0.5000000 >, < 0.5000000, 0.5000000, 
0.5000000 >
     scale     <10.000000,10.000000,10.000000>
     translate <0.000000,5.000000,0.000000>
   }  // end Box0

   difference {  // CSG0
     box {  // Box1
       < -0.5000000, -0.5000000, -0.5000000 >, < 0.5000000, 0.5000000, 
0.5000000 >
       scale     <2.000000,2.000000,2.000000>
       translate <0.000000,10.000000,0.030000>
     }  // end Box1

     cylinder {  // Cylinder0
       -0.5000000*y,0.5000000*y,1.000
       scale     <1.000000,2.100000,1.000000>
       rotate    <0.000000,0.000000,90.000000>
       translate <0.000000,9.000000,1.028000>
     }  // end Cylinder0

     scale     <5.059000,1.000000,1.000000>
     translate <0.000000,0.000000,-5.028000>
   }  // end CSG0

   texture{ PinkAlabaster }
}  // end CSG1



-- 

Best Regards,
	Stephen


Post a reply to this message

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