|
|
"Safari" ha scritto
: >
: >||a||^2 > BEZIER_EPSILON * ||b||^2 * ||c||^2
: >
: > and the image produced is quite independent from the scale factor.
: >
: > HTH Massimo
:
: hmm.. can you provide patch against povray-3.50 bezier.cpp?
:
Here it is.
Massimo
--- src/bezier.cpp.ex Tue Nov 5 17:44:32 2002
+++ src/bezier.cpp Tue Nov 5 17:44:32 2002
@@ -469,7 +469,9 @@
VDot(t, N, N);
- if (t > BEZIER_EPSILON)
+ DBL squared_u1 = VSumSqr(U1);
+ DBL squared_v1 = VSumSqr(V1);
+ if (t > BEZIER_EPSILON * squared_u1 * squared_v1)
{
t = 1.0 / sqrt(t);
@@ -520,9 +522,11 @@
VCross(Result, V1, V2);
- VLength(Length, Result);
+ Length = VSumSqr(Result);
+ DBL squared_v1 = VSumSqr(V1);
+ DBL squared_v2 = VSumSqr(V2);
- if (Length < BEZIER_EPSILON)
+ if (Length <= BEZIER_EPSILON * squared_v1 * squared_v2)
{
Make_Vector(Result, 1.0, 0.0, 0.0);
@@ -532,6 +536,8 @@
}
else
{
+ Length = sqrt(Length);
+
VInverseScale(Result, Result, Length);
VDot(*d, Result, v1);
@@ -581,7 +587,9 @@
VDot(d, B[2], B[2]);
- if (d < BEZIER_EPSILON)
+ DBL squared_b0 = VSumSqr(B[0]);
+ DBL squared_b1 = VSumSqr(B[1]);
+ if (d <= BEZIER_EPSILON * squared_b1 * squared_b0)
{
return (0);
}
Post a reply to this message
|
|