POV-Ray : Newsgroups : povray.advanced-users : iso_csg.inc, #undef, and an array of functions Server Time
28 Jul 2024 16:25:35 EDT (-0400)
  iso_csg.inc, #undef, and an array of functions (Message 1 to 6 of 6)  
From: Jim Charter
Subject: iso_csg.inc, #undef, and an array of functions
Date: 27 Jul 2004 21:29:01
Message: <4107015d$1@news.povray.org>
Using the iso_csg.inc  I was experimenting with the following.
Basically I wanted to substitute iso_csg triangles for mesh elements
which in this case I am getting from arrays ( Verts Faces ). I was 
getting what appeared to be memory errors.  That lead to the following 
script which is an attempt to bite off and process subsets of the mesh 
elements.  The error I am getting is on the attempt to load the array, 
IsoMeshArray, on the second pass.  The message is that I cannot redefine 
a function definition; that I must #undef it first.  But the #undef 
instructions are being exercised.  If, after you get done laughing, 
anyone could point to the problem, it would be very much appreciated.
Thanks, Jim

#declare IsoMeshArray = array [ 16 ];
#local i=0;
#declare indx=0;
#while(i<Totalfaces)
   #if (mod(i,16)=0)
     #if ( i )
        #declare fn_mesh [indx] = IC_Merge_Array ( IsoMeshArray )
        #local j=0;
        #while(j<dimension_size(IsoMeshArray,1))
          #undef IsoMeshArray[j]
          #local j=j+1;
        #end
        #undef IsoMeshArray
        #declare IsoMeshArray = array [ 16 ];
        #declare indx=indx+1;
     #end
   #end

   #if ( indx > 0 )
     #declare IsoMeshArray [i/(indx+1)] =
     IC_Triangle( Verts[Faces[i].x],
                  Verts[Faces[i].y],
                  Verts[Faces[i].z], 0.1);
   #else
     #declare IsoMeshArray [i] =
     IC_Triangle( Verts[Faces[i].x],
		 Verts[Faces[i].y],
		 Verts[Faces[i].z], 0.1);
   #end
   #local i=i+1;
#end


Post a reply to this message

From: Jim Charter
Subject: Re: iso_csg.inc, #undef, and an array of functions
Date: 28 Jul 2004 00:58:17
Message: <41073269$1@news.povray.org>
Jim Charter wrote:
Nevermind, now I see :(


Post a reply to this message

From: ABX
Subject: Re: iso_csg.inc, #undef, and an array of functions
Date: 28 Jul 2004 02:18:13
Message: <g4heg0pq9s9jmfvd67i0ssiei85nrr1gju@4ax.com>
On Tue, 27 Jul 2004 21:33:58 -0400, Jim Charter <jrc### [at] msncom> wrote:
> Basically I wanted to substitute iso_csg triangles

Ah, I thought nobody will ever use triangle function :-)

ABX


Post a reply to this message

From: Mike Williams
Subject: iso_csg.inc, #undef, and an array of functions
Date: 28 Jul 2004 04:14:21
Message: <CTs8aFAK$1BBFwGc@econym.demon.co.uk>
Wasn't it Jim Charter who wrote:
>Using the iso_csg.inc  I was experimenting with the following.
>Basically I wanted to substitute iso_csg triangles for mesh elements
>which in this case I am getting from arrays ( Verts Faces ). I was 
>getting what appeared to be memory errors.  That lead to the following 
>script which is an attempt to bite off and process subsets of the mesh 
>elements.  The error I am getting is on the attempt to load the array, 
>IsoMeshArray, on the second pass.  The message is that I cannot redefine 
>a function definition; that I must #undef it first.  But the #undef 
>instructions are being exercised.  If, after you get done laughing, 
>anyone could point to the problem, it would be very much appreciated.
>Thanks, Jim

That chunk of code ran without error (once I'd added a wodge of
#declares and #includes of stuff that it expected to find). I guess your
error might not be in this code. Perhaps some other part of your scene
outside this code fragment is inadvertently redeclaring IsoMeshArray.

Perhaps you could post a small complete scene that exhibits the problem,
rather than a code fragment that doesn't run stand-alone.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Jim Charter
Subject: Re: iso_csg.inc, #undef, and an array of functions
Date: 28 Jul 2004 11:17:29
Message: <4107c389$1@news.povray.org>
Mike Williams wrote:

> That chunk of code ran without error (once I'd added a wodge of
> #declares and #includes of stuff that it expected to find). I guess your
> error might not be in this code. Perhaps some other part of your scene
> outside this code fragment is inadvertently redeclaring IsoMeshArray.
> 
> Perhaps you could post a small complete scene that exhibits the problem,
> rather than a code fragment that doesn't run stand-alone.
> 

Sorry about that.

I believe this line was the error:
#declare IsoMeshArray [i/(indx+1)] =
It's not just that it lead to the error. It made no sense.

Should have been:
#declare IsoMeshArray [i/(indx*16)] =

I could have developed that part of the code without using the 
unfamiliar stuff, then added the iso_csg syntax.  So I am embarrassed 
all round.  Jim


Post a reply to this message

From: Jim Charter
Subject: Re: iso_csg.inc, #undef, and an array of functions
Date: 28 Jul 2004 11:34:34
Message: <4107c78a$1@news.povray.org>
ABX wrote:

> On Tue, 27 Jul 2004 21:33:58 -0400, Jim Charter <jrc### [at] msncom> wrote:
> 
>>Basically I wanted to substitute iso_csg triangles
> 
> 
> Ah, I thought nobody will ever use triangle function :-)
> 
> ABX
I works very well, but only in low volumes it seems so far.


Post a reply to this message

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