POV-Ray : Newsgroups : povray.general : macro - without () Server Time
5 Aug 2024 14:19:39 EDT (-0400)
  macro - without () (Message 25 to 34 of 34)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Pabs
Subject: Re: macro - without ()
Date: 3 Oct 2002 02:49:45
Message: <3D9BE741.7359C354@nospam_zip.to>
I put the following lines around objects to remove them
/*
// */
and add an extra slash to put them back
//*
// */
You could also do the same with #if(0)/#if(1)

Bye,
Pabs


Post a reply to this message

From: John VanSickle
Subject: Re: macro - without ()
Date: 3 Oct 2002 14:37:02
Message: <3D9C8E55.221670BE@hotmail.com>
Rafal 'Raf256' Maj wrote:
> 
> Would it be a big problem to allow syntax  :
> 
> #macro finWater1 reflection { .01 .2 } #end
> finish { finWater1 }
> 
> instead of  finish { finWater1() }
> 
> this is a small change [probably] and shorten syntax is more comfortable
> 
> btw. this will make pov macros act more like C preprocesor macros

Is there a scene you can't render because of this?  If not, the
POV-Ray team have bigger fish to fry.

Regards,
John


Post a reply to this message

From: Jellby
Subject: Re: macro - without ()
Date: 3 Oct 2002 15:50:16
Message: <3d9c9f77@news.povray.org>
Rafal 'Raf256' Maj wrote:

> "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote in
> news:Xns### [at] 204213191226
> 
>> Would it be a big problem to allow syntax  :
> [...]
> 
> and another request, in connection with previous post - keyword ignore
> that can be added to any object. It will 'kill' the object.
> 
> Why ?
> Simple - it's very usefull while i.e. 'debugging' scene - if I have object
> long at 100 lines like :
> difference { ... union { ... } merge { ... union { ... }
>   ...
>   ignore
> }
> addning / removing "ignore" is much faster then commenting all 100 lines
> or
> putting them into  #if (0) ... #end
> 
> 
> Why connection with no "()" macros ? because creating ignore keyword can
> be done in POV already :
>   #macro ignore() translate 1e50 #end
>   (this will work for most objects)
> But it must be used as :
>   object { ... ignore() }   instead of :
>   object { ... ignore }
> (without no-()-macros syntax)
> 
> 

What about scale 0 (or 1e-50)? Is this prohibited? does this give errors? It 
maybe wouldn't work with infinite objects, but it might be useful.


Post a reply to this message

From: Christopher James Huff
Subject: Re: macro - without ()
Date: 3 Oct 2002 19:29:13
Message: <chrishuff-5345CF.19254803102002@netplex.aussie.org>
In article <3d9c9f77@news.povray.org>,
 Jellby <jel### [at] M-softhomenet> wrote:

> What about scale 0 (or 1e-50)? Is this prohibited? does this give errors? It 
> maybe wouldn't work with infinite objects, but it might be useful.

Forbidden, you can't scale by 0, or any other size lower than EPSILON, 
on any dimension. You could scale it very small, but the effects will be 
dependant on the original size, and it will still take processing power. 
If you want to temporarily remove an object, the best way is to simply 
comment it out. I don't understand the reasoning behind looking for 
worse ways to do the same thing.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: macro - without ()
Date: 4 Oct 2002 06:52:51
Message: <Xns929D82C0E5138raf256com@204.213.191.226>
Jellby <jel### [at] M-softhomenet> wrote in
news:3d9c9f77@news.povray.org 

> What about scale 0 (or 1e-50)? Is this prohibited? does this give
> errors? It maybe wouldn't work with infinite objects, but it might be
> useful. 

i.e.
scale x*a = scale <a,0,0> 
is interpreted like scale  <a,1,1>

-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: macro - without ()
Date: 4 Oct 2002 06:54:39
Message: <Xns929D830D1122Braf256com@204.213.191.226>
John VanSickle <evi### [at] hotmailcom> wrote in 
news:3D9C8E55.221670BE@hotmail.com

> Is there a scene you can't render because of this?  If not, the
> POV-Ray team have bigger fish to fry.

I don't agree with this philosofi - what about i.e. new POV-logo, auto-
completition-of-keywords (ctrl_space), new insert mewnu etc.


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Tom Melly
Subject: Re: macro - without ()
Date: 4 Oct 2002 07:18:32
Message: <3d9d7908$1@news.povray.org>
"Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote in message
news:Xns### [at] 204213191226...

> I don't agree with this philosofi - what about i.e. new POV-logo, auto-
> completition-of-keywords (ctrl_space), new insert mewnu etc.
>

A very different set of cases - ignoring the logo, the rest only affect the
windows front end, which has nothing to do with the pov engine - more of an IDE
issue, and IDE's are constantly being revised.

I think the problem here is philosophical, but it's your philosophy that's in a
muddle.

Pov essentially allows you to do what you want to do - you just have to write
your scenes implementing the pov way of doing it. You might as well complain
that perl doesn't allow you to omit the ; from terminating each line, or that C
doesn't allow you to <some C syntax stuff>.

The point is, you're complaining about something as though you can't do it, when
you can, and very easily.

Take a look at most user's complex pov-scripts and you will see a whole bunch of
stuff like:

#declare do_grass = false;
#declare do_tree = false;
#declare do_big_time_consuming_media = false;


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: [long][ot]macro - without ()
Date: 4 Oct 2002 07:53:51
Message: <Xns929D8D1369996raf256com@204.213.191.226>
"Tom Melly" <tom### [at] tomandlucouk> wrote in
news:3d9d7908$1@news.povray.org 

> The point is, you're complaining about something as though you can't
> do it, when you can, and very easily.

Where I'm *complaining* ?
 
> Take a look at most user's complex pov-scripts and you will see a
> whole bunch of stuff like:
> #declare do_grass = false;
> #declare do_tree = false;
> #declare do_big_time_consuming_media = false;

Realy this isn't *complex* ;) Complex is i.e. signeture :)
Alsow this code is simple :

#debug "\n======================================================\n"
#ifndef (using_ini)
  #debug "*** NOT using INI file ***\n"
  #include "cfg/1std.inc"
  #include "comp/1space.inc"
  #include "data/1atom1.inc" 
  #include "qq/0turbo.inc"
  #declare DbgAny=1;
#else  
  #debug "*** Including setup files (as ordered in .INI) ***\n"
  #declare iniNames=array[2]{"0custom","1std"}  
  #include concat("cfg/",iniNames[inc_file_cfg],".inc") 
  #declare iniNames=array[2]{"0custom","1space"}  
  #include concat("comp/",iniNames[inc_file_comp],".inc") 
  #declare iniNames=array[2]{"0custom","1atom1"}  
  #include concat("data/",iniNames[inc_file_data],".inc") 
  #declare 
iniNames=array[6]{"0turbo","1fast","2good","3nice","4best","5photo"}
  #include concat("qq/",iniNames[inc_file_qq],".inc")  
  #declare DbgAny=0;
#end
// --- [debug] -----------------------------------------
#declare ShowIsosBounding = 0 *DbgAny; // 0/1 show isosurface bounding                
 
#declare ObjectShadowTest = 0 *DbgAny; // 0/1 special objects for shadow

btw. it contians workaround for one "problem" - declare in INI accept's 
only float (strings are disallowed).
.INI file is :

[...]
declare=using_ini=1
declare=inc_file_cfg=1
declare=inc_file_comp=1
declare=inc_file_data=1
declare=inc_file_qq=3

Maybe ther is nicer workaround ? I would prefere to have in .INI
  declare=inc_file_comp=space
  declare=inc_file_data=atom1
and AFAIK this is possible if I add to .pov code :
  #declare space=1;  #declare outdoor=1;
  #declare atom1=1;  #declare h2o=2;
but this comolicate even more .POV  ini-options-parsing code

-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: macro - without ()
Date: 4 Oct 2002 13:56:04
Message: <3d9dd634$1@news.povray.org>
In article <Xns### [at] 204213191226>, "Rafal 'Raf256' Maj"
<raf### [at] raf256com> wrote:

> scale x*a = scale <a,0,0>
> is interpreted like scale  <a,1,1>

Well, it is not magically interpreted this way.  A warning is given, of
course!

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: ABX
Subject: Re: macro - without ()
Date: 7 Oct 2002 05:50:59
Message: <7kl2qugf0ki5tdigongsl2tglbc7df2jvo@4ax.com>
On 4 Oct 2002 06:54:39 -0400, "Rafal 'Raf256' Maj" <raf### [at] raf256com> wrote:
> I don't agree with this philosofi - what about i.e. new POV-logo

POV-logo was made by community in opened contest. The product has to have
readable, well designed, popular, logo.

> auto-completition-of-keywords (ctrl_space)

It is a feature of editor popular in so many editors while 'ignore' looks like
checkbox moved from gui.

> new insert mewnu etc.

insert menu was created with cooperation of community. it is veeery usefull.
much more then 'ignore' addition.

ABX


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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