POV-Ray : Newsgroups : povray.beta-test : A bug in shapes.inc? : A bug in shapes.inc? Server Time
1 Jun 2024 22:04:39 EDT (-0400)
  A bug in shapes.inc?  
From: Thomas de Groot
Date: 17 May 2011 08:14:27
Message: <4dd266a3$1@news.povray.org>
I believe something is seriously wrong with the include file shapes.inc, and 
particularly with the HFCreate_ () macro.



Try this code, with an image twice as long as high (i.e. a planetary map):

#include "shapes.inc"



#declare F_HF1 =

function {

  pigment {

    image_map {

      png "my_image.png" gamma 1.0

      map_type 1

      interpolate 2

    }

  }

}



#declare F_HF2 = function (x,y,z){F_HF1(x,y,z).hf}



//HF_Sphere macro

  HF_Sphere (

    F_HF2,               // Function,

    0,                   // UseUVheight:  0 or 1

    0,                   // UseUVtexture: 0 or 1

    <1000, 1000>,        // Resolution,

    1, // Smooth,        // 0 or 1

    //"shapes_test.inc", // FileName or

    "",                           //comment out one of these lines

    <0,0,0>,             // Center

    2.0*10 ,             // Radius

    0.08*10              // Depth

  )

// end of HF_Sphere



object {

  #include "shapes_test.inc"

  pigment {rgb <1,1,0>}

}



1)    for resolutions higher than approximately 1000, parse errors occur and 
the render fails, whether a file is saved or not.

2)    If you examine a save file, you will notice that the data sets are 
written all on one line and without separating commas.



Typical parse error messages are:

For a saved file:

"shapes_test.inc" line 7: Parse Error: No matching } in 'face_indices', < 
found instead



For a render without save file:

"C:\...\POV-Ray\v3.7\include\shapes.inc" line 967: Parse Error: bad 
allocation



As said, in both cases the render failed.



Thomas


Post a reply to this message

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