Error when using a #while loop and the SweepSpline macro in the Linux version of POV-Ray. I used POV-Ray to make an animation of my Morgan driving around a slalom course. (If you are curious, you can see the output on youtube under my user name, nojonushi.) To make the long swooping fenders I downloaded Mike William's SweepSpline macro from his site: http://www.econym.demon.co.uk/isotut/more.htm The code rendered the 1189 frames in one go with no problems. But the wheels in that animation do not rotate, so I then added code to rotate the wheels. In the calculations I used a #while loop to step through the spline I have with the route coordinates and total up the distance traveled. Running POV-Ray on this file would produce a random number of images and then issue an error, e.g. 0:00:00 Processing Frame 456 of 1189 0:00:00 Parsing File: mogslalom.pov Line: 1918 Parse Warning: Patch objects not allowed in intersection. File: mogslalom.pov Line: 2988 File Context (5 lines): object { SweepSpline(TFSpline, Parse Error: Identifier expected, incomplete function call or spline call found instead. It looked to me, like some kind of memory clobbering for it to be incomplete for frame 456 after it was OK for the previous 455 frames. Using that idea I found I could work around it by updating the povray.ini file's Initial_Frame and Initial_Clock to the failed frame number and alternately adding, then next time deleting, a dummy variable #declare statement. My code contained 6 uses of the SweepSpline and I think all of them appeared as the error at one time or another, but never any other command. The same error happens in a stripped down version with just one SweepSpline and a #while loop that does nothing but increment its control counter. (Which I have included below) This error does not happen with the Windows version running in my Vista partition. But a friend has duplicated the error on his Linux machine. Machine specs: Mine has an AMD Phenom 9550 Quad processor on an ASUS M3A78-CM mother board with an ATI Radeon HD 4850 video card running under Ubuntu Linux 9.4 64 bit. The duplication of the error was run on a machine with an AMD Athlon 2 620 4 core CPU, an ATI 4300 series graphics card, on an ASUS M4A785-M motherboard running under Ubuntu 10.4 32 bit. We used the official linux version of POV-Ray downloaded from http://www.povray.org/download/ And the current version of Mike William's macro from http://www.econym.demon.co.uk/isotut/more.htm The yellow bar on the bottom of the page contains the download function. The animation changes added to the end of the povray.ini file in /usr/local/etc/povray/3.6 were: ; ; For animation ; Initial_Frame = 0000 Final_Frame = 1188 Initial_Clock = 0.0 Final_Clock = 118.8 ; ; End of animation settings ; Here is the stripped down .pov file that I gave to my friend to use to duplicate the error: #include "colors.inc" #include "textures.inc" #include "math.inc" camera { location <10, 5, 5> look_at <5, 0, -3> } background { color SkyBlue } light_source { <2, 400, -1> color White adaptive 1 } // Floor plane { y, 0 pigment { color Gray70 } normal { bumps 0.4 scale 0.2 } } // ======================================================================================= // #while loop ========================================================================== #declare WhileCount = 0; #while (WhileCount < clock*10) #declare WhileCount = WhileCount + 1; #end // Car parts: ======================================================================= #declare Green = texture { // pigment { color rgb<0.2, 0.8, 0.3> } pigment { color rgb<0.1, 0.4, 0.15> } finish { ambient 0.2 diffuse 0.5 reflection 0.3} } // Left Front Wing **************************************************************** // Path along the left rear wing #declare FWSpline = spline { cubic_spline -.25, < 0.5, 0, 0.9> 0.05, < 1.1, 0, 0.90> 0.10, < 2.0, 0, 0.91670> 0.15, < 3.0, 0, 0.97917> 0.20, < 4.0, 0, 1.08333> 0.25, < 5.0, 0, 1.27083> 0.30, < 6.0, 0, 1.51042> 0.35, < 7.0, 0, 1.83333> 0.40, < 8.0, 0, 2.16667> 0.41, < 8.05, 0, 2.16563> 0.42, < 8.1, 0, 2.16241> 0.45, < 8.25, 0, 2.13961> 0.50, < 8.500, 0, 2.05413> 0.55, < 8.6010, 0, 2.0000> 0.60, < 8.75, 0, 1.8937> 0.65, < 8.89370, 0, 1.750> 0.70, < 9.00, 0, 1.6010> 0.75, < 9.05413, 0, 1.50> 0.80, < 9.13961, 0, 1.250> 0.85, < 9.16670, 0, 1.00> 0.90, < 9.16241, 0, 0.90> 1.25, < 9.13961, 0, .75> } // This spline describes the cross section of the object // For a closed shape the spline should have the same values at control points 0 and 1 // The z coordinate is not used #declare VSpline = spline { natural_spline -0.25, <0.0, 2.0, 0>, 0, <0.0, 1.70833, 0>, 0.05, <0.0, 1.45, 0>, 0.10, <0.0, 1.2, 0>, 0.15, <0.0, 1.0, 0>, 0.18, <0.0, 0.90, 0>, 0.20, <0.0, .80208, 0>, 0.25, <0.16667, 0.64583, 0> 0.30, <0.16667, 0.12500, 0> 0.35, <0.04167, 0.00000, 0> 0.40, <-0.08333, 0.00000, 0>, 0.50, <-0.2000, 0.0000, 0> 1.25, <-1.0,0.0, 0>, } // This spline describes how the width varies #declare WSpline = spline { cubic_spline 1.0, 0.75, // Control Pont 1.0, 0.75, 1.0, 0.75, 1.0, 0.75, 1.0, 0.75 // Control Point } #declare Upoints = 50; // Number of points along #declare Vpoints = 50; // Number of points around #declare Filename = "FLW" // #declare Filename = "" #include "SweepSpline.inc" #declare leftfrontwing = difference { object { SweepSpline(FWSpline, VSpline, WSpline, Upoints, Vpoints, Filename) texture { Green } } // trim bottom edges union { cylinder { <8.0417, .1, 0.9> <8.0417, -0.21, 0.9>, 1.2 texture {Green } } box { <9.5, 2.10, .80> <1.05, -0.21, -0.5> texture {Green } } box { <9.0, 2, 1.10> <9.5, -2, -0.5> texture {Green } } difference { box { <6.4417, .1, 0.9> <7.4417, -0.21, 1.4> texture {Green } } cylinder { <6.4417, .1, 1.4> <6.4417, -0.21, 1.4>, .5 texture {Green } } } } } object {leftfrontwing rotate -90*x } // End of code ***************** I ran povray in a terminal session from within the directory where I stored both my .pov source and the .inc files with the macros I was using. The command to start the picture rendering; povray mogslalom.pov The only parameters I ever used were +Hnnn and +Wnnn to make larger pictures but the error occured just the same. Things I tried: - Commenting out the entire #while loop lets the full 1189 frames get created in one session. - Removing all the code for the SweepSpline objects and activating the #while loop gets the full 1189 frames created in one session. - The same error occurs whether or not I let the SweepSpline macro save files of the meshes it creates. (The commented #declare Filename = "" would not save or use the mesh file) Here is a terminal log with animation turned off to produce one image of the car: david@FARMER-PC:~/JagClubSlalom$ povray mogslalom.pov +w720 +h400 povray: cannot open the user configuration file /home/david/.povray/3.6/povray.conf: No such file or directory Persistence of Vision(tm) Ray Tracer Version 3.6.1 (g++ 3.4.1 @ i686-pc-linux-gnu) This is an official version prepared by the POV-Ray Team. See the documentation on how to contact the authors or visit us on the internet at http://www.povray.org/. POV-Ray is based on DKBTrace 2.12 by David K. Buck & Aaron A. Collins Copyright 1991-2003 Persistence of Vision Team Copyright 2003-2004 Persistence of Vision Raytracer Pty. Ltd. Primary POV-Ray 3.5/3.6 Developers: (Alphabetically) Chris Cason Thorsten Froehlich Nathan Kopp Ron Parker Contributing Authors: (Alphabetically) Steve Anger Eric Barish Dieter Bayer Steve A. Bennett David K. Buck Nicolas Calimet Aaron A. Collins Chris Dailey Steve Demlow Andreas Dilger Alexander Enzmann Dan Farmer Mark Gordon Christoph Hormann Mike Hough Chris Huff Kari Kivisalo Lutz Kretzschmar Jochen Lippert Pascal Massimino Jim McElhiney Douglas Muir Juha Nieminen Bill Pulver Eduard Schwan Wlodzimierz Skiba Robert Skinner Yvo Smellenbergh Zsolt Szalavari Scott Taylor Massimo Valentini Timothy Wegner Drew Wells Chris Young Other contributors are listed in the documentation. Support libraries used by POV-Ray: ZLib 1.2.1, Copyright 1995-1998 Jean-loup Gailly and Mark Adler LibPNG 1.2.5, Copyright 1998-2002 Glenn Randers-Pehrson LibJPEG 6b, Copyright 1998 Thomas G. Lane LibTIFF 3.6.1, Copyright 1988-1997 Sam Leffler, 1991-1997 SGI Redirecting Options All Streams to console..........On Debug Stream to console.........On Fatal Stream to console.........On Render Stream to console........On Statistics Stream to console....On Warning Stream to console.......On Parsing Options Input file: mogslalom.pov (compatible to version 3.61) Remove bounds........On Split unions.........Off Library paths: /usr/local/share/povray-3.6 /usr/local/share/povray-3.6/ini http://www.econym.demon.co.uk/isotut/more.htm /usr/local/share/povray-3.6/include Output Options Image resolution 720 by 400 (rows 1 to 400, columns 1 to 720). Output file: /home/david/JagClubSlalom/mogslalom.png, 24 bpp PNG Graphic display......On (gamma: 2.2) Mosaic preview.......Off CPU usage histogram..Off Continued trace......Off Tracing Options Quality: 9 Bounding boxes.......On Bounding threshold: 3 Light Buffer.........On Vista Buffer.........On Draw Vista Buffer....Off Antialiasing.........Off Clock value: 0.000 (Animation off) 0:00:00 Parsing File: mogslalom.pov Line: 1917 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: FLW File: FLW Line: 518 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 2797 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: FRW File: FRW Line: 518 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 2872 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: RRW File: RRW Line: 936 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 2982 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: LRW File: LRW Line: 936 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 3058 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: WsT File: WsT Line: 523 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. Parsing mesh2 from file: WsB File: WsB Line: 523 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 3941 Parse Warning: No pigment type given. Cleanup Parse Warning: This rendering uses the following experimental feature(s): spline. The design and implementation of these features is likely to change in future versions of POV-Ray. Full backward compatibility with the current implementation is NOT guaranteed. 0:00:00 Creating bounding slabs 0:00:00 Creating vista buffer 0:00:00 Creating light buffers 569K tokens Scene Statistics Finite objects: 427 Infinite objects: 1 Light sources: 5 Total: 433 0:00:00 Displaying Using 24 bit TrueColor visual Using default window background Mapping background image X error: BadMatch X error: BadGC 0:00:00 Rendering line 1 of 400 X error: BadMatch X error: BadGC 0:00:22 Rendering line 399 of 400 Possible Rendering Error: Maximum trace level reached! If your scene contains black spots read more about the max_trace_level setting in the documentation! 0:00:22 Done Tracing Render Statistics Image Resolution 720 x 400 ---------------------------------------------------------------------------- Pixels: 288000 Samples: 288000 Smpls/Pxl: 1.00 Rays: 312820 Saved: 193 Max Level: 5/5 ---------------------------------------------------------------------------- Ray->Shape Intersection Tests Succeeded Percentage ---------------------------------------------------------------------------- Bicubic Patch 46734 7659 16.39 Box 2364361 261444 11.06 Cone/Cylinder 5404298 770149 14.25 CSG Intersection 3316896 1232752 37.17 CSG Merge 706663 23960 3.39 CSG Union 346107 135270 39.08 Lathe 401173 61486 15.33 Lathe Bound 401173 90005 22.44 Mesh 1323158 387832 29.31 Plane 1807221 261300 14.46 Prism 372837 266632 71.51 Prism Bound 374901 344216 91.82 Sphere 25526 2039 7.99 Sphere Sweep 2021773 163653 8.09 Torus 267387 200201 74.87 Torus Bound 267387 209931 78.51 Bounding Box 27625920 11237454 40.68 Light Buffer 33687694 13404727 39.79 Vista Buffer 1963749 1455063 74.10 ---------------------------------------------------------------------------- Function VM calls: 2 ---------------------------------------------------------------------------- Roots tested: 10619028 eliminated: 31550 Calls to Noise: 0 Calls to DNoise: 230135 ---------------------------------------------------------------------------- Shadow Ray Tests: 2610569 Succeeded: 505966 Reflected Rays: 24815 Total Internal: 19 Refracted Rays: 5 ---------------------------------------------------------------------------- Smallest Alloc: 9 bytes Largest Alloc: 1152008 bytes Peak memory used: 8596251 bytes Total Scene Processing Times Parse Time: 0 hours 0 minutes 0 seconds (0 seconds) Photon Time: 0 hours 0 minutes 0 seconds (0 seconds) Render Time: 0 hours 0 minutes 22 seconds (22 seconds) Total Time: 0 hours 0 minutes 22 seconds (22 seconds) david@FARMER-PC:~/JagClubSlalom$ ============================================================================ ============================================================================ Here are the last two frames before the error in a set of pictures for an animation: 0:00:00 Processing Frame 96 of 1189 0:00:00 Parsing File: mogslalom.pov Line: 1917 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: FLW File: FLW Line: 518 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 2797 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: FRW File: FRW Line: 518 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 2872 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: RRW File: RRW Line: 936 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 2982 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: LRW 0:00:01 Parsing 310K tokens File: LRW Line: 936 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 3058 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: WsT File: WsT Line: 523 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. Parsing mesh2 from file: WsB File: WsB Line: 523 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 3941 Parse Warning: No pigment type given. Cleanup Parse Warning: This rendering uses the following experimental feature(s): spline. The design and implementation of these features is likely to change in future versions of POV-Ray. Full backward compatibility with the current implementation is NOT guaranteed. 0:00:01 Creating bounding slabs 0:00:01 Creating vista buffer 0:00:01 Creating light buffers 586K tokens Scene Statistics Finite objects: 427 Infinite objects: 1 Light sources: 5 Total: 433 0:00:00 Displaying 0:00:00 Rendering line 1 of 240 Possible Rendering Error: Maximum trace level reached! If your scene contains black spots read more about the max_trace_level setting in the documentation! 0:00:00 Done Tracing Render Statistics Image Resolution 320 x 240 ---------------------------------------------------------------------------- Pixels: 76800 Samples: 76800 Smpls/Pxl: 1.00 Rays: 76824 Saved: 1 Max Level: 5/5 ---------------------------------------------------------------------------- Ray->Shape Intersection Tests Succeeded Percentage ---------------------------------------------------------------------------- Box 3125 89 2.85 Cone/Cylinder 199998 16984 8.49 CSG Intersection 3483 690 19.81 CSG Merge 177 4 2.26 CSG Union 2018 76 3.77 Lathe 1033 61 5.91 Lathe Bound 1033 97 9.39 Mesh 626 140 22.36 Plane 253639 42570 16.78 Prism 68 49 72.06 Prism Bound 68 68 100.00 Sphere 316 6 1.90 Sphere Sweep 27945 42 0.15 Torus 211 162 76.78 Torus Bound 211 168 79.62 Bounding Box 58423 40365 69.09 Light Buffer 1640199 639175 38.97 Vista Buffer 337918 268097 79.34 ---------------------------------------------------------------------------- Function VM calls: 2 ---------------------------------------------------------------------------- Roots tested: 3022 eliminated: 19 Calls to Noise: 0 Calls to DNoise: 33764 ---------------------------------------------------------------------------- Shadow Ray Tests: 344138 Succeeded: 7042 Reflected Rays: 24 ---------------------------------------------------------------------------- Smallest Alloc: 9 bytes Largest Alloc: 352808 bytes Peak memory used: 8963820 bytes Frame Processing Times Parse Time: 0 hours 0 minutes 1 seconds (1 seconds) Photon Time: 0 hours 0 minutes 0 seconds (0 seconds) Render Time: 0 hours 0 minutes 0 seconds (0 seconds) Total Time: 0 hours 0 minutes 1 seconds (1 seconds) 0:00:00 Processing Frame 97 of 1189 0:00:00 Parsing File: mogslalom.pov Line: 1917 Parse Warning: Patch objects not allowed in intersection. Parsing mesh2 from file: FLW File: FLW Line: 518 Parse Warning: Normal vector in mesh2 cannot be zero - changing it to <1,0,0>. File: mogslalom.pov Line: 2797 Parse Warning: Patch objects not allowed in intersection. File: mogslalom.pov Line: 2868 File Context (5 lines): object { SweepSpline(FWSpline, VSpline, Parse Error: Identifier expected, incomplete function call or spline call found instead. Total Scene Processing Times Parse Time: 0 hours 0 minutes 49 seconds (49 seconds) Photon Time: 0 hours 0 minutes 0 seconds (0 seconds) Render Time: 0 hours 2 minutes 46 seconds (166 seconds) Total Time: 0 hours 3 minutes 35 seconds (215 seconds) david@FARMER-PC:~/JagClubSlalom$ ========================================================================== Sorry about this intermittent bug, but at least its probability is high enough that trying to generate 1100 animation images guarantees that it occurs.