POV-Ray : Newsgroups : povray.advanced-users : Parse error Server Time: 18 Jun 2019 17:43:15 GMT
  Parse error (Message 1 to 7 of 7)  
From: Mike Horvath
Subject: Parse error
Date: 31 Mar 2017 12:11:17
Message: <58de4765$1@news.povray.org>
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.

Thanks.


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Parse error
Date: 31 Mar 2017 12:13:38
Message: <58de47f2$1@news.povray.org>
On 3/31/2017 8:11 AM, Mike Horvath wrote:
> 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.
>
> Thanks.
>
>
> Mike


It is this model:

http://lib.povray.org/collection/eagle/chrisb%201.0/eagle.html


Mike


Post a reply to this message

From: omniverse
Subject: Re: Parse error
Date: 31 Mar 2017 18:20:00
Message: <web.58de9d6c236905a39c5d6c810@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> 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.

Renders OK in the actual version 3.6.2 (froze 3.5) but what's going wrong with
it is the negative values for x, and of course I don't know why that changed for
3.7 unless it was to remove such ambiguous values for a spline type that wasn't
meant to handle negatives in the first place.

Obviously the lathe "walls" can't go into negatives anyhow, but spline types
other than linear could use that as a control point and should be okay that way.
Just checked, is okay using cubic_spline.

What would be a good fix for that is to manually change all negative x values to
0 where linear_spline exists, however would probably be better if those could
get parsed as zero instead of negative whenever linear_spline is used.
And/or ignore it if invoking a #version 3.6;


Post a reply to this message

From: omniverse
Subject: Re: Parse error
Date: 1 Apr 2017 04:20:01
Message: <web.58df294c236905a39c5d6c810@news.povray.org>
"omniverse" <omn### [at] charternet> wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
> >
> > "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?

Silly me. I misread that error before, even though I found it to be a problem
with negative x values anyway.

I was thinking that error was saying:  x value <0.0.  Like the 2D vector being
seen was bracket 0.0. with ending decimal point inclusive.

Now I've seen the parser code and that is simply the whole error line given when
encountering a negative x value. Or rather the error we see when <-x,y> is
present in the lathe vector list.

Sorry I didn't catch that until now.
I had decided to go looking at GitHub to see what might have changed, and voila!

https://github.com/POV-Ray/povray/pull/62

But curiously all spline types for lathe are told to report the error and yet
cubic_spline does not for whatever reason.

Also see the lathe specific code:

https://github.com/POV-Ray/povray/blob/71c1415e01d55eb253c5172089ca2d1875412953/source/parser/parser.cpp#L2912

Christoph Lipka? William Pokorny? Any chance of making this version 3.6.2
capable again? Or automatically replacing negative x values with a 0?
If at all feasible either way. What say you?


Post a reply to this message

From: Mike Horvath
Subject: Re: Parse error
Date: 1 Apr 2017 04:56:47
Message: <58df330f$1@news.povray.org>
On 3/31/2017 2:18 PM, omniverse wrote:
> What would be a good fix for that is to manually change all negative x values to
> 0 where linear_spline exists,

This is what I ended up doing. I'm not sure if the result lines up the 
author's original intentions however.


Mike


Post a reply to this message

From: clipka
Subject: Re: Parse error
Date: 1 Apr 2017 07: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

From: William F Pokorny
Subject: Re: Parse error
Date: 1 Apr 2017 16:01:41
Message: <58dfcee5$1@news.povray.org>
On 04/01/2017 03:13 AM, clipka wrote:
> Am 31.03.2017 um 14:11 schrieb Mike Horvath:
...
>
> @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.
>

See pull request #263.

Bill P.


Post a reply to this message

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