POV-Ray : Newsgroups : povray.newusers : How to get a rounding between two boxes Server Time
29 Oct 2024 22:45:38 EDT (-0400)
  How to get a rounding between two boxes (Message 1 to 8 of 8)  
From: gharryh
Subject: How to get a rounding between two boxes
Date: 19 Mar 2010 06:25:01
Message: <web.4ba3502fe87617d7da0e3b8d0@news.povray.org>
For a test i am constructing a inc that contains some profiles.
Now i want to create a rounding between two boxes to visualize a smooth
transition between these two surfaces.

#macro UPN_GRND(h,b,tw,tf,r1,r2,uf)
#local Base=
union{
        difference {
                box{<-tw/2,0,0><b-r2,tf*1.65,1>}
         box{<-tw/2-1,0,-.10><b+1,tf+1,1.1>
Rotate_Around_Trans(<0,0,-12.0><b/2,tf,0>) translate<tw/2,tf,0>}
                }

        difference {
                cylinder{<b-r2,0,0><b-r2,0,1>,r2 }
                box{<b-2*r2,0,-.1><b+r2,-10-.1,1.1>}
                }
        cylinder{<tw/2+r2*2,tf*2.4,0><tw/2+r2*2,tf*2.4,1>,r1}
         // represent the smoothness radius (r1)
        };

union {
        box{<-tw/2,0,0><tw/2,h,1> }
        object{Base}
        object{Base rotate<180,0,0> translate<0,h,1>}
        }
#end

#macro UPN100(value)
        object{UPN_GRND(100,50,6,8.5,8.5,4.5,25) scale<1,1,value>}
#end

value in the UPN100 macro represents the lenght of that beam.

Thanks in advance

Harry


Post a reply to this message

From: Mr
Subject: Re: How to get a rounding between two boxes
Date: 20 Mar 2010 05:35:00
Message: <web.4ba49577a8b6257649313f190@news.povray.org>
The documentation refers to the "merge" keyword for CSG operations could it do
what you want?


Post a reply to this message

From: Warp
Subject: Re: How to get a rounding between two boxes
Date: 20 Mar 2010 09:23:35
Message: <4ba4cc56@news.povray.org>
Mr <nomail@nomail> wrote:
> The documentation refers to the "merge" keyword for CSG operations could it do
> what you want?

  Would it be a big trouble to actually read the documentation in question
before suggesting it?

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: How to get a rounding between two boxes
Date: 20 Mar 2010 15:45:33
Message: <4ba525dd$1@news.povray.org>

> The documentation refers to the "merge" keyword for CSG operations could it do
> what you want?
>
>
>

merge is an alternative to union designed to remove internal surfaces 
when using transparent CSG objects.

It realy have absolutely no relevance to the present case.



Alain


Post a reply to this message

From: clipka
Subject: Re: How to get a rounding between two boxes
Date: 21 Mar 2010 18:33:19
Message: <4ba69eaf@news.povray.org>
gharryh schrieb:
> For a test i am constructing a inc that contains some profiles.
> Now i want to create a rounding between two boxes to visualize a smooth
> transition between these two surfaces.

For rounded concave edges, you'll need to add another box with square 
cross-section in that corner, then cut away from it using "difference" 
with a cylinder (make sure it's a bit longer than the beam, so you don't 
get a "coincident surfaces" problem at the ends).

For rounde convex edges, you'll need to subtract a box from the corner 
(again make sure it's a bit longer than the beam), then fill it up with 
a cylinder.

As this will quickly increase the complexity of the shape, I'd suggest 
using a prism object (with a linear spline) instead of a bunch of boxes 
and box-cutouts, and finally just add/subtract the cylinders. Or, 
depending on your requirements, you may even be able to get away without 
the cylinders by just approximating the curves with a number of straight 
line segments - in that case you only need the prism object.

Alternatively, you might try taming one of the other spline-types to 
make the whole rounded-off profile out of a single prism.


Post a reply to this message

From: Mr
Subject: Re: How to get a rounding between two boxes
Date: 28 Mar 2010 14:50:01
Message: <web.4bafa346a8b62576a5fdf7ff0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Mr <nomail@nomail> wrote:
> > The documentation refers to the "merge" keyword for CSG operations could it do
> > what you want?
>
>   Would it be a big trouble to actually read the documentation in question
> before suggesting it?
>
> --
>                                                           - Warp

Yes sorry, the vague picture I had in mind was actually of something different
altogether: the Blob_threshold example for combining isosurfaces in this page:

http://www.povray.org/documentation/view/3.6.1/73/


Post a reply to this message

From: Harry H  Arends
Subject: Re: How to get a rounding between two boxes
Date: 29 Mar 2010 15:00:49
Message: <4bb0f8e1@news.povray.org>
Thanks for the suggestions but that's to complicated for me.
I am a novice and still trying things out.
"clipka" <ano### [at] anonymousorg> schreef in bericht 
news:4ba69eaf@news.povray.org...
> gharryh schrieb:
>> For a test i am constructing a inc that contains some profiles.
>> Now i want to create a rounding between two boxes to visualize a smooth
>> transition between these two surfaces.
>
> For rounded concave edges, you'll need to add another box with square 
> cross-section in that corner, then cut away from it using "difference" 
> with a cylinder (make sure it's a bit longer than the beam, so you don't 
> get a "coincident surfaces" problem at the ends).
>
> For rounde convex edges, you'll need to subtract a box from the corner 
> (again make sure it's a bit longer than the beam), then fill it up with a 
> cylinder.
>
> As this will quickly increase the complexity of the shape, I'd suggest 
> using a prism object (with a linear spline) instead of a bunch of boxes 
> and box-cutouts, and finally just add/subtract the cylinders. Or, 
> depending on your requirements, you may even be able to get away without 
> the cylinders by just approximating the curves with a number of straight 
> line segments - in that case you only need the prism object.
>
> Alternatively, you might try taming one of the other spline-types to make 
> the whole rounded-off profile out of a single prism.


Post a reply to this message

From: Stephen
Subject: Re: How to get a rounding between two boxes
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.