|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I'm writing a macro that takes the union of from 1 to n objects. If there
is one object, POV rightfully issues a warning message. How can I get
around the problem? If POV had a null object, I could always include that
in the union.
Thanks in Advance.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Wed, 1 Oct 2003 07:02:36 EDT, "mmm" <mik### [at] comcastnet> wrote:
> I'm writing a macro that takes the union of from 1 to n objects. If there
> is one object, POV rightfully issues a warning message. How can I get
> around the problem?
Is below sufficient ?
#macro Get_Nth_Object(Nth) // Nth is 0-based
sphere{ ... }
#end
#macro Get_Objects_In_One_Body(N)
#if(N=1)
#local Object = Get_Nth_Object(0)
#else
#local Object = union{
#local Counter = 0;
#while (Counter < N )
Get_Nth_Object(Counter)
#local Counter = Counter + 1;
#end
}
#end
Object
#end
difference{
object{ Get_Objects_In_One_Body(3) }
object{ Get_Objects_In_One_Body(1) }
}
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I'm writing a macro that takes the union of from 1 to n objects.
> If there is one object, POV rightfully issues a warning message.
> How can I get around the problem? If POV had a null object, I
> could always include that in the union.
Well I guess a box {0,0} would act as a null object ?
--
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"mmm" <mik### [at] comcastnet> wrote in message
news:web.3f7ab44c4e1728de48fe3750@news.povray.org...
> is one object, POV rightfully issues a warning message. How can I get
Ignore the warning? Is the warning causing you a specific problem, or is your
objection to it purely aesthetic?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
#if(there will be only 1 object)
create the object alone
#else
union
{
create the objects
}
#end
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
OTOH, if the object creation is complicated, you might want to try
this idea instead:
#if(there will be more than 1 object)
union {
#else
object {
#end
create object(s) here
}
--
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 already gave that reply, but with a chunk of #if around it, so I
thought I'd put it here for simplicity:
union{} takes several objects.
object{} takes just one.
So, instead of union{}, just use object{}, but once you'll use more than one
actual object there, I think POV-Ray issues not only a warning, but stops as
well. That's the point where Warp's #if come in: check if you actually have
one or more objects, and then use object{}/union{} as required.
Greets,
Tim
--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: tim.nikias (@) gmx.de
> I'm writing a macro that takes the union of from 1 to n objects. If there
> is one object, POV rightfully issues a warning message. How can I get
> around the problem? If POV had a null object, I could always include that
> in the union.
> Thanks in Advance.
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23.09.2003
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
mmm wrote:
>I'm writing a macro that takes the union of from 1 to n objects. If there
>is one object, POV rightfully issues a warning message. How can I get
>around the problem? If POV had a null object, I could always include that
>in the union.
>Thanks in Advance.
>
Thanks for the thoughts and possible solutions. The solution by Warp and
Tim will do nicely in my application.
.... mmm
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Well I guess a box {0,0} would act as a null object ?
Actually it still contains one point.
My null object currently is union {} - I ignore the first warning.
--
merge{#local i=-11;#while(i<11)#local
i=i+.1;sphere{<i*(i*i*(.05-i*i*(4e-7*i*i+3e-4))-3)10*sin(i)30>.5}#end
pigment{rgbt 1}interior{media{emission x}}hollow}// Mark Weyer
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
news:3f7abd2c$1@news.povray.org...
> "mmm" <mik### [at] comcastnet> wrote in message
> news:web.3f7ab44c4e1728de48fe3750@news.povray.org...
> Ignore the warning? Is the warning causing you a specific problem, or is
your
> objection to it purely aesthetic?
In fact, warning messages can be a real problem. A long parsing loop issuing
that sort of warning can make the parsing extremely slow. Ditto with some of
the isosurface warnings.
For instance :
#declare i=0;union{#while (i<100000)union{sphere{0,1 translate x*i}}#declare
i=i+1;#end
takes 2 min 10 to parse on my machine, instead of 10s if no union is used.
Though much preferable, making a check isn't always easy and can increase
the parsing time so there are some cases where it's just more practical to
turn the messages off with -GW if they become a nuisance.
G.
--
**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |