POV-Ray : Newsgroups : povray.general : Blob of a Union Server Time
8 Jul 2024 12:45:58 EDT (-0400)
  Blob of a Union (Message 1 to 5 of 5)  
From: Simulator
Subject: Blob of a Union
Date: 16 Jan 2014 06:30:00
Message: <web.52d7c1e0801d29d5e9d526ea0@news.povray.org>
I use a visualization software that generates pov ray files. I have the
following declared

#declare VertGlyph = object { sphere {<0,0,0>,1} };

#declare vertex_geometry = union
{
#declare vertctr=0;
#while (vertctr < nverts0000)
#declare vertvalue=ptscalars[verts[vertctr][1]];
      object {
        VertGlyph
        scale VertScaleFunction(vertvalue)
        translate pts[verts[vertctr][1]]
      }
#declare vertctr = vertctr+1;
#end
};

Then the geometry is instantiated as
object {
    vertex_geometry
}

vertex_geometry is basically a bunch of spheres that were declared (not shown
here). I want a blob of all these spheres. I tried the blob around the object
within the while loop in the union. And I also tried the blob command at the
instantiation step around vertex_geometry. In both cases I get the error that
"Parse Error: Need at least one component in a blob."
Is there something wrong because "union" is used? How can I achieve a blob of a
bunch of spheres from the above code?


Post a reply to this message

From: Fractracer
Subject: Re: Blob of a Union
Date: 16 Jan 2014 10:00:00
Message: <web.52d7f373b8e8949aa3bacff10@news.povray.org>
"Simulator" <nomail@nomail> wrote:
> I use a visualization software that generates pov ray files. I have the
> following declared
>
> #declare VertGlyph = object { sphere {<0,0,0>,1} };
>
> #declare vertex_geometry = union
> {
> #declare vertctr=0;
> #while (vertctr < nverts0000)
> #declare vertvalue=ptscalars[verts[vertctr][1]];
>       object {
>         VertGlyph
>         scale VertScaleFunction(vertvalue)
>         translate pts[verts[vertctr][1]]
>       }
> #declare vertctr = vertctr+1;
> #end
> };
>
> Then the geometry is instantiated as
> object {
>     vertex_geometry
> }
>
> vertex_geometry is basically a bunch of spheres that were declared (not shown
> here). I want a blob of all these spheres. I tried the blob around the object
> within the while loop in the union. And I also tried the blob command at the
> instantiation step around vertex_geometry. In both cases I get the error that
> "Parse Error: Need at least one component in a blob."
> Is there something wrong because "union" is used? How can I achieve a blob of a
> bunch of spheres from the above code?

I think you have to replace the code like this:

#declare vertex_geometry = blob {
   #declare vertctr=0;
   #while (vertctr < nverts0000)
   #declare vertvalue=ptscalars[verts[vertctr][1]];
     sphere {
         {<0,0,0>,1, 0.8
        scale VertScaleFunction(vertvalue)
        translate pts[verts[vertctr][1]]
    }
#declare vertctr = vertctr+1;
#end
};

I hope there is no error in my code.


Post a reply to this message

From: clipka
Subject: Re: Blob of a Union
Date: 16 Jan 2014 10:00:08
Message: <52d7f3f8$1@news.povray.org>
Am 16.01.2014 12:26, schrieb Simulator:
> I use a visualization software that generates pov ray files. I have the
> following declared
>
> #declare VertGlyph = object { sphere {<0,0,0>,1} };

You should better make this a macro, otherwise it won't work with blobs. 
(The "sphere" statements in blobs aren't objects proper.)

E.g.:

#macro VertGlyph(Radius,Pos)
   sphere { Pos, Radius, strength 1.0 }
#end

> #declare vertex_geometry = union
> {
> #declare vertctr=0;
> #while (vertctr < nverts0000)
> #declare vertvalue=ptscalars[verts[vertctr][1]];
>        object {
>          VertGlyph
>          scale VertScaleFunction(vertvalue)
>          translate pts[verts[vertctr][1]]
>        }
> #declare vertctr = vertctr+1;
> #end
> };

You should then be able to modify the vertex_geometry as follows:

#declare vertex_geometry = blob
{
#declare vertctr=0;
#while (vertctr < nverts0000)
#declare vertvalue=ptscalars[verts[vertctr][1]];
          VertGlyph(
            VertScaleFunction(vertvalue),
            pts[verts[vertctr][1]]
        )
#declare vertctr = vertctr+1;
#end
};

(BTW, POV-Ray now supports a #for statement that makes counted loops 
easier.)


Post a reply to this message

From: Simulator
Subject: Re: Blob of a Union
Date: 17 Jan 2014 01:10:00
Message: <web.52d8c8b7b8e8949ae9d526ea0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 16.01.2014 12:26, schrieb Simulator:
> > I use a visualization software that generates pov ray files. I have the
> > following declared
> >
> > #declare VertGlyph = object { sphere {<0,0,0>,1} };
>
> You should better make this a macro, otherwise it won't work with blobs.
> (The "sphere" statements in blobs aren't objects proper.)
>
> E.g.:
>
> #macro VertGlyph(Radius,Pos)
>    sphere { Pos, Radius, strength 1.0 }
> #end
>
> > #declare vertex_geometry = union
> > {
> > #declare vertctr=0;
> > #while (vertctr < nverts0000)
> > #declare vertvalue=ptscalars[verts[vertctr][1]];
> >        object {
> >          VertGlyph
> >          scale VertScaleFunction(vertvalue)
> >          translate pts[verts[vertctr][1]]
> >        }
> > #declare vertctr = vertctr+1;
> > #end
> > };
>
> You should then be able to modify the vertex_geometry as follows:
>
> #declare vertex_geometry = blob
> {
> #declare vertctr=0;
> #while (vertctr < nverts0000)
> #declare vertvalue=ptscalars[verts[vertctr][1]];
>           VertGlyph(
>             VertScaleFunction(vertvalue),
>             pts[verts[vertctr][1]]
>         )
> #declare vertctr = vertctr+1;
> #end
> };
>
> (BTW, POV-Ray now supports a #for statement that makes counted loops
> easier.)


I have tried this an the above suggestions. I still get the same error "Need at
least one component in blob."


Post a reply to this message

From: clipka
Subject: Re: Blob of a Union
Date: 17 Jan 2014 11:02:15
Message: <52d95407@news.povray.org>
Am 17.01.2014 07:07, schrieb Simulator:

>> You should then be able to modify the vertex_geometry as follows:
>>
>> #declare vertex_geometry = blob
>> {
>> #declare vertctr=0;
>> #while (vertctr < nverts0000)
>> #declare vertvalue=ptscalars[verts[vertctr][1]];
>>            VertGlyph(
>>              VertScaleFunction(vertvalue),
>>              pts[verts[vertctr][1]]
>>          )
>> #declare vertctr = vertctr+1;
>> #end
>> };
>>
>> (BTW, POV-Ray now supports a #for statement that makes counted loops
>> easier.)
>
>
> I have tried this an the above suggestions. I still get the same error "Need at
> least one component in blob."

Are you sure "nverts0000" is set to a positive value?


Post a reply to this message

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