|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
For a while, this one had me wondering if I'd made a disastrous error in
roundedge.inc.
Code excerpt:
____________________________________________________________________
#include "functions.inc"
#include "roundedge.inc" //From lib.povray.org; defines RE_fn_Blob2()
#macro Basic_shape (Rpipe, Rsaddle)
1 - sqrt
( RE_fn_Blob2 (f_sphere (0, y, z, Rpipe), Rsaddle)
+ RE_fn_Blob2 (f_sphere (x, 0, z, Rpipe), Rsaddle)
- RE_fn_Blob2 (f_sphere (x, y, z, Rpipe), Rsaddle)
)
#end
#declare Final_shape = isosurface
{ function { max (Basic_shape (0.5, 0.3), -Basic_shape (0.4, 0.4)) }
max_gradient 1/0.3
contained_by { box { -<1, 1, 0>, <1, 1, 0.5> } }
}
____________________________________________________________________
POV-Ray veterans and C programmers will spot my error immediately.
However, the first newbie to post what I did wrong gets a 15% discount off
POV-Ray 3.7.0. (You do not need to know what RE_fn_Blob2() does to figure it
out.)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Cousin Ricky" <rickysttATyahooDOTcom> wrote:
> For a while, this one had me wondering if I'd made a disastrous error in
> roundedge.inc.
>
> Code excerpt:
> ____________________________________________________________________
>
> #include "functions.inc"
> #include "roundedge.inc" //From lib.povray.org; defines RE_fn_Blob2()
>
> #macro Basic_shape (Rpipe, Rsaddle)
> 1 - sqrt
> ( RE_fn_Blob2 (f_sphere (0, y, z, Rpipe), Rsaddle)
> + RE_fn_Blob2 (f_sphere (x, 0, z, Rpipe), Rsaddle)
> - RE_fn_Blob2 (f_sphere (x, y, z, Rpipe), Rsaddle)
> )
> #end
>
> #declare Final_shape = isosurface
> { function { max (Basic_shape (0.5, 0.3), -Basic_shape (0.4, 0.4)) }
> max_gradient 1/0.3
> contained_by { box { -<1, 1, 0>, <1, 1, 0.5> } }
> }
> ____________________________________________________________________
>
> POV-Ray veterans and C programmers will spot my error immediately.
>
> However, the first newbie to post what I did wrong gets a 15% discount off
> POV-Ray 3.7.0. (You do not need to know what RE_fn_Blob2() does to figure it
> out.)
Without knowing what you're trying to accomplish here, I find this: max
(Basic_shape (0.5, 0.3), -Basic_shape (0.4, 0.4)) slightly suspicious.
Regards,
A.D.B.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Anthony D. Baye" <Sha### [at] spamnomorehotmailcom> wrote:
> Without knowing what you're trying to accomplish here, I find this: max
> (Basic_shape (0.5, 0.3), -Basic_shape (0.4, 0.4)) slightly suspicious.
Nope, that's not it. However, if you do the macro substitution by hand, you
might figure out the problem (again, without having to know what the shape is
supposed to look like).
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Cousin Ricky" <rickysttATyahooDOTcom> wrote:
> For a while, this one had me wondering if I'd made a disastrous error in
> roundedge.inc.
>
> Code excerpt:
> ____________________________________________________________________
>
> #include "functions.inc"
> #include "roundedge.inc" //From lib.povray.org; defines RE_fn_Blob2()
>
> #macro Basic_shape (Rpipe, Rsaddle)
> 1 - sqrt
> ( RE_fn_Blob2 (f_sphere (0, y, z, Rpipe), Rsaddle)
> + RE_fn_Blob2 (f_sphere (x, 0, z, Rpipe), Rsaddle)
> - RE_fn_Blob2 (f_sphere (x, y, z, Rpipe), Rsaddle)
> )
> #end
>
> #declare Final_shape = isosurface
> { function { max (Basic_shape (0.5, 0.3), -Basic_shape (0.4, 0.4)) }
> max_gradient 1/0.3
> contained_by { box { -<1, 1, 0>, <1, 1, 0.5> } }
> }
> ____________________________________________________________________
>
> POV-Ray veterans and C programmers will spot my error immediately.
>
> However, the first newbie to post what I did wrong gets a 15% discount off
> POV-Ray 3.7.0. (You do not need to know what RE_fn_Blob2() does to figure it
> out.)
It seems to me that it should be verified that a number be tested
to be positive before taking the square root out of it.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"nimda" <nomail@nomail> wrote:
> "Cousin Ricky" <rickysttATyahooDOTcom> wrote:
> > [snip]
> > #macro Basic_shape (Rpipe, Rsaddle)
> > 1 - sqrt
> > ( RE_fn_Blob2 (f_sphere (0, y, z, Rpipe), Rsaddle)
> > + RE_fn_Blob2 (f_sphere (x, 0, z, Rpipe), Rsaddle)
> > - RE_fn_Blob2 (f_sphere (x, y, z, Rpipe), Rsaddle)
> > )
> > #end
> > [snip]
>
> It seems to me that it should be verified that a number be tested
> to be positive before taking the square root out of it.
That wasn't it. As it turns out, RE_fn_Blob2() always returns a non-negative
number, and in this particular example, the value of the third term never
exceeds the sum of the first two. But you weren't expected to know that, so it
was a good guess anyway.
(A quick test showed that taking the square root of a negative number within an
isosurface does not cause an exception! That would have been a whole other
source of frustration; I would have expected the render to crash in that case,
and therefore would not have suspected that to be the problem if the render ran
to completion. Now I have something else to watch out for!)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> (A quick test showed that taking the square root of a negative number
within an
> isosurface does not cause an exception! That would have been a whole
other
> source of frustration; I would have expected the render to crash in
that case,
> and therefore would not have suspected that to be the problem if the
render ran
> to completion. Now I have something else to watch out for!)
>
>
>
I've found that a long time ago. I supose that an internal test change
the negative value to zero, take the absolute value, or there is a trap
to catch that undefined value.
I suspect that it's the third instance of RE_fn_Blob2...
The first have: (0,y,z, Rpipe)
The second have: (x,0,z, Rpipe)
But the third have: (x,y,z, Rpipe)
It probably should be: (x,y,0, Rpipe)
Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Nope, that's not it. However, if you do the macro substitution by hand, you
> might figure out the problem (again, without having to know what the shape is
> supposed to look like).
I rarely use macros like this (usually just for shapes or groups of
shapes) but yeh I can imagine that one took a while to figure out.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 21.03.2013 03:32, schrieb Cousin Ricky:
> POV-Ray veterans and C programmers will spot my error immediately.
Will they?
Took me a while to figure it out; I won't spoil the party though, so
happy guessing to everyone else :-P
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Cousin Ricky wrote:
> -Basic_shape (0.4, 0.4)
I suspect this was intended to be the negative value
of Basic_shape(0.4,0.4), while it may turn out to only
change 1-sqrt to -1-sqrt.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Cousin Ricky wrote:
>
> > -Basic_shape (0.4, 0.4)
>
> I suspect this was intended to be the negative value
> of Basic_shape(0.4,0.4), while it may turn out to only
> change 1-sqrt to -1-sqrt.
Bingo. But you're not a newbie, so the discount goes to the first newbie who
explains why this happens and how to fix it.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|