POV-Ray : Newsgroups : povray.newusers : Round box edge Server Time
25 Dec 2024 01:08:17 EST (-0500)
  Round box edge (Message 1 to 10 of 10)  
From: Arlon Meisner
Subject: Round box edge
Date: 9 Dec 2002 17:30:06
Message: <web.3df51889472923f770499b5a0@news.povray.org>
I want to round over an edge of a box. I have tried the "Round_Box_* " macro
but it rounds all edges. The z box-edge length is less then x and y. The z
box-edges are those that I want rounded to a given radius.

I appreciate any help you can give.
Thanks.


Post a reply to this message

From: TinCanMan
Subject: Re: Round box edge
Date: 9 Dec 2002 18:40:55
Message: <3df52a07$1@news.povray.org>
"Christopher James Huff" <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
> In article <web.3df51889472923f770499b5a0@news.povray.org>,
>  "Arlon Meisner" <ame### [at] comcastnet> wrote:
>
> > I want to round over an edge of a box. I have tried the "Round_Box_* "
macro
> > but it rounds all edges. The z box-edge length is less then x and y. The
z
> > box-edges are those that I want rounded to a given radius.
>
> Do it the same way the macros do it, with CSG. If you only want the
> edges along the z axis rounded, a union of 2 boxes and 4 cylinders
> should be sufficient.

+two planes differenced if you want true smooth surfaces and no coincidient
surfaces.

-tgq


Post a reply to this message

From: Christopher James Huff
Subject: Re: Round box edge
Date: 9 Dec 2002 19:10:21
Message: <chrishuff-115A21.19070509122002@netplex.aussie.org>
In article <3df52a07$1@news.povray.org>,
 "TinCanMan" <Tin### [at] hotmailcom> wrote:

> +two planes differenced if you want true smooth surfaces and no coincidient
> surfaces.

I don't think the coincident surfaces are a problem here...though one 
surface will sometimes be hit before the other, they both have the same 
normal and texture, it shouldn't be a problem. (at least, I've never had 
a problem with this situation)

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: TinCanMan
Subject: Re: Round box edge
Date: 9 Dec 2002 20:20:21
Message: <3df54155@news.povray.org>
"Christopher James Huff" <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
> In article <3df52a07$1@news.povray.org>,
>  "TinCanMan" <Tin### [at] hotmailcom> wrote:
>
> > +two planes differenced if you want true smooth surfaces and no
coincidient
> > surfaces.
>
> I don't think the coincident surfaces are a problem here...though one
> surface will sometimes be hit before the other, they both have the same
> normal and texture, it shouldn't be a problem. (at least, I've never had
> a problem with this situation)

I suppose you are right here, but you run into problems if you want to
difference this shape from another one for whatever reason.  I just always
avoid coincident surfaces as a rule just to be safe.

-tgq


Post a reply to this message

From: Arlon Meisner
Subject: Re: Round box edge
Date: 9 Dec 2002 21:40:03
Message: <web.3df553866a56a85570499b5a0@news.povray.org>
Christopher James Huff wrote:
>In article <web.3df51889472923f770499b5a0[at]news.povray.org>,
> "Arlon Meisner" <ame### [at] comcastnet> wrote:
>
>> I want to round over an edge of a box. I have tried the "Round_Box_* " macro
>> but it rounds all edges. The z box-edge length is less then x and y. The z
>> box-edges are those that I want rounded to a given radius.
>
>Do it the same way the macros do it, with CSG. If you only want the
>edges along the z axis rounded, a union of 2 boxes and 4 cylinders
>should be sufficient.

I don't understand how a union of these objects will remove the sharp corner
that lies along the z axis. It seems to me that a union will simply result
in two (why two?) boxes with 4 cylinders (lying along the z axis) simply
buried in the boxes. An explanation would certainly help this newbie.
Thanks.


Post a reply to this message

From: TinCanMan
Subject: Re: Round box edge
Date: 9 Dec 2002 21:42:48
Message: <3df554a8$1@news.povray.org>
> I don't understand how a union of these objects will remove the sharp
corner
> that lies along the z axis. It seems to me that a union will simply result
> in two (why two?) boxes with 4 cylinders (lying along the z axis) simply
> buried in the boxes. An explanation would certainly help this newbie.
> Thanks.

Try this:

  union{
    box{<-2,0,-1> <2,1,1>}
    box{<-1,0,-2> <1,1,2>}
    cylinder{0 y 1 translate <1,0,1>}
    cylinder{0 y 1 translate <1,0,-1>}
    cylinder{0 y 1 translate <-1,0,1>}
    cylinder{0 y 1 translate <-1,0,-1>}
  }


Post a reply to this message

From: Christopher James Huff
Subject: Re: Round box edge
Date: 9 Dec 2002 22:52:36
Message: <chrishuff-CD5C78.22491709122002@netplex.aussie.org>
In article <web.3df553866a56a85570499b5a0@news.povray.org>,
 "Arlon Meisner" <ame### [at] comcastnet> wrote:

> I don't understand how a union of these objects will remove the sharp corner
> that lies along the z axis. It seems to me that a union will simply result
> in two (why two?) boxes with 4 cylinders (lying along the z axis) simply
> buried in the boxes. An explanation would certainly help this newbie.

Two boxes arranged to make a cross shape, with the cylinders filling in 
the gaps in the corners:
    ___
 __|___|__
|  |   |  |
|__|___|__|
   |___|

Only 3/4 of each cylinder overlaps with the boxes. The macros do a 
similar thing, using 3 boxes to make a 3D cross.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Arlon Meisner
Subject: Re: Round box edge
Date: 10 Dec 2002 08:30:04
Message: <web.3df5ec086a56a85570499b5a0@news.povray.org>
TinCanMan wrote:
>> I don't understand how a union of these objects will remove the sharp
>corner
>> that lies along the z axis. It seems to me that a union will simply result
>> in two (why two?) boxes with 4 cylinders (lying along the z axis) simply
>> buried in the boxes. An explanation would certainly help this newbie.
>> Thanks.
>
>Try this:
>
>  union{
>    box{<-2,0,-1> <2,1,1>}
>    box{<-1,0,-2> <1,1,2>}
>    cylinder{0 y 1 translate <1,0,1>}
>    cylinder{0 y 1 translate <1,0,-1>}
>    cylinder{0 y 1 translate <-1,0,1>}
>    cylinder{0 y 1 translate <-1,0,-1>}
>  }
>
Thanks all! It sure is obvious when one sees the solution! (smack on
forehead!!!).


Post a reply to this message

From: Lenx
Subject: Re: Round box edge
Date: 11 Dec 2002 09:15:05
Message: <web.3df747ce6a56a855de2a6cfb0@news.povray.org>
TinCanMan wrote:
>"Christopher James Huff" <chr### [at] maccom> wrote in message
>news:chr### [at] netplexaussieorg...
>> In article <web.3df51889472923f770499b5a0[at]news.povray.org>,
>>  "Arlon Meisner" <ame### [at] comcastnet> wrote:
>>
>> > I want to round over an edge of a box. I have tried the "Round_Box_* "
>macro
>> > but it rounds all edges. The z box-edge length is less then x and y. The
>z
>> > box-edges are those that I want rounded to a given radius.
>>
>> Do it the same way the macros do it, with CSG. If you only want the
>> edges along the z axis rounded, a union of 2 boxes and 4 cylinders
>> should be sufficient.
>
>+two planes differenced if you want true smooth surfaces and no coincidient
>surfaces.
>
>-tgq
>

i don't understand what coincidient surfaces are... what can be a problem if
you don't difference two planes?
i guess it's about pov who don't know what surface to take while rendering.
the surface from box1 or box2. am i right?


Post a reply to this message

From: TinCanMan
Subject: Re: Round box edge
Date: 11 Dec 2002 10:52:21
Message: <3df75f35$1@news.povray.org>
> i don't understand what coincidient surfaces are... what can be a problem
if
> you don't difference two planes?
> i guess it's about pov who don't know what surface to take while
rendering.
> the surface from box1 or box2. am i right?
>

Yes, if two surfaces ocupy the exact same plane, POV does not know which
surface to render first and often the result is a speckled unwanted result.


In the following code, the object subtracted on the right shows the
coincident surface problem, the object subtracted on the left is the
equivilant object with coincident surfaces removed. Hope this helps.

-tgq

--8<--

camera{
  up y
  right x*image_width/image_height
  angle 45
  location <0,10,-10>
  look_at  0
}

light_source{0 rgb 1 translate y*10}

background {rgb 0.5}


#declare CoincidentSurface=
union{
  box{<-2,0,-1> <2,1,1>}
  box{<-1,0,-2> <1,1,2>}
  cylinder{0 y 1 translate <1,0,1>}
  cylinder{0 y 1 translate <1,0,-1>}
  cylinder{0 y 1 translate <-1,0,1>}
  cylinder{0 y 1 translate <-1,0,-1>}
}

#declare NoCoincidentSurface=
difference{
  union{
    box{<-2,-1,-1> <2,2,1>}
    box{<-1,-1,-2> <1,2,2>}
    cylinder{<0,-1,0> <0,2,0> 1 translate <1,0,1>}
    cylinder{<0,-1,0> <0,2,0> 1 translate <1,0,-1>}
    cylinder{<0,-1,0> <0,2,0> 1 translate <-1,0,1>}
    cylinder{<0,-1,0> <0,2,0> 1 translate <-1,0,-1>}
  }
  plane{y, 0}
  plane{-y, -1}
}

difference{
  box{<-6,-1,-3><6,0.9,3>pigment{rgb <1,0,0>}}
  object{CoincidentSurface translate <3,0,0>}
  object{NoCoincidentSurface translate <-3,0,0>}
  pigment{rgb <1,0,0>}
}

--8<--


Post a reply to this message

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