POV-Ray : Newsgroups : povray.advanced-users : sphere_sweep artifacts Server Time
26 Dec 2024 15:32:22 EST (-0500)
  sphere_sweep artifacts (Message 1 to 6 of 6)  
From: Qfyd
Subject: sphere_sweep artifacts
Date: 19 Jan 2005 08:00:57
Message: <41ee5a09@news.povray.org>
I'm currently trying to get a sphere sweep approximation of my 
signiature and for some reason the object produced is full of tiny holes.

I've looked at all the info about self-shadowing and tolerance but no 
matter how I set the tolerance, the sweep looks like it's 
disintegrating. Besides, this isn't self shadowing as far as I can tell, 
the missing parts aren't just dark, they're transparent.


//This is the code I'm working with
global_settings{assumed_gamma 1.2}
camera {orthographic location<0,0,-5> look_at<0,0,0>}

light_source{<0,0,-30> color rgb 2}

sphere_sweep {
  b_spline
  10
  <-1.5,1,0>,0.03
  <0,1,0>,0.03
  <1,1,0>,0.03
  <1.4,1.2,0>,0.03
  <1.2,1.4,0>,0.03
  <1,1.2,0>,0.03
  <1,-1,0>,0.03
  <1.03,-1.03,0>,0.03
  <1.06,0,0>,0.03
  <2,0,0>,0.03
  //tolerance 1.0e-6
  pigment{color rgb <1,0,0>}
  finish{phong 1}
  translate<-2,0,0>
}
//end code fragment

Any ideas?

-Pete


Post a reply to this message

From: Chris B
Subject: Re: sphere_sweep artifacts
Date: 19 Jan 2005 13:57:36
Message: <41eeada0$1@news.povray.org>
"Qfyd" <Qfy### [at] dcommsnet> wrote in message news:41ee5a09@news.povray.org...
> I'm currently trying to get a sphere sweep approximation of my
> signiature and for some reason the object produced is full of tiny holes.
>
> I've looked at all the info about self-shadowing and tolerance but no
> matter how I set the tolerance, the sweep looks like it's
> disintegrating. Besides, this isn't self shadowing as far as I can tell,
> the missing parts aren't just dark, they're transparent.
>
>
> //This is the code I'm working with
> global_settings{assumed_gamma 1.2}
> camera {orthographic location<0,0,-5> look_at<0,0,0>}
>
> light_source{<0,0,-30> color rgb 2}
>
> sphere_sweep {
>   b_spline
>   10
>   <-1.5,1,0>,0.03
>   <0,1,0>,0.03
>   <1,1,0>,0.03
>   <1.4,1.2,0>,0.03
>   <1.2,1.4,0>,0.03
>   <1,1.2,0>,0.03
>   <1,-1,0>,0.03
>   <1.03,-1.03,0>,0.03
>   <1.06,0,0>,0.03
>   <2,0,0>,0.03
>   //tolerance 1.0e-6
>   pigment{color rgb <1,0,0>}
>   finish{phong 1}
>   translate<-2,0,0>
> }
> //end code fragment
>
> Any ideas?
>
> -Pete

I rendered as-is (on POVRay 3.5) and got the holes exactly as you describe.
Changing the tolerance had no effect.

I rendered without the 'orthographic' keyword on the camera and it looks
fine.
Not sure why!

Regards, Chris.


Post a reply to this message

From: Slime
Subject: Re: sphere_sweep artifacts
Date: 19 Jan 2005 14:20:15
Message: <41eeb2ef$1@news.povray.org>
> I've looked at all the info about self-shadowing and tolerance but no
> matter how I set the tolerance, the sweep looks like it's
> disintegrating. Besides, this isn't self shadowing as far as I can tell,
> the missing parts aren't just dark, they're transparent.

Yeah, after looking into this a little and fiddling with the code I'm not
sure what's going wrong. I managed to get this, which also shows the
artifacts (and you're right that it's not just self-shadowing):

camera {orthographic location<0,0,-2> look_at<0,0,0>}
light_source{<0,0,-30> rgb 2}

sphere_sweep {
  b_spline
  4
  <-1.5,0,0>,0.03
  0,0.03
  <1,0,0>,0.03
  <1.4,.2,0>,0.03
  pigment{rgb 1}
}

But if you change the second sphere_sweep point from "0" to "1e-3", most of
the artifacts go away. I also managed to make the artifacts disappear on the
first half of your example by adding 1e-3 to your second control point. So
maybe this is some strange precision error that only occurs with certain
control point positions?

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Alain
Subject: Re: sphere_sweep artifacts
Date: 19 Jan 2005 22:01:27
Message: <41ef1f07$1@news.povray.org>
Qfyd nous apporta ses lumieres en ce 2005-01-19 08:00:
> I'm currently trying to get a sphere sweep approximation of my 
> signiature and for some reason the object produced is full of tiny holes.
> 
> I've looked at all the info about self-shadowing and tolerance but no 
> matter how I set the tolerance, the sweep looks like it's 
> disintegrating. Besides, this isn't self shadowing as far as I can tell, 
> the missing parts aren't just dark, they're transparent.
> 
> 
> //This is the code I'm working with
> global_settings{assumed_gamma 1.2}
> camera {orthographic location<0,0,-5> look_at<0,0,0>}
> 
> light_source{<0,0,-30> color rgb 2}
> 
> sphere_sweep {
>  b_spline
>  10
>  <-1.5,1,0>,0.03
>  <0,1,0>,0.03
>  <1,1,0>,0.03
>  <1.4,1.2,0>,0.03
>  <1.2,1.4,0>,0.03
>  <1,1.2,0>,0.03
>  <1,-1,0>,0.03
>  <1.03,-1.03,0>,0.03
>  <1.06,0,0>,0.03
>  <2,0,0>,0.03
>  //tolerance 1.0e-6
>  pigment{color rgb <1,0,0>}
>  finish{phong 1}
>  translate<-2,0,0>
> }
> //end code fragment
> 
> Any ideas?
> 
> -Pete
It hit me also on another image. It was a sweep thru a bunch of random 3D coordinates.
A rotate 1 get rid of all artefacts. Changing the tolerance _may_ reduce them, but
don't remove 
them. Even a tolerance set to 5 did nothing.
It looks like it depend on the curvature (maybe) and the angle at whitch the ray from
the camera 
meet the sphere_sweep.
It looks like a bug to me.

Alain


Post a reply to this message

From: Qfyd
Subject: Re: sphere_sweep artifacts
Date: 20 Jan 2005 07:21:38
Message: <41efa252@news.povray.org>
> But if you change the second sphere_sweep point from "0" to "1e-3", most of
> the artifacts go away. I also managed to make the artifacts disappear on the
> first half of your example by adding 1e-3 to your second control point. So
> maybe this is some strange precision error that only occurs with certain
> control point positions?

While I was waiting for answers I continued doing the rest of the 
signiature, and I adjusted the z coords of the points that crossed over 
and was amazed to see that some of the holes disappeared.
So then I started sightly shifting thedodgy points on the Z axis. Being 
an orthographic camera you could hardly see the difference but the maths 
obviously could because I mannaged to make it come out fine.

The question is, (and this is the REALLY advanced part) if this is a 
precision problem, what part of the sphere_sweep equation is causing it, 
and is there someway to check the points for artifact causing values 
before you render it?

The final version:

#declare lq=3;

light_source { <30,40,-20> color rgb 1 area_light 
<10,0,0>,<0,10,0>,lq,lq orient circular jitter}
light_source { <-50,40,-20> color rgb 1 area_light 
<10,0,0>,<0,10,0>,lq,lq orient circular jitter}

light_source { <0,0,-30> color rgb 0.2 area_light 
<10,0,0>,<0,10,0>,lq,lq orient circular jitter}

#local ts =2;
#local RS =0.06;
union{
union{
  sphere_sweep {
   b_spline
   20

   <-2,0.8,0>,RS*ts
   <-1,0.8,RS>,RS*ts
   <1,0.8,RS*2>,RS*ts
   <1.4,1,RS>,RS*ts
   <1.2,1.2,RS>,RS*ts
   <1,1,0.00>,RS*ts
   <1,-0.8,RS>,RS*ts
   <1.06,-1.06,RS>,RS*ts
   <1.12,-1,RS*2>,RS*ts
   <1.12,-0.5,RS>,RS*ts
   <1.5,0,0>,RS*ts
   <1.7,-0.5,0>,RS*ts
   <1.7,-1.3,0>,RS*ts
   <2,-0.7,0>,RS*ts
   <2.7,-0.5,0>,RS*ts
   <2.2,0,0>,RS*ts
   <1.7,-0.5,-RS>RS*ts
   <2.2,-1,-RS*2>RS*ts
   <2.7,-1,-RS>RS*ts
   <3.2,-0,0>RS*ts
   tolerance 1.0e-1
  }
  sphere_sweep{
   b_spline
   4
   <0,2,0.12>,RS*ts
   <0,0.9,RS*2>,RS*ts
   <0.2,-1.3,0>,RS*ts
   <-0.2,-2,0>,RS*ts
  }
  translate<-2,0,0>
  scale 1/ts

  translate<-1.6,0.9,0>


  pigment{color rgb <1,0,0>}
  finish{phong 1 reflection <1,0.4,0.4>}
}

union{

  sphere_sweep{
   b_spline
   5
   <-0.5,2,0.12>,RS
   <-0.0,0.9,RS*2>,RS
   <0.2,0,0>,RS
   <0.2,-1.3,0>,RS
   <-0.2,-2,0>,RS
  }

  sphere_sweep{
   b_spline
   6
   <-1,0,0.12>,RS
   <-0.5,1.2,RS*2>,RS
   <1.3,1,0>,RS
   <1.3,0.2,-RS>,RS
   <-0,-0.5,-RS*2>,RS
   <-1,-0.5,-00.3>,RS
  }

  sphere_sweep{
   b_spline
   5
   <1.0,0.7,-RS>,RS
   <1.2,0.3,-RS*2>,RS
   <2.4,0.5,-RS*2>,RS
   <2.5,0.5,0.0>,RS
   <2.5,0.4,RS>,RS
   tolerance 1.0e-1
  }

  sphere_sweep{
   b_spline
   19
   <1.7,-0.7,0>,RS
   <2,-0.7,0>,RS
   <2.7,-0.5,0>,RS
   <2.2,0,0>,RS
   <1.7,-0.5,0.0>RS
   <2,-1,RS>RS
   <2.7,-1,0.0>RS
   <2.95,0.5,0>RS
   <2.9,0.7,-RS>RS
   <2.85,0.5,-RS*2>RS
   <2.9,-1,-RS>RS
   <3.1,-1,-0.00>RS
   <3.4,-0.8,0.00>RS
   <3.9,-0.5,-RS>RS
   <3.4,0,-RS*2>RS
   <3.0,-0.5,-RS>RS
   <3.4,-1,-0.00>RS
   <3.9,-1,-0.00>RS
   <5,-0.5,-0.00>RS
   tolerance 1.0e-1
   translate<-1,0,0>

   //bounded_by{box{<1.2,0.8,0.3><-1.3,-1.2,-0.3>}}
  }

  translate<-1,0,0>

   pigment{color rgb <1,0,0>}
  finish{phong 1 reflection <1,0.4,0.4>}
}
}



-Pete


Post a reply to this message

From: Tim Attwood
Subject: Re: sphere_sweep artifacts
Date: 3 Mar 2005 03:28:46
Message: <4226cabe@news.povray.org>
>> I'm currently trying to get a sphere sweep approximation of my signiature 
>> and for some reason the object produced is full of tiny holes.
>>
>> I've looked at all the info about self-shadowing and tolerance but no 
>> matter how I set the tolerance, the sweep looks like it's disintegrating. 
>> Besides, this isn't self shadowing as far as I can tell, the missing 
>> parts aren't just dark, they're transparent.

The problem lies with the orthographic camera...

3.3.1.2.2  Orthographic projection
"If objects are too close to the camera location they may disappear. Too
close here means, behind the orthographic camera projection plane (the plane
that goes through the look_at point)."

You can move the "invisible" orthographic projection plane to not be
coincident with your sweep...
look_at <-1.5,1,-0.03>
... with ...
tolerance 0.001
...renders a perty clean sphere_sweep.


Post a reply to this message

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