POV-Ray : Newsgroups : povray.programming : Bicubic patch bug (job000202) : Bicubic patch bug (job000202) Server Time
28 Jul 2024 06:20:19 EDT (-0400)
  Bicubic patch bug (job000202)  
From: Massimo Valentini
Date: 21 Oct 2002 12:34:04
Message: <3db42c7c@news.povray.org>
This bug (http://news.povray.org/3c23b26c@news.povray.org) is a simple 
scaling problem.

In the file bezier.cpp there are three cross products (VCross) and
after each one you check the squared length of the resulting vector 
against BEZIER_EPSILON (1.0e-10). 
But the result of a cross product (a = b x c) is a vector (a) whose 
length is the product of the length of the two vectors times the sine 
of the angle.

||a|| = ||b|| ||c|| sin(b^c).  

so scaling b and c, as the bug report author does, there is  a value
of the scaling factor, below which a condition like

||a||^2 > BEZIER_EPSILON

is no more satisfied. It suffices to transform the three conditions
to:

||a||^2 > BEZIER_EPSILON * ||b||^2 * ||c||^2

and the image produced is quite independent from the scale factor.

HTH Massimo


Post a reply to this message

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