POV-Ray : Newsgroups : povray.general : bicubic patch flatness test Server Time
15 Nov 2024 23:24:07 EST (-0500)
  bicubic patch flatness test (Message 1 to 2 of 2)  
From: Sascha Ledinsky
Subject: bicubic patch flatness test
Date: 21 May 2004 12:51:10
Message: <40ae337e@news.povray.org>
I'm not sure if this is a bug or just a side-effect of the flatness test 
for bicubic patches. Anyway, if a patch is flat (meaning planar) it is 
not being tesselated, even if the edges are rounded.

Here are three short test scenes:

1. flatness 0, how it IMHO should look like:

bicubic_patch { type 1 flatness 0 u_steps 4 v_steps 4
 
<0.0,5.0,0.0>,<-2.739125,5.0,0.0>,<-5.0,2.739125,0.0>,<-5.0,0.0,0.0>,<0.0,6.666667,0.0>,<-2.739125,6.666667,0.0>,<-6.666667,2.739125,0.0>,<-6.666667,0.0,0.0>,<0.0,8.333333,0.0>,<-5.47825,8.333332,0.0>,<-8.333332,5.47825,0.0>,<-8.333333,0.0,0.0>,<0.0,10.0,0.0>,<-5.47825,10.0,0.0>,<-10.0,5.47825,0.0>,<-10.0,0.0,0.0>
         pigment { color rgb <0.5,0.5,0.5> }
         finish { ambient 1 diffuse 0 }
}
camera { location <0,0,-30> look_at <0,0,0> }

---

2. flatness 0.001 - the same patch, but it doesn't get tesselated at all!


bicubic_patch { type 1 flatness 0.001 u_steps 4 v_steps 4
 
<0.0,5.0,0.0>,<-2.739125,5.0,0.0>,<-5.0,2.739125,0.0>,<-5.0,0.0,0.0>,<0.0,6.666667,0.0>,<-2.739125,6.666667,0.0>,<-6.666667,2.739125,0.0>,<-6.666667,0.0,0.0>,<0.0,8.333333,0.0>,<-5.47825,8.333332,0.0>,<-8.333332,5.47825,0.0>,<-8.333333,0.0,0.0>,<0.0,10.0,0.0>,<-5.47825,10.0,0.0>,<-10.0,5.47825,0.0>,<-10.0,0.0,0.0>
         pigment { color rgb <0.5,0.5,0.5> }
         finish { ambient 1 diffuse 0 }
}
camera { location <0,0,-30> look_at <0,0,0> }

---

3. flatness 0.001 - I've moved to first control point just a bit, so the 
patch isn't planar anymore, and it get's tesselated correctly...

bicubic_patch { type 1 flatness 0.001 u_steps 4 v_steps 4
 
<0.0,5.0,0.5>,<-2.739125,5.0,0.0>,<-5.0,2.739125,0.0>,<-5.0,0.0,0.0>,<0.0,6.666667,0.0>,<-2.739125,6.666667,0.0>,<-6.666667,2.739125,0.0>,<-6.666667,0.0,0.0>,<0.0,8.333333,0.0>,<-5.47825,8.333332,0.0>,<-8.333332,5.47825,0.0>,<-8.333333,0.0,0.0>,<0.0,10.0,0.0>,<-5.47825,10.0,0.0>,<-10.0,5.47825,0.0>,<-10.0,0.0,0.0>
         pigment { color rgb <0.5,0.5,0.5> }
         finish { ambient 1 diffuse 0 }
}
camera { location <0,0,-30> look_at <0,0,0> }

---

The only workaround I see is to always use flatness 0...

regards
-Sascha


Post a reply to this message

From: andrel
Subject: Re: bicubic patch flatness test
Date: 21 May 2004 15:21:50
Message: <40AE56D2.60709@hotmail.com>
> 
> The only workaround I see is to always use flatness 0...
It is not a workaround, it is what is in the specifications.
A flat round patch is completely flat no matter how round
it is. It surprised me the first time too. An unwanted
side effect of that is that we sometimes are forced to
specify a lower value of flatness (e.g. 0) than we would like.
I do not know if another definition of flatness could be
implemented that took the curvature of the edge splines
into account nor if that would break existing code.


Post a reply to this message

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