POV-Ray : Newsgroups : povray.advanced-users : Parse error : Re: Parse error Server Time
25 Apr 2024 12:15:49 EDT (-0400)
  Re: Parse error  
From: clipka
Date: 1 Apr 2017 03:13:07
Message: <58df5303$1@news.povray.org>
Am 31.03.2017 um 14:11 schrieb Mike Horvath:
> I'm rendering a very old file in the latest beta and am getting this error:
> 
> "Parse Error: Lathe with linear spline has a point with an x value < 0.0."
> 
> I tried setting the version to 3.6 for that file but I still get the
> error. Is there a work around to get POV-Ray to ignore the problem? It's
> an Object Collection model created by someone else, and I don't know how
> it should be fixed.

A few facts about spline control points with x<0.0:

(1) POV-Ray 3.6.2 also rejected such control points, /except/ when they
occurred as the first or last point of the spline - presumably because
in cubic splines it may make sense for these points to have negative x
coordinates, and 3.6.2 did not examine the spline type there.

(2) POV-Ray 3.6.2 screws up the shading (surface normal computation, to
be precise) of linear_spline lathe (and other lathe variants, for that
matter) if any section of the lathe spline has negative x values (which
is inevitably the case if you use x<0.0 for any control point of a
linear_spline lathe).

In other words, the scene file has been broken all along; the author
just didn't notice it.

(3) Given two linear_spline lathe control points <X0,Y0> and <X2,Y2>
with negative X0, you can fix the spline by replacing the former control
point with <-X0,Y0> and inserting another control point <X1,Y1> such that:

    X1 = 0
    Y1 = X0*(Y2-Y0)/(X2-X0) - Y0

(presuming I got the math right)


@William:

I guess it may make sense, for the sake of backward compatibility, to
issue just a warning instead of an error /if/ the effective language
version is <=370 /and/ the offending point is the first or last control
point of the spline. The warning might state something along the lines
that the point in question /will/ lead to render artefacts, and that the
construct would be considered an error in 3.7.1 and later.


Post a reply to this message

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