POV-Ray : Newsgroups : povray.binaries.images : Lathe. Bezier_spline. Problem : Re: Lathe. Bezier_spline. Problem Server Time
7 Nov 2024 09:25:03 EST (-0500)
  Re: Lathe. Bezier_spline. Problem  
From: William F Pokorny
Date: 2 May 2016 10:37:17
Message: <5727661d$1@news.povray.org>
On 05/02/2016 09:58 AM, clipka wrote:
> Am 02.05.2016 um 14:57 schrieb William F Pokorny:
>
>> The issue looks to be this code in the parser for the lathe object :
>
> That is indeed the location in the code that rejects the negative value.
>
>> Probably simple enough I could attempt a fix... Needs a conditional
>> based on whether we have bezier curve I think. If someone else is going
>> after a fix please speak up, otherwise I'll step up and try for one.
>
> I would want more to be done than just address the symptoms

Understand. I too recognize more that just the testing of on curve 
points for the bezier curve was wrong in what we have today.

Namely it is wrong/incomplete for other curve types too. My initial code 
update is this for on curve point test :

                 switch (Object->Spline_Type)
                 {
                         case LINEAR_SPLINE :

                                 if (Points[i][X] < 0.0)
                                 {
                                         Error("Lathe with linear spline 
has a point with an x value < 0.0.");
                                 }

                                 break;

                         case QUADRATIC_SPLINE :

                                 if ((i > 0) && (Points[i][X] < 0.0))
                                 {
                                         Error("Lathe with quadratic 
spline has a point with an x value < 0.0.");
                                 }

                                 break;

                         case CUBIC_SPLINE :

                                 if ((i > 0) && (i < Object->Number - 1) 
&& (Points[i][X] < 0.0))
                                 {
                                         Error("Lathe with cubic spline 
has a point with an x value < 0.0.");
                                 }

                                 break;

                         case BEZIER_SPLINE :

                                 if (((i%4 == 0) || (i%4 == 3)) && 
(Points[i][X] < 0.0))
                                 {
                                         Error("Lathe with Bezier spline 
has a point with an x value < 0.0.");
                                 }

                                 break;
                 }

Which seems to be doing the right sort of testing depending on curve 
type in forcing on curve points to be >=0 in x.

Thanks for the testing ideas below. Some I'd thought of or believe I've 
done in the past, some not.

Rambling I suspect too, both negative control and on curve points will 
run - though us users might well be confused by any result if really true.

If the developers want to allow this, I suppose deleting the current 
check is the way to go instead.

In any case for the moment, let me test the cases below with all parser 
checking off for the different curve types & I will report the results 
here.

> (in this
> case a negative control point value being rejected): First thing to be
> done should be some thorough testing...
>
> - whether the bezier-type lathe can actually deal with negative
> off-curve control points (I expect it can, but that's not necessarily a
> given);
>
> - whether the bezier-type lathe can live with negative on-curve control
> points (I wouldn't be too surprised if it actually can); and
>
> - whether any of the other types of lathe can live with negative control
> points (I would expect them to react the same as the bezier type does
> with on-curve points, but that's not a given either).
>
> Once that's established, the parser code should be adapted accordingly.
>
> Also, if it turns out that the bezier-type lathe is fine with negative
> off-curve control points but not on-curve control points, some thought
> and possibly effort should be put into the case that some off-curve
> points are so far in the negative regime that the resulting curve gets
> pulled across the axis of revolution.
>

If we get into this kind of pre-evaluation of the curves, I'll probably 
bail. :-)

>
> That's the reason why I'm not tackling this issue straight away myself.
>


Post a reply to this message

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