POV-Ray : Newsgroups : povray.text.tutorials : include files with references Server Time
28 Mar 2024 13:17:28 EDT (-0400)
  include files with references (Message 1 to 9 of 9)  
From:
Subject: include files with references
Date: 8 Jul 2002 05:09:10
Message: <kiliiusutk70agk0cbvdldfb2ovtsq6dt4@4ax.com>
Very simple and ready for other improvements addition. If you distribute your
scripts over world (ie for IRTC) and use include files from other authors you
can be interested in unioned inclusion control system. Take a look at below
macro:

example usage:

Include(
  "iso_csg.inc" ,
  "http://www-public.tu-bs.de:8080/~y0013390/pov/ic/" ,
  defined( iso_CSG_Inc_Temp )
)

macro itself:

#version 3.5;
// Include subsystem by ABX (abx### [at] abxartpl) '2002
// Feel free to copy, save and use
// Parameters:
//   IncludeFile - string with name of the file to be included
//   URL         - string link to the page (or directly to zip/pov/inc)
//                 where included file were originally published,
//                 empty string when no place to obtain
//   Included    - boolean result of test whether include file was already
//                 included before, if you can't test it put 'no' there,
//                 usually you can use defined() function to test any of
//                 identifiers from this include file
#macro Include( IncludeFile , URL , Included )
  #if(Included)
    #ifdef(View_POV_Include_Stack)
      #debug concat(IncludeFile," already included\n")
    #end
  #else
    #if(file_exists(IncludeFile))
      #include IncludeFile
    #else
      #debug concat("Warning: ",IncludeFile," is not included. Scripts may not work as
expected becouse\n")
      #debug concat("         identifiers, variables, macros from ",IncludeFile," are
not declared.\n")
      #if(strlen(URL))
        #debug concat("         ",IncludeFile," can be downloaded from ",URL,"\n")
      #end
      #ifdef(View_POV_Include_Stack)
        #debug "         Check that the file is in a directory specifed with a +L
switch\n"
        #debug "         or 'Library_Path=' .INI item. Standard include files are in
the\n"
        #debug "         include directory or folder. Please read your documentation
carefully.\n"
      #end
    #end
  #end
#end

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: include files with references
Date: 8 Jul 2002 05:26:30
Message: <3D295AC6.A143CED0@gmx.de>

> 
> Very simple and ready for other improvements addition. If you distribute your
> scripts over world (ie for IRTC) and use include files from other authors you
> can be interested in unioned inclusion control system. Take a look at below
> macro:

Interesting, further improvement could be to add an automatic downloading
function to Povray retrieving the include file from the specified URL in
such a case.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 30 Jun. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From:
Subject: Re: include files with references
Date: 8 Jul 2002 05:44:46
Message: <9iniiucn0p2ejk5kjodug33hs7smjqkcld@4ax.com>
On Mon, 08 Jul 2002 11:26:30 +0200, Christoph Hormann <chr### [at] gmxde>
wrote:
> Interesting, further improvement could be to add an automatic downloading
> function to Povray retrieving the include file from the specified URL in
> such a case.

I considered this one day and it could be enough to extend file names to
accept urls just like http://www.php.net/manual/en/function.include.php.

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: include files with references
Date: 8 Jul 2002 05:54:43
Message: <3D296163.4B0F66E2@gmx.de>

> 
> I considered this one day and it could be enough to extend file names to
> accept urls just like http://www.php.net/manual/en/function.include.php.
> 

But this would always download the file, even if it is available on the
local machine.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 30 Jun. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From:
Subject: Re: include files with references
Date: 8 Jul 2002 06:11:22
Message: <s4piiu0aan1oclcjnu89jp0clf6v0ag1dn@4ax.com>
On Mon, 08 Jul 2002 11:54:43 +0200, Christoph Hormann <chr### [at] gmxde>
wrote:

> > I considered this one day and it could be enough to extend file names to
> > accept urls just like http://www.php.net/manual/en/function.include.php.
> 
>
> But this would always download the file, even if it is available on the
> local machine.

... with additional apropriate test first :-)

(and additionaly similiar to
http://www.php.net/manual/en/function.include-once.php)

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: include files with references
Date: 8 Jul 2002 07:43:14
Message: <3D297AD2.2C7AF5CE@gmx.de>

> 
> > But this would always download the file, even if it is available on the
> > local machine.
> 
> ... with additional apropriate test first :-)
> 

So would

"http://www.what.ever/directory/file.inc"

make POV-Ray try to #include "file.inc" or "directory/file.inc"?

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 30 Jun. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From:
Subject: Re: include files with references
Date: 8 Jul 2002 07:55:10
Message: <csuiiuoq0arhr47lsrhl1a2elcck46lppc@4ax.com>
On Mon, 08 Jul 2002 13:43:14 +0200, Christoph Hormann <chr### [at] gmxde>
wrote:
> So would
>
> "http://www.what.ever/directory/file.inc"
>
> make POV-Ray try to #include "file.inc" or "directory/file.inc"?

Perhaps it could depend where 'directory/' folder is applied: with URL or with
file name itself. I mean:

Include(
  "iso_csg.inc" ,
  "http://www-public.tu-bs.de:8080/~y0013390/pov/ic/" ,
  defined( iso_CSG_Inc_Temp )
)

or

Include(
  "pov/ic/iso_csg.inc" ,
  "http://www-public.tu-bs.de:8080/~y0013390/" ,
  defined( iso_CSG_Inc_Temp )
)

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: include files with references
Date: 8 Jul 2002 08:22:44
Message: <3D298414.710B8E80@gmx.de>

> 
> Perhaps it could depend where 'directory/' folder is applied: with URL or with
> file name itself. I mean:

This is exactly what i meant, you need to have two strings, one for the
include file and one for the URL.  The URL could also point to a zip
including documentation and sample scenes which would have to be unpacked
by POV-Ray.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 30 Jun. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From:
Subject: Re: include files with references
Date: 8 Jul 2002 08:39:37
Message: <rh1jiuce36dlcl3iisnimnqin2h37jhh51@4ax.com>
On Mon, 08 Jul 2002 14:22:44 +0200, Christoph Hormann <chr### [at] gmxde>
wrote:
> The URL could also point to a zip
> including documentation and sample scenes which would have to be unpacked
> by POV-Ray.

And author's favourite MP3 ;-)

ABX


Post a reply to this message

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