POV-Ray

The Persistence of Vision Raytracer (POV-Ray).

This is the legacy Bug Tracking System for the POV-Ray project. Bugs listed here are being migrated to our github issue tracker. Please refer to that for new reports or updates to existing ones on this system.

Attached to Project: POV-Ray
Opened by Matthew Potter - 2013-05-11
Last edited by Christoph Lipka - 2013-05-11

FS#291 - Math.inc: error in VDist function

Included math.inc into scene and recieved this fatal error from povray:

File '/usr/local/share/povray-3.7/include/math.inc' line 248: Parse Error: Expected 'string expression', float function 'vlength' found instead

Appropriate place in math.inc:

245 > #end
246 >
247 > // Distance between V1 and V2
248 > #macro VDist(V1, V2) vlength(V1 - V2) #end
249 >
250 > // Returns a vector perpendicular to V

Running newly-downloaded/newly-compiled POV-Ray 3.7.0, on Linux x86_64 system

Closed by  Christoph Lipka
Saturday, 11 May 2013, 21:04 GMT
Reason for closing:  Not a bug
Grimbert Jérôme commented on Saturday, 11 May 2013, 07:26 GMT

Cannot reproduce. (neither with 3.7.0.RC7 nor 3.7.0 of start of May)

#version 3.7;
global_settings{assumed_gamma 1.0 }
#include "math.inc"

#declare A=<0,0,0>;
#declare B=<4,4,4>;
#declare L="A";
#declare L = VDist(A,B);

#debug concat(str(L,3,3), "\n")

Are you sure you are not using VDist() in a string expression ?
(Hint: #debug concat(VDist(A,B), "\n") is not expected to work!)

Matthew Potter commented on Saturday, 11 May 2013, 20:28 GMT

That must be it. Both of these lines work:

#error concat("***Difference in color***: ", str(vlength(MyColor - <1,1,1>),0,3) )
#error concat("***Difference in color***: ", str(VDist(MyColor, <1,1,1>),0,3) )

Yet both of these lines raise the described "bug":

#error concat("***Difference in color***: ", vlength(MyColor - <1,1,1>) )
#error concat("***Difference in color***: ", VDist(MyColor, <1,1,1>) )

Sorry for raising the bug-flag unneccessarily. Any chance we can adjust how the error is reported, since this seems to be a confusing error-report?

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing