POV-Ray : Newsgroups : povray.bugreports : Part of the body disappear. Server Time
31 Oct 2024 06:14:36 EDT (-0400)
  Part of the body disappear. (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: akopjan
Subject: Part of the body disappear.
Date: 7 Dec 2016 12:40:01
Message: <web.584848193570d4917858c2f90@news.povray.org>
When I make an intersection some parts of a body unexpectedly disappear.
The version is MacOS:
POV-Ray 3.7.0.unofficial

Could you please help me?

The code is

#include "colors.inc"
#include "textures.inc"
#include "metals.inc"

light_source {<7, -2, 6>*3.2
color White}
camera {orthographic
  location <7, 5, 10>/4
  look_at (<0,0,1>)/2
  sky <0,0,1>
}

#declare c2 = texture {pigment {color Green}}
#declare c4 = texture{Silver_Metal finish { diffuse 0.8 phong 3 }}


#declare k= 1.4;
#declare a=sqrt(3*k*k-1)/2;
#declare b=sqrt(k*k+1)/2;
#declare c=1;



#declare slp= isosurface{
    function{
     max(
      min(
       x*a+y*b+z*c-a,
       x*a-y*b+z*c-a
      ),
      x*x+y*y-z
     )
    }
    max_gradient 5
    contained_by{box{-4, 4}}
   }

#declare M=4;
intersection{
 #declare i=0;
 #while (i<M)
  object{slp rotate <0,0,i*360/M> texture{c4} }
  #declare i=i+1;
 #end
 no_reflection no_shadow
}


Post a reply to this message

From: Bald Eagle
Subject: Re: Part of the body disappear.
Date: 7 Dec 2016 13:00:01
Message: <web.58484df08014ea83c437ac910@news.povray.org>
Look in the message window output.   There's probably a message about the
max_gradient.

Increase it until you stop getting a message.
That ought to make the whole isosurface visible.

Also make sure that your contained_by box is large enough to fit the entire
isosurface.


Post a reply to this message

From: akopjan
Subject: Re: Part of the body disappear.
Date: 7 Dec 2016 14:05:00
Message: <web.58485d058014ea837858c2f90@news.povray.org>
No gradient warnings. And its changing does not help.

Here is another example of a strange thing. The upper part should be Jade but it
is partly red.


#include "colors.inc"
#include "textures.inc"
#include "metals.inc"

light_source {<9, 4, 4>*3.2 color White}
camera {orthographic
  location <9, 5, 4>/5
  look_at (<0,0,1>)/2
  sky <0,0,1>
}

#declare c1 = texture {pigment {color Red}}
#declare c2 = texture {pigment {color Green}}
#declare c3 = texture {pigment {color Gray}}
#declare c4 = texture{Jade finish { diffuse 0.8 phong 3 }}

#declare k= 0.8;//(sqrt((1+T)/(3-T)));

#declare a=sqrt(3*k*k-1)/2;
#declare b=sqrt(k*k+1)/2;
#declare c=1;

#declare disk= cylinder{<0,0,0>, <0, 0, 3>, 0.8}


#declare slp= isosurface{
    function{
     min(
      x*a+y*b+z*c-a,
      x*a-y*b+z*c-a
     )
    }
    max_gradient 4
//    contained_by{box{-3, 3}}
    contained_by{sphere{0, 3}}
   }



intersection{
 object{slp rotate <0,0,84> texture{c4} no_shadow}
 object{disk texture{c1} no_reflection no_shadow}
 }


Post a reply to this message

From: clipka
Subject: Re: Part of the body disappear.
Date: 7 Dec 2016 14:50:14
Message: <584867f6@news.povray.org>
Am 07.12.2016 um 18:35 schrieb akopjan:
> When I make an intersection some parts of a body unexpectedly disappear.

Isosurfaces are a bit tricky in CSG operations.

When computing non-union CSGs, POV-Ray first queries each participating
object for all the intersections between the given ray and its surface.
In a second step, it examines these intersections one by one, starting
from the nearest, and queries the other participating objects whether
they contain that particular intersection point, until it finds one that
fits the bill.

For most primitives, querying all intersections is no more costly than
querying the nearest one (because most would have to compute all
intersections anyway, and then compare which one is closest), so there
is currently no distinctive function for the latter. However, in case of
isosurfaces it is far faster to query just the nearest intersection, so
for the sake of speed in non-CSG or union CSG scenarios, isosurfaces
will by default only report the closest intersection.

This means that in a non-union CSG scenario, if the first intersection
is discarded, the isosurface will seem to have disappeared entirely.

You can control how many intersections an isosurface will report by
setting the `max_trace` parameter, or by specifying `all_intersections`
to set the parameter to the maximum internally supported value.


Post a reply to this message

From: William F Pokorny
Subject: Re: Part of the body disappear.
Date: 7 Dec 2016 14:50:14
Message: <584867f6$2@news.povray.org>
On 12/07/2016 12:35 PM, akopjan wrote:
> When I make an intersection some parts of a body unexpectedly disappear.
> The version is MacOS:
> POV-Ray 3.7.0.unofficial
>
> Could you please help me?
>
>
Hi,

Add 'all_intersections' to your isosurface definition.

The ray tracing code, by default, stops on the first isosurface-surface.

There is too 'max_trace <n>' which lets you set the number of surfaces 
to find when you know how many surfaces you'll need.

Bill P.


Post a reply to this message

From: clipka
Subject: Re: Part of the body disappear.
Date: 7 Dec 2016 14:58:29
Message: <584869e5$1@news.povray.org>
Am 07.12.2016 um 20:50 schrieb William F Pokorny:
> On 12/07/2016 12:35 PM, akopjan wrote:
>> When I make an intersection some parts of a body unexpectedly disappear.
>> The version is MacOS:
>> POV-Ray 3.7.0.unofficial
>>
>> Could you please help me?
>>
>>
> Hi,
> 
> Add 'all_intersections' to your isosurface definition.
> 
> The ray tracing code, by default, stops on the first isosurface-surface.
> 
> There is too 'max_trace <n>' which lets you set the number of surfaces
> to find when you know how many surfaces you'll need.

(Just for the records, strictly speaking `all_intersections` just sets
the `max_trace` parameter to the maximum supported value, which is
currently 10.)


Post a reply to this message

From: William F Pokorny
Subject: Re: Part of the body disappear.
Date: 7 Dec 2016 15:26:34
Message: <5848707a$1@news.povray.org>
On 12/07/2016 02:57 PM, clipka wrote:
> Am 07.12.2016 um 20:50 schrieb William F Pokorny:
>> On 12/07/2016 12:35 PM, akopjan wrote:
>> Hi,
>>
>> Add 'all_intersections' to your isosurface definition.
>>
>> The ray tracing code, by default, stops on the first isosurface-surface.
>>
>> There is too 'max_trace <n>' which lets you set the number of surfaces
>> to find when you know how many surfaces you'll need.
>
> (Just for the records, strictly speaking `all_intersections` just sets
> the `max_trace` parameter to the maximum supported value, which is
> currently 10.)
>
Thanks. I'd always taken the documentation to be correct!

Suppose we should update the wiki:

http://wiki.povray.org/content/Reference:Isosurface

near the bottom of the page.

Jim, Are you listening?

Bill P.


Post a reply to this message

From: clipka
Subject: Re: Part of the body disappear.
Date: 7 Dec 2016 15:45:20
Message: <584874e0$1@news.povray.org>
Am 07.12.2016 um 21:26 schrieb William F Pokorny:
> On 12/07/2016 02:57 PM, clipka wrote:
>> Am 07.12.2016 um 20:50 schrieb William F Pokorny:
>>> On 12/07/2016 12:35 PM, akopjan wrote:
>>> Hi,
>>>
>>> Add 'all_intersections' to your isosurface definition.
>>>
>>> The ray tracing code, by default, stops on the first isosurface-surface.
>>>
>>> There is too 'max_trace <n>' which lets you set the number of surfaces
>>> to find when you know how many surfaces you'll need.
>>
>> (Just for the records, strictly speaking `all_intersections` just sets
>> the `max_trace` parameter to the maximum supported value, which is
>> currently 10.)
>>
> Thanks. I'd always taken the documentation to be correct!
> 
> Suppose we should update the wiki:
> 
> http://wiki.povray.org/content/Reference:Isosurface
> 
> near the bottom of the page.
> 
> Jim, Are you listening?

For the records, I would prefer to _not_ document it as
`all_intersections` being an alias for `max_trace 10`, but rather leave
the general wording as is, and instead add a note that the current
implementation still has a limit of 10 intersections in all cases.

Because I have a cunning plan. There must be a way to teach POV-Ray to
automatically re-visit an isosurface if it discards an isosurface
intersection, and we could use `all_intersections` as a keyword to
enable that behaviour.


Post a reply to this message

From: akopjan
Subject: Re: Part of the body disappear.
Date: 7 Dec 2016 16:00:00
Message: <web.584878008014ea832bc97f0d0@news.povray.org>
Thank you for help!

Everything works fine now!


Post a reply to this message

From: Jim Holsenback
Subject: Re: Part of the body disappear.
Date: 8 Dec 2016 10:34:32
Message: <58497d88$1@news.povray.org>
On 12/7/2016 3:26 PM, William F Pokorny wrote:
> Jim, Are you listening?

lol


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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