POV-Ray : Newsgroups : povray.newusers : Round box : Re: Round box Server Time
21 Jul 2024 12:18:46 EDT (-0400)
  Re: Round box  
From: Alain Martel
Date: 4 Jan 2022 10:40:27
Message: <61d46a6b$1@news.povray.org>
Le 2022-01-04 à 09:13, Cabesa a écrit :
> Ive been trying to use the round_box shape but i dont really understand how to.
> If someone is willing to explain the way the shapes and the "macro?" idrk what
> it is, id appreciate it a lot.

You use it pretty much as a regular box, but with the hard edges 
replaced with cylinders and spheres at the vertex. The faces are at the 
same position as for a regular box.

The first two parameters are two 3D vectors that define the opposite 
corners of the box in the exact same way as the two corners of the 
regular box primitive. Those points are actually outside the final shape.

The third one is the radius of the edges, or, the size of the rounded 
part. This is a single float value. If this value is to large, a warning 
will be issued, and the radius adjusted to the actual size. To large 
being more than half the smallest dimension of the box.
If you have this :
round_box( <2,1,1>, <-2,-1,-1>, 1, 0)
You end up with a cylinder capped by two half spheres.
Using those corners, ANY radius larger than 1 will result in the same 
final shape.

The last one determine whether an union or a merge is to be used. UNLESS 
your round_box is transparent or you are using SSLT, you should use the 
union option. So, set this to zero. Using the union option renders faster.

Normal box:
box{ Corner_One, Corner_Two texture{ Some_Texture} }
The equivalent round box :
object{round_box( Corner_One, Corner_Two, radius, 0) texture{ 
Some_Texture} }

The object wrapper is needed to add a texture and to allow some 
transform : rotation, scaling and translate.
The flat faces of the two objects are at the same location.
Those faces are connected using cylinders tangent with the adjacent faces.
Spheres tangent with the adjacent cylinders are used to fill the corners.

Post a reply to this message

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