POV-Ray : Newsgroups : povray.bugreports : Why does sphere { Object } work? : Why does sphere { Object } work? Server Time
23 Sep 2021 01:10:26 EDT (-0400)
  Why does sphere { Object } work?  
From: Cousin Ricky
Date: 6 Nov 2018 17:19:38
Message: <5be2137a$1@news.povray.org>
I've been going through some archived scenes (vintage 2003 - 2006) from 
a long-scraped computer and merging them with my main POV directory 
tree.  Most of the images were not archived, so I've been cleaning up 
the scene files and re-rendering them.  After rendering one scene 
successfully, I noticed what seemed to be a syntax error: two spheres in 
a union, each of which contained a declared object!  Why did it not halt 
with a parse error?

The following simplified scene illustrates the strangeness:

-------------- [BEGIN CODE] --------------
#version 3.5;
global_settings { assumed_gamma 1 }
light_source { <-1, 1, -1> * 1000, rgb 1 }
#declare Object = sphere { 3 * z, 1 }
sphere { Object pigment { red 1 } }
--------------- [END CODE] ---------------

This renders to completion with all POV versions and #versions from 3.5 
through 3.8.0-alpha.9893777.  Replacing 'sphere' in either line with 
other object types also does not cause a parse error; whatever shaped is 
defined in the #declare is rendered.

I admit this is a minor issue, as it does not cause a correct scene file 
to fail.  Still, it does not appear legal according to the syntax diagrams.

POV-Ray versions:
   3.5 Unix (.Linux.gcc) [official download]
   3.6.1 (g++ 3.4.1 @ i686-pc-linux-gnu) [official download]
   3.7.0.unofficial (g++ 4.8 @ x86_64-unknown-linux-gnu) [self-compiled
     official]
   3.8.0-alpha.9893777.unofficial (g++ 7 @ x86_64-pc-linux-gnu) [self-
     compiled alpha]
OS: openSUSE Leap 15.0 (GNU/Linux)


Post a reply to this message

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