|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi there!
Just out of curiousity: while you are free to define nearly everything
#local my_shape =
sphere { ... }
// inside the my_shape.inc
and
#include "my_shape.inc"
object {my_shape}
// inside the main .pov-file
work?
Thanks
Steely
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Steely" <nomail@nomail> wrote in message
news:web.425591b4f49c80836fd49c30@news.povray.org...
> Hi there!
>
> Just out of curiousity: while you are free to define nearly everything
this:
>
> #local my_shape =
> sphere { ... }
> // inside the my_shape.inc
>
> and
>
> #include "my_shape.inc"
> object {my_shape}
> // inside the main .pov-file
>
> work?
>
> Thanks
>
> Steely
>
#local is for things that are only available in the file (or in the case of
a macro, available only in the macro) which they are defined in, to my
understanding. if you want it to be available from an included file, it has
to be #declared
3.1.2.2.2 #declare vs. #local
-ross
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Steely <nomail@nomail> wrote:
> Just out of curiousity: while you are free to define nearly everything
> #local my_shape =
> sphere { ... }
> // inside the my_shape.inc
> and
> #include "my_shape.inc"
> object {my_shape}
> // inside the main .pov-file
Well, that's exactly what #local is supposed to do. That's why it
exists in the first place. (Why would it even exist otherwise?)
--
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp <war### [at] tagpovrayorg> wrote:
> Well, that's exactly what #local is supposed to do. That's why it
> exists in the first place. (Why would it even exist otherwise?)
>
Steely
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Steely <nomail@nomail> wrote:
I don't really understand what you are asking.
#local is a special version of #declare which limits the visibility
of an identifier inside the include file or the macro in which it is
used. That is the precise purpose of #local. It helps to keep the
global namespace of identifiers cleaner (to avoid name collisions).
If something has been declared #local in an include file then it is
something private to that include file, not intended to be seen from
the outside (and thus potentially collide with something having the
same name somewhere else).
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Yes, thanks for explaining. I know this, and still there are lots of cases I
can think of, where it would be nice to have different includes with
different shapes with the same identifier. But as I said in the first post,
S.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |