POV-Ray : Newsgroups : povray.bugreports : Slice of apple pie : Re: Slice of apple pie Server Time
8 Nov 2024 23:01:50 EST (-0500)
  Re: Slice of apple pie  
From: kurtz le pirate
Date: 15 Apr 2023 03:00:27
Message: <643a4b8b@news.povray.org>
On 13/04/2023 13:50, William F Pokorny wrote:
> On 4/11/23 06:40, Bald Eagle wrote:
>>> I believe what your are seeing is the fact the disc, like the plane, is
>>> defined in the code as having and inside (as being a 'basic object'
>>> rather than a 'patch object') so it can be used in CSG.
> 
>> That's certainly what it looks like to me.   That slice is HUGE.
> 
> Thanks for the confirmation.
> 
> I spent a little time this morning looking at the code and playing. It 
> turns out the disc is auto bounded using the radius & other info - as it 
> can. Where flat relative to the x,z plane the box y min and max values 
> are set to the initial vector, y value. x and z to the +-r, +-r values. 
> The automatic bounding box has is infinitely thin and it is rays hitting 
> this box determine when we look for ray -> surface intersections.
> 
> The bounding determination, where things are not simple in being at the 
> origin and axis aligned, is more complicated.
> 
> An alternative to clipping the ray-surface intersections internal to a 
> shape, would be to use two opposing discs with a very small space 
> between them (tiny inside sliver region) like this:
> 
> #declare DiscOrigin = <0,0,0>;
> #declare DiscNormal = <0,1,-1>;
> #declare I01 = intersection {
>      Wedge(275)
>      disc  {
>          DiscOrigin+(+1e-8*DiscNormal),
>          +1*DiscNormal, 1, 0.5 }
>      disc  {
>          DiscOrigin+(-1e-8*DiscNormal),
>          -1*DiscNormal, 1, 0.5 }
>      pigment { color Green }
> }
> 
> This, as a generic approach, is likely more stable numerically as any 
> 'edge noise' has to happen between the to opposing discs. Remembering 
> here too discs can have holes.
> 
> Bill P.
> 



Thank Bill for all these explanations. But as I said, using the cylinder
instead of the disc does the job perfectly.

@Bald Eagles : shapes.inc contains some interesting macros.
I'm surprised you don't know ;)







-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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