|
![](/i/fill.gif) |
kurtz le pirate <kur### [at] yahoo fr> wrote:
> In article <4dbef64e@news.povray.org>, Alain <aze### [at] qwerty org> wrote:
>
> > Try this:
> > <det_a/det, det_b/det, 0>;
>
>
> already tried...
>
> error is now :
>
> File Context (5 lines):
> // --- z = ax + b
> // --- line d0 : p0 to p1
> #declare sidesLines[0][0] =
> lineEquation(rectangles[0][0].x,rectangles[0][0].z,rectangles[0][1].x,rec
> tangles[0][1].z);
> Parse Error: Expected 'object or directive', ; found instead
>
>
>
>
> --
> klp
Remove the ';' from this declaration now:
#declare sidesLines[0][0] =
lineEquation(rectangles[0][0].x,rectangles[0][0].z,rectangles[0][1].x,rec
tangles[0][1].z)
It does have something to do with the result being posted inside the #if loop.
The other alternative and what I would see as the cleaner, more correct
alternative, is to move the value outside the #if loop:
#macro lineEquation (x1,z1,x2,z2)
#local det = x1-x2;
#if(det=0)
#error "\n\n---\nWarning, the system has no unique solution.\nProgram stop
here\n\n"
#else
#local det_a = z1-z2;
#local det_b = (x1*z2)-(z1*x2);
#end
<det_a/det, det_b/det, 0>
#end
#declare sidesLines[0][0] = lineEquation(,,,);
-tgq
Post a reply to this message
|
![](/i/fill.gif) |