POV-Ray : Newsgroups : povray.general : cannot recognize defined object / help, please Server Time
29 Jul 2024 18:18:36 EDT (-0400)
  cannot recognize defined object / help, please (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Robert Baer
Subject: cannot recognize defined object / help, please
Date: 4 Jan 2011 16:15:01
Message: <web.4d238cfd4caa94dad0ff068b0@news.povray.org>
Partial copies of files:
//                             Tank.POV
//                    z
//                    |
// y arrow tip------> .-- x

//        NOTE: Change output filename in Tank.INI for output scene name
//              Save change, then run Tank.INI

#include "colors.inc"
#include "metals.inc"
global_settings { adc_bailout 0.05 max_trace_level 9 }

// *** does not see Lbar, Scribe, etc as defined objects...  <<<----HELP!
#declare Ulong = 48.0;  #declare ucolor = Blue;
 object {Lbar)
 object {Scribe  pigment {Cyan} rotate < 0, 0,90>}
**** SNIP
//                             Tank.INC

//      Subroutines for making the tank

#declare Lbar=union {   // width X to right, length Y to viewer, left part of
"L" points to Z
  #declare A = 1/8;  #declare B = 1.0;   #declare C = 1.0; // L-BAR chosen
  //  Generic Lbar dimensions defined above
  difference {
  box { <0,0,0>,<C-A/2,Ulong,B-A/2> pigment {ucolor} } // as box, less rounded
ends
  box { <A,-0.001,A+0.16/2>,<C,Ulong+0.002,C> pigment {ucolor} } // left cut
  box { <A+0.16/2,-0.001,A>,<B,Ulong+0.002,B> pigment {ucolor} } // bottom cut
  object { cylinder {<A+0.16/2,-0.001,A+0.16/2>,
<A+0.16/2,Ulong+0.001,A+0.16/2>,0.16/2} // curve cut
          pigment {ucolor} }
             }
  object { cylinder {<C-A/2,-0.001,A/2>, <C-A/2,Ulong+0.001,A/2>,A/2}    // left
curve
          pigment {ucolor} }
  object {cylinder {<A/2,-0.001,B-A/2>, <A/2,Ulong+0.001,B-A/2>,A/2}    // right
curve
          pigment {ucolor} }
                           }
#declare Scribe= box {<0,4,0>,<0.03,4.03,1.6> } // for checking only
**** SNIP
;                              Tank.INI

;;file_exists("any.junk")  ; creates file named "true"; impossible to rename any
file

Antialias=On
Width=448  ;Width=640   70% for exact fit in Nerd
Height=336 ;Height=480
;Bits_Per_Color=5  HAS NO EFFECT, still 24 bit color 150DPI

Jitter=Off
Sampling_Method=2
Antialias_Threshold=0.3
Antialias_Depth=1

;;Debug_File=true  ; read "true" for results

Input_File_Name="Tank.pov"
Output_to_File=On
Output_File_Type=N   ; N for PNG files which are the smallest

 Initial_Frame=1
 Final_Frame=12
 Initial_Clock=1
 Final_Clock=12

; clock = 1 (Initial_Clock)

;Make sure this is on if your animation loops:
Cyclic_Animation=off
**** END OF COMPLETE COPY OF FILE


Post a reply to this message

From: Jim Holsenback
Subject: Re: cannot recognize defined object / help, please
Date: 4 Jan 2011 16:24:57
Message: <4d239029@news.povray.org>
On 01/04/2011 05:11 PM, Robert Baer wrote:
>   Partial copies of files:
> //                             Tank.POV
> //                    z
> //                    |
> // y arrow tip------> .-- x
> 
> //        NOTE: Change output filename in Tank.INI for output scene name
> //              Save change, then run Tank.INI
> 
> #include "colors.inc"
> #include "metals.inc"
> global_settings { adc_bailout 0.05 max_trace_level 9 }
> 
> // *** does not see Lbar, Scribe, etc as defined objects...  <<<----HELP!



you're calling them before they're declared! move the defs to before you
call em!




> #declare Ulong = 48.0;  #declare ucolor = Blue;
>  object {Lbar)
>  object {Scribe  pigment {Cyan} rotate < 0, 0,90>}
> **** SNIP
> //                             Tank.INC
> 
> //      Subroutines for making the tank
> 
> #declare Lbar=union {   // width X to right, length Y to viewer, left part of
> "L" points to Z
>   #declare A = 1/8;  #declare B = 1.0;   #declare C = 1.0; // L-BAR chosen
>   //  Generic Lbar dimensions defined above
>   difference {
>   box { <0,0,0>,<C-A/2,Ulong,B-A/2> pigment {ucolor} } // as box, less rounded
> ends
>   box { <A,-0.001,A+0.16/2>,<C,Ulong+0.002,C> pigment {ucolor} } // left cut
>   box { <A+0.16/2,-0.001,A>,<B,Ulong+0.002,B> pigment {ucolor} } // bottom cut
>   object { cylinder {<A+0.16/2,-0.001,A+0.16/2>,
> <A+0.16/2,Ulong+0.001,A+0.16/2>,0.16/2} // curve cut
>           pigment {ucolor} }
>              }
>   object { cylinder {<C-A/2,-0.001,A/2>, <C-A/2,Ulong+0.001,A/2>,A/2}    // left
> curve
>           pigment {ucolor} }
>   object {cylinder {<A/2,-0.001,B-A/2>, <A/2,Ulong+0.001,B-A/2>,A/2}    // right
> curve
>           pigment {ucolor} }
>                            }
> #declare Scribe= box {<0,4,0>,<0.03,4.03,1.6> } // for checking only
> **** SNIP
> ;                              Tank.INI
> 
> ;;file_exists("any.junk")  ; creates file named "true"; impossible to rename any
> file
> 
> Antialias=On
> Width=448  ;Width=640   70% for exact fit in Nerd
> Height=336 ;Height=480
> ;Bits_Per_Color=5  HAS NO EFFECT, still 24 bit color 150DPI
> 
> Jitter=Off
> Sampling_Method=2
> Antialias_Threshold=0.3
> Antialias_Depth=1
> 
> ;;Debug_File=true  ; read "true" for results
> 
> Input_File_Name="Tank.pov"
> Output_to_File=On
> Output_File_Type=N   ; N for PNG files which are the smallest
> 
>  Initial_Frame=1
>  Final_Frame=12
>  Initial_Clock=1
>  Final_Clock=12
> 
> ; clock = 1 (Initial_Clock)
> 
> ;Make sure this is on if your animation loops:
> Cyclic_Animation=off
> **** END OF COMPLETE COPY OF FILE
> 
> 
>


Post a reply to this message

From: clipka
Subject: Re: cannot recognize defined object / help, please
Date: 4 Jan 2011 16:51:56
Message: <4d23967c$1@news.povray.org>
Am 04.01.2011 22:11, schrieb Robert Baer:
>    Partial copies of files:
> //                             Tank.POV
> //                    z
> //                    |
> // y arrow tip------>  .-- x
>
> //        NOTE: Change output filename in Tank.INI for output scene name
> //              Save change, then run Tank.INI
>
> #include "colors.inc"
> #include "metals.inc"
> global_settings { adc_bailout 0.05 max_trace_level 9 }
>
> // *** does not see Lbar, Scribe, etc as defined objects...<<<----HELP!
> #declare Ulong = 48.0;  #declare ucolor = Blue;
>   object {Lbar)
>   object {Scribe  pigment {Cyan} rotate<  0, 0,90>}
> **** SNIP
> //                             Tank.INC
...

I don't see where you include Tank.INC from Tank.POV.

(BTW, it is usually a good idea to place the problem description 
/before/ any snippets of source code, because it makes it immediately 
obvious for the reader what your problem actually is, and may give 
important clues what to keep their eyes peeled for when browsing through 
the code.)


Post a reply to this message

From: Robert Baer
Subject: Re: cannot recognize defined object / help, please
Date: 5 Jan 2011 23:50:00
Message: <web.4d25494596c55a409ea184c90@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 04.01.2011 22:11, schrieb Robert Baer:
> >    Partial copies of files:
> > //                             Tank.POV
> > //                    z
> > //                    |
> > // y arrow tip------>  .-- x
> >
> > //        NOTE: Change output filename in Tank.INI for output scene name
> > //              Save change, then run Tank.INI
> >
> > #include "colors.inc"
> > #include "metals.inc"
> > global_settings { adc_bailout 0.05 max_trace_level 9 }
> >
> > // *** does not see Lbar, Scribe, etc as defined objects...<<<----HELP!
> > #declare Ulong = 48.0;  #declare ucolor = Blue;
> >   object {Lbar)
> >   object {Scribe  pigment {Cyan} rotate<  0, 0,90>}
> > **** SNIP
> > //                             Tank.INC
> ...
>
> I don't see where you include Tank.INC from Tank.POV.
>
> (BTW, it is usually a good idea to place the problem description
> /before/ any snippets of source code, because it makes it immediately
> obvious for the reader what your problem actually is, and may give
> important clues what to keep their eyes peeled for when browsing through
> the code.)
  THAT has gotta be the problem; i had a different program set that worked, and
still works despite incorrect library reference in the \renderer\povray.ini (or
whatever the name is, i forget because i almost never have to hunt for it).
  Thanks.
  Will fix it (on different drive not accessible now).


Post a reply to this message

From: Robert Baer
Subject: Re: cannot recognize defined object / help, please
Date: 6 Jan 2011 17:15:01
Message: <web.4d263dc496c55a4046e881bd0@news.povray.org>
"Robert Baer" <rob### [at] localnetcom> wrote:
> clipka <ano### [at] anonymousorg> wrote:
> > Am 04.01.2011 22:11, schrieb Robert Baer:
> > >    Partial copies of files:
> > > //                             Tank.POV
> > > //                    z
> > > //                    |
> > > // y arrow tip------>  .-- x
> > >
> > > //        NOTE: Change output filename in Tank.INI for output scene name
> > > //              Save change, then run Tank.INI
> > >
> > > #include "colors.inc"
> > > #include "metals.inc"
> > > global_settings { adc_bailout 0.05 max_trace_level 9 }
> > >
> > > // *** does not see Lbar, Scribe, etc as defined objects...<<<----HELP!
> > > #declare Ulong = 48.0;  #declare ucolor = Blue;
> > >   object {Lbar)
> > >   object {Scribe  pigment {Cyan} rotate<  0, 0,90>}
> > > **** SNIP
> > > //                             Tank.INC
> > ...
> >
> > I don't see where you include Tank.INC from Tank.POV.
> >
> > (BTW, it is usually a good idea to place the problem description
> > /before/ any snippets of source code, because it makes it immediately
> > obvious for the reader what your problem actually is, and may give
> > important clues what to keep their eyes peeled for when browsing through
> > the code.)
>   THAT has gotta be the problem; i had a different program set that worked, and
> still works despite incorrect library reference in the \renderer\povray.ini (or
> whatever the name is, i forget because i almost never have to hunt for it).
>   Thanks.
>   Will fix it (on different drive not accessible now).
*                *                  *                 *
** Inserting that include made it work; thanks!
  Then i made some changes and it is worse than before.
  Declared variables now do not pass between .ini and .inc; worse a declared
variable gets reset to zero inside the .inc .

//                             Tank.POV
//                    z
//                    |
// y arrow tip------> .-- x

//        NOTE: Change output filename in Tank.INI for output scene name
//              Save change, then run Tank.INI

#include "colors.inc"
#include "metals.inc"
global_settings { adc_bailout 0.05 max_trace_level 9 }
#include "Tank.inc"  // <----NOTE!! Do not forget!

// Uses "Tank.inc" for subroutines
//      Subroutines for making the tank
// * Ubar         vars: Ulong , ucolor; internal A, B, C dimensions according to
Speedy Metals
// * Lbar         vars: Ulong , ucolor; internal A, B, C dimensions according to
Speedy Metals
// * UpFtBk       observer, at left end "Y", top looking to right Y=0
// * UpLfRt       observer, at left end "Y", top looking to right Y=0
// * Ttop         observer, at left end looking up to right middle of rectangle

#declare PN=3990;   // Chosen "U"  <--NOTE DEFINED!!!!
#declare Ulong = 48.0;  #declare ucolor = Cyan;

// clock 1..9 Make and show tank construction

    #if (clock>=1)
      light_source {<  0, 50,  0> White*9.5}
      light_source {<  0, 10, 20> White*8.5}
      light_source {<  0, 10,-20> White*8.5}
camera {
        perspective
        location < 0.5,49,.1>
        look_at  < 0.5, 0,.1>
        angle 0
        }
#declare Ulong = 1.0;
#declare PN=3990;   // Chosen "U" <--NOTE DEFINED!!!!
#declare PN=4006;   // Frame "U"  <--NOTE DEFINED!!!!
   object {Ubar} //object {Lbar)
    #end

sky_sphere {pigment {rgb <0.859,0.910,0.831>}}
** END FILE
//                             Tank.INC

//      Subroutines for making the tank

// (no longer needed) #declare Deg2Rad = 0.0174532925;
// inside flange surfaces of American Standard channels have approximately a
16-2/3% slope
// In radians, arc tan 1/6 = 0.165148677...

//      U-bar end view shape:
//
//        __ shoulder: "Shl" diameter is wall thickness at top
//       /
//      O
//      || /--- wall may have angle; crudely shown here
//      | \
//      | |   ____strain relief curve:  "Crv" diameter
//      |  \ /
//      |   O___________
//      |                ^
//      |                | C or web/base thickmess
//      +_______________ V
//
      #declare PN=4006;   // Frame "U"   <--NOTE DEFINED!!!!

// U-bar modified with look-up table by product number PN
 #declare A=0; #declare B=0; #declare C= 0.; #declare Angle=0;  // default zero
aize
 #declare Shl=0; #declare Crv=0;                                // default zero
aize
  #debug concat("Start search; PN=", str(B,9,3), "\n")
** SNIP
  Debug file "true" (no other name possible) shows that PN=0 !!
  Furthermore POVray barfs on undefined variable Ulong in Tank.inc .
  How can i fix this?


Post a reply to this message

From: clipka
Subject: Re: cannot recognize defined object / help, please
Date: 6 Jan 2011 20:55:08
Message: <4d26727c$1@news.povray.org>
Am 06.01.2011 23:10, schrieb Robert Baer:

>    Declared variables now do not pass between .ini and .inc; worse a declared
> variable gets reset to zero inside the .inc .

...
>        #declare PN=4006;   // Frame "U"<--NOTE DEFINED!!!!
>
> // U-bar modified with look-up table by product number PN
>   #declare A=0; #declare B=0; #declare C= 0.; #declare Angle=0;  // default zero
> aize
>   #declare Shl=0; #declare Crv=0;                                // default zero
> aize
>    #debug concat("Start search; PN=", str(B,9,3), "\n")

If you want to output PN, then why do you output B ?! ;-)


> ** SNIP
>    Debug file "true" (no other name possible) shows that PN=0 !!

>    Furthermore POVray barfs on undefined variable Ulong in Tank.inc .
>    How can i fix this?

By defining it /before/ you include the file??

But from the code I guess you'll also want more than one "U-bar" in the 
long run anyway, with different lengths - your current code cannot 
accomplish that anyway. You should have a look at POV-Ray's macro 
mechanism for that. Essentially, macros are the only way in POV-Ray to 
"pre-define" anything without specifying all the parameters beforehand.


Post a reply to this message

From: Robert Baer
Subject: Re: cannot recognize defined object / help, please
Date: 7 Jan 2011 02:15:01
Message: <web.4d26bd3f96c55a409ded892d0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 06.01.2011 23:10, schrieb Robert Baer:
>
> >    Declared variables now do not pass between .ini and .inc; worse a declared
> > variable gets reset to zero inside the .inc .
>
> ...
> >        #declare PN=4006;   // Frame "U"<--NOTE DEFINED!!!!
> >
> > // U-bar modified with look-up table by product number PN
> >   #declare A=0; #declare B=0; #declare C= 0.; #declare Angle=0;  // default zero
> > aize
> >   #declare Shl=0; #declare Crv=0;                                // default zero
> > aize
> >    #debug concat("Start search; PN=", str(B,9,3), "\n")
>
> If you want to output PN, then why do you output B ?! ;-)
>
>
> > ** SNIP
> >    Debug file "true" (no other name possible) shows that PN=0 !!
>
> >    Furthermore POVray barfs on undefined variable Ulong in Tank.inc .
> >    How can i fix this?
>
> By defining it /before/ you include the file??
>
> But from the code I guess you'll also want more than one "U-bar" in the
> long run anyway, with different lengths - your current code cannot
> accomplish that anyway. You should have a look at POV-Ray's macro
> mechanism for that. Essentially, macros are the only way in POV-Ray to
> "pre-define" anything without specifying all the parameters beforehand.

  I finally discovered that.
  I thought i could be "cute" and include the .inc file right away and thus make
it global.
  So, thanks.
  Now i have an #if..#end problem that is bugging me:
//                             Tank.POV
//                    z
//                    |
// y arrow tip------> .-- x

//        NOTE: Change output filename in Tank.INI for output scene name
//              Save change, then run Tank.INI

#include "colors.inc"
#include "metals.inc"
global_settings { adc_bailout 0.05 max_trace_level 9 }

// Uses "Tank.inc" for subroutines
//      Subroutines for making the tank
// * Ubar         vars: Ulong , ucolor; declare PN to Speedy Metals part number
// * Lbar         vars: Ulong , ucolor; declare PN to Speedy Metals part number
// * UpFtBk       observer, at left end "Y", top looking to right Y=0
// * UpLfRt       observer, at left end "Y", top looking to right Y=0
// * Ttop         observer, at left end looking up to right middle of rectangle

#declare PN=3990;   // Chosen "U"
#declare Ulong = 48.0;  #declare ucolor = Cyan;

// object {Scribe  pigment {Cyan} rotate < 0, 0,90>}
// object {Scribe  pigment {Magenta} rotate < 0,90,0>}
// object {Scribe  pigment {Yellow} }


// clock 1..9 Make and show tank construction

    #if (clock=91)
      light_source {<  0,150,  0> White*100}
camera {
        perspective
        location < 0,65,-9>
        look_at  < 0, 0, 0>
        angle 0
        }
#include "Tank.inc"
  object {UpFtBk}
    #end

    #if (clock=92)
      light_source {<  0,150,  0> White*5.5}
      light_source {<  0, 10, 20> White*8.5}
      light_source {<  0, 10,-20> White*8.5}
camera {
        perspective
        location < 0, 65,-9>
        look_at  < 0, 0, 0>
        angle 0
        }
#include "Tank.inc"
  object {UpLfRt}
    #end

    #if (clock=93)
      light_source {<  0,150,  0> White*5.5}
      light_source {<  0, 10, 20> White*8.5}
      light_source {<  0, 10,-20> White*8.5}
camera {
        perspective
        location < 0, 65,-9>
        look_at  < 0, 0, 0>
        angle 0
        }
  object {Ttop rotate < 0, 0,45> translate < 20, 0,  0>}
    #end

    #if (clock>3)
      light_source {<  0, 50,  0> White*9.5}
      light_source {<  0, 10, 20> White*8.5}
      light_source {<  0, 10,-20> White*8.5}
camera {
        perspective
        location < 0, 5, 0>
        look_at  < 0, 0, 0>
        angle 0
        }
#include "Tank.inc"
                               //    5  10
  object {Ttop rotate < 0, 0,90> translate <-00,-00,  0>}
    #end
                    // MATCHED #if..#end recognized to here..
    #if (clock>=1)
      light_source {<  0, 50,  0> White*9.5}
      light_source {<  0, 10, 20> White*8.5}
      light_source {<  0, 10,-20> White*8.5}
camera {
        perspective
        location < 0.5,49,.1>
        look_at  < 0.5, 0,.1>
        angle 0
        }
#declare Ulong = 1.0;
//#declare PN=3990;   // Chosen "U"
#declare PN=4006;   // Frame "U"
#include "Tank.inc"
   object {Ubar} //object {Lbar)
    #end
                    // but not to here..
// get "Parse Error: End of file reached but #end expected."
sky_sphere {pigment {rgb <0.859,0.910,0.831>}}
*** END FILE ***


Post a reply to this message

From: Jim Holsenback
Subject: Re: cannot recognize defined object / help, please
Date: 7 Jan 2011 05:52:44
Message: <4d26f07c$1@news.povray.org>
On 01/07/2011 03:14 AM, Robert Baer wrote:
>   Now i have an #if..#end problem that is bugging me:

>                     // MATCHED #if..#end recognized to here..

yep ... looked ok to me too (hard to tell messy sytle)

>                     // but not to here..
> // get "Parse Error: End of file reached but #end expected."
> sky_sphere {pigment {rgb <0.859,0.910,0.831>}}
> *** END FILE ***

maybe some thing in the include file is miss-matched ... dunno if the
parser looks at the include as a seperate entity or considers it as part
of the entire scene file when resolving conditional blocks ... /think/
it's the former


Post a reply to this message

From: clipka
Subject: Re: cannot recognize defined object / help, please
Date: 7 Jan 2011 10:14:01
Message: <4d272db9@news.povray.org>
Am 07.01.2011 11:52, schrieb Jim Holsenback:
> On 01/07/2011 03:14 AM, Robert Baer wrote:
>>    Now i have an #if..#end problem that is bugging me:
>
>>                      // MATCHED #if..#end recognized to here..
>
> yep ... looked ok to me too (hard to tell messy sytle)
>
>>                      // but not to here..
>> // get "Parse Error: End of file reached but #end expected."
>> sky_sphere {pigment {rgb<0.859,0.910,0.831>}}
>> *** END FILE ***
>
> maybe some thing in the include file is miss-matched ... dunno if the
> parser looks at the include as a seperate entity or considers it as part
> of the entire scene file when resolving conditional blocks ... /think/
> it's the former

No, the parser doesn't systematically check whether the #if and other 
blocks of an #include file are fully matched.

An exception is when the parser encounters an #end for a loop it is 
currently processing; in that case the #while or #for must reside in the 
same file as the terminating #end.


Post a reply to this message

From: Robert Baer
Subject: Re: cannot recognize defined object / help, please
Date: 8 Jan 2011 16:35:00
Message: <web.4d28d75596c55a40e40a58410@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 07.01.2011 11:52, schrieb Jim Holsenback:
> > On 01/07/2011 03:14 AM, Robert Baer wrote:
> >>    Now i have an #if..#end problem that is bugging me:
> >
> >>                      // MATCHED #if..#end recognized to here..
> >
> > yep ... looked ok to me too (hard to tell messy sytle)
> >
> >>                      // but not to here..
> >> // get "Parse Error: End of file reached but #end expected."
> >> sky_sphere {pigment {rgb<0.859,0.910,0.831>}}
> >> *** END FILE ***
> >
> > maybe some thing in the include file is miss-matched ... dunno if the
> > parser looks at the include as a seperate entity or considers it as part
> > of the entire scene file when resolving conditional blocks ... /think/
> > it's the former
>
> No, the parser doesn't systematically check whether the #if and other
> blocks of an #include file are fully matched.
>
> An exception is when the parser encounters an #end for a loop it is
> currently processing; in that case the #while or #for must reside in the
> same file as the terminating #end.

  Thanks loads for the patience; learning as i go.
  The business about "subroutines" is something a bit different than in other
languages; quite different than even the 2 ways available in BASIC.
  The above info on #if..#end became pertinent WRT POVray "subroutines".
  Let's see if i can say this correctly.
  Start in .POV and an object is named.
  The program "looks" to see if it is / has been defined in .POV and if not,
scans the .INC files.
  If found in <workingname>.INC then the contents get copied (acts as if one had
a very long file) and then run.
  In my case, the .INC file had an un-matched #if..#end so when the program
continued (effectively "went back" to the .POV file) it did not find a matching
#end and so complained about finding an EOF.

  Now, i think that the program actually does all of the work as it scans thru
all of the pertinent files, and saves the results in some ?hidden? temp area
until done (error or not).
  Then, if error, the appropriate line(s) and file name are used for the message
file - and all results are then scratched / released / erased.
  If no error, one gets all if the neat picture(s), etc.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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