POV-Ray : Newsgroups : povray.binaries.images : Behavior of bounded_by Server Time
28 Mar 2024 14:28:16 EDT (-0400)
  Behavior of bounded_by (Message 1 to 6 of 6)  
From: m@b
Subject: Behavior of bounded_by
Date: 18 Apr 2022 07:01:17
Message: <625d44fd@news.povray.org>
HI,

I made this leaf spring using segments of a rounded tube.

It looks fine when viewed straight-on but assumes a funny angle at the 
ends when viewed from the side.

What is going on?

difference{
     union{
             // tube radius outside - inner radius - border radius - 
hight - 0 = union, 1 = merge
             object{ Rounded_Tube(351.5,350.0,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-55,-500,-1>,<55,500,20>}}}
             object{ Rounded_Tube(353.0,351.5,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-53,-500,-1>,<53,500,20>}}}
             object{ Rounded_Tube(354.5,353.0,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-47,-500,-1>,<47,500,20>}}}  // 94
             object{ Rounded_Tube(356.0,354.5,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-42,-500,-1>,<42,500,20>}}}  // 84 ////
             object{ Rounded_Tube(357.5,356.0,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-36,-500,-1>,<36,500,20>}}}  // 72
             object{ Rounded_Tube(359.0,357.5,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-30,-500,-1>,<30,500,20>}}}  // 60
             object{ Rounded_Tube(360.5,359.0,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-24,-500,-1>,<24,500,20>}}}  // 48
             object{ Rounded_Tube(362.0,360.5,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-16,-500,-1>,<16,500,20>}}}  // 36 
////
             object{ Rounded_Tube(363.5,362.0,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-12,-500,-1>,<12,500,20>}}}  // 24
             object{ Rounded_Tube(365.0,363.5,0.5,18,0) rotate<90,0,0> 
translate<0,343.2,0> bounded_by{box{<-06,-500,-1>,<06,500,20>}}}  // 12
             cylinder{<-55,0,-1>,<-55,0,19>,3.75}
             cylinder{< 55,0,-1>,< 55,0,19>,3.75}
         }
         cylinder{<-55,0,-2>,<-55,0,20>,2.25}
         cylinder{< 55,0,-2>,< 55,0,20>,2.25}
}


Post a reply to this message


Attachments:
Download 'a.png' (49 KB) Download 'b.png' (39 KB)

Preview of image 'a.png'
a.png

Preview of image 'b.png'
b.png


 

From: William F Pokorny
Subject: Re: Behavior of bounded_by
Date: 18 Apr 2022 09:59:20
Message: <625d6eb8$1@news.povray.org>
On 4/18/22 07:01, m@b wrote:
> I made this leaf spring using segments of a rounded tube.
> 
> It looks fine when viewed straight-on but assumes a funny angle at the 
> ends when viewed from the side.
> 
> What is going on?

I've not tested it, but try adding:

clipped_by { bounded_by }

after each bounded_by{} statement.

Or, as Cousin Ricky recently suggested, in place of manual bounding 
create each spring leaf as an intersection of a 'bounding box' with each 
rounded tube.

---
Bounding - whether added manually or automatically - is only used to 
determine whether the real 'ray -> shape/surface' intersection code for 
the basic shape is run(a). In other words, ray -> surface intersections 
'can be' outside the bounding.

Bill P.

(a) - Yes, with manual bounding you can intentionally set up visual 
effects depending on how rays interact with the bounded_by shape(s). For 
example, the bounded_by shape(s) need not surround the actual 
shape/surface at all(b).

(b) - In official releases, manually playing with bounding is limited as 
there is code which prevents users from making bounding smaller by 
volume... In the povr fork that code is completely gone - IIRC. I think 
it wrong for POV-Ray to secretly ignore user bounding (some auto 
bounding too IIRC) based on a 'bounding volume can never be smaller than 
what already exists' test. Yes, users might screw things up more often - 
let 'em.


Post a reply to this message

From: Alain Martel
Subject: Re: Behavior of bounded_by
Date: 18 Apr 2022 11:07:16
Message: <625d7ea4$1@news.povray.org>
Le 2022-04-18 à 07:01, m@b a écrit :
> HI,
> 
> I made this leaf spring using segments of a rounded tube.
> 
> It looks fine when viewed straight-on but assumes a funny angle at the 
> ends when viewed from the side.
> 
> What is going on?
> 

You are incorrectly using bounded_by as an alternative for an intersection.
ANY ray that hit the bounded_by shape will cause the bounded_by object 
to be evaluated, even if that part is actually outside the bounded_by 
object. Even if that part is in front of the bounded_by shape.

Instead, you should use an intersection or add clipped_by{bounded_by}

The first will close the object. You see the surface of the intersecting 
object.
The second will leave the ends open. Adding an interior_texture will 
make it obvious.


Post a reply to this message

From: m@b
Subject: Re: Behavior of bounded_by
Date: 18 Apr 2022 21:26:25
Message: <625e0fc1$1@news.povray.org>
On 18/04/2022 11:07 pm, Alain Martel wrote:
> Le 2022-04-18 à 07:01, m@b a écrit :
>> HI,
>>
>> I made this leaf spring using segments of a rounded tube.
>>
>> It looks fine when viewed straight-on but assumes a funny angle at the 
>> ends when viewed from the side.
>>
>> What is going on?
>>
> 
> You are incorrectly using bounded_by as an alternative for an intersection.
> ANY ray that hit the bounded_by shape will cause the bounded_by object 
> to be evaluated, even if that part is actually outside the bounded_by 
> object. Even if that part is in front of the bounded_by shape.
> 
> Instead, you should use an intersection or add clipped_by{bounded_by}
> 
> The first will close the object. You see the surface of the intersecting 
> object.
> The second will leave the ends open. Adding an interior_texture will 
> make it obvious.


Thanks Alain and Bill P - intersection fixed it :-)

m@


Post a reply to this message

From: Kenneth
Subject: Re: Behavior of bounded_by
Date: 18 Apr 2022 22:45:00
Message: <web.625e20f16202874b4cef624e6e066e29@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:

>
> You are incorrectly using bounded_by as an alternative for an intersection.
> ANY ray that hit the bounded_by shape will cause the bounded_by object
> to be evaluated, even if that part is actually outside the bounded_by
> object. Even if that part is in front of the bounded_by shape.
>

I use the 'intersection' method too-- usually with a box object. A generally
trusty method starts with getting the min_extent/max_extent of the final object,
then using those vector positions for the two box corners. (Before doing this, I
center the object on the origin, more or less-- then I can multiply the
found min_extent/max_extent vectors by, for example, 1.1, which expands the box
object slightly-- just to be safe.)

I guess an alternate method would be to do this to each individual part(?) of a
CSG object like yours; but in practice, I have never needed to do that.

I rarely if ever use bounded_by shapes anymore, for the reasons that Alain and
William P mentioned. I never know if or when they will be automatically removed,
defeating their purpose.

POV-ray's automatic bounding of objects seems to do well enough in most cases,
so I only use this box intersection trick when it seems absolutely necessary. Or
to 'close up' a triangle-mesh object that is not a totally closed mesh due to
mistakes in the mesh-making. (The same trick can be used to 'solidify'
height_fields.)


Post a reply to this message

From: Alain Martel
Subject: Re: Behavior of bounded_by
Date: 19 Apr 2022 12:28:59
Message: <625ee34b$1@news.povray.org>
Le 2022-04-18 à 22:40, Kenneth a écrit :
> Alain Martel <kua### [at] videotronca> wrote:
> 
>>
>> You are incorrectly using bounded_by as an alternative for an intersection.
>> ANY ray that hit the bounded_by shape will cause the bounded_by object
>> to be evaluated, even if that part is actually outside the bounded_by
>> object. Even if that part is in front of the bounded_by shape.
>>
> 
> I use the 'intersection' method too-- usually with a box object. A generally
> trusty method starts with getting the min_extent/max_extent of the final object,
> then using those vector positions for the two box corners. (Before doing this, I
> center the object on the origin, more or less-- then I can multiply the
> found min_extent/max_extent vectors by, for example, 1.1, which expands the box
> object slightly-- just to be safe.)
> 
> I guess an alternate method would be to do this to each individual part(?) of a
> CSG object like yours; but in practice, I have never needed to do that.
> 
> I rarely if ever use bounded_by shapes anymore, for the reasons that Alain and
> William P mentioned. I never know if or when they will be automatically removed,
> defeating their purpose.
> 
> POV-ray's automatic bounding of objects seems to do well enough in most cases,
> so I only use this box intersection trick when it seems absolutely necessary. Or
> to 'close up' a triangle-mesh object that is not a totally closed mesh due to
> mistakes in the mesh-making. (The same trick can be used to 'solidify'
> height_fields.)
> 

The bounded_by attribute was introduced when the automatic bounding was 
not yet implemented or in it's very early stage and unreliable.

Another side effect of using bounded_by is that any union bounded that 
way is treated as a merge, but, without removing the internal surfaces.

Do this test :
Have a scene containing 10000 objects in an union. Render it and take a 
look at the objects count. It's 10000.

Now, render that scene again, BUT, add a bounded_by shape that enclose 
the union and look at the objects count. The count is now 1.
The render will also be longer as the union is no longer split into it's 
individual components.


Post a reply to this message

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