POV-Ray : Newsgroups : povray.newusers : is this a bug? Server Time
4 Nov 2024 23:16:22 EST (-0500)
  is this a bug? (Message 1 to 6 of 6)  
From: Justin Smith
Subject: is this a bug?
Date: 15 Oct 2002 01:30:05
Message: <web.3daba6a220f0896cad7bbeaa0@news.povray.org>
I got an "access violation exception" when I tried to use a macro I created.
The macro is called from within the function block of an isosurface object
(which is itself contained in another macro). Eventually, this macro will
be recursive so as to create the branching structure of a tree.

Here's the relevent part of the isosurface function definition. This isn't
where the actual problem is. I'm just pasting it to show that I've properly
declared my variables referred to later:

#macro broom_trunk(base_radius,Height,ramification,max_fork)
  isosurface
  {
    function
    {
      #declare Blob_Threshold = .05;
      #declare branchDepth = 0;
      #declare iter = array[6];
      #declare Seed = seed(12);
      #local currentCenterX = 0;
      #local currentCenterY = 0;
      #local currentCenterZ = 0;
      #local targetCenterX = 0;
      #local targetCenterY = 0;
      #local targetCenterZ = 0;
      #local width_numerator = -.2;
      #local width_denominator = 49;
      #local move_Y = Height/125;
      #local move_Y_units = Height/5;
      #local targetCenterY = move_Y * move_Y_units;
      (1+Blob_Threshold)
      gen_branch(branchDepth)
    }

Okay, so here is the macro that's causing the problem. I know this is the
one causing the problem because I've commented everything out, and then
progressively
uncommented stuff until I got an error.

#macro gen_branch(branch_depth)
  #declare iter[branch_depth]=0;
  #while(iter[branch_depth] < move_Y_units)

-pow(Blob_Threshold,f_torus(x/(1+(iter[branch_depth]*(width_numerator/width_denominator)))
- currentCenterX,
         y-(iter[branch_depth]/move_Y) - currentCenterY,
         z/(1+(iter[branch_depth]*(width_numerator/width_denominator))) -
currentCenterZ,
         base_radius/(1+branch_depth)),(base_radius/(1+branch_depth)/10)))
    #declare iter[branch_depth] = iter[branch_depth] + 1;
  #end /*

-pow(Blob_Threshold,f_sphere(x/(1+(iter[branch_depth]*(width_numerator/width_denominator)))
- currentCenterX,
       y-(iter[branch_depth]/move_Y) - currentCenterY,
       z/(1+(iter[branch_depth]*(width_numerator/width_denominator))) -
currentCenterZ,
       base_radius/(1+branch_depth)))
  #if(branch_depth < ramification)
    #local numbranches = 2 + rand(Seed)*(max_fork-2);
    #local branchiter = 0;
    #while(branchiter < numbranches)
      #local currentCenterX = targetCenterX +
(rand(Seed)*((base_radius/(1+branch_depth))/2));
      #local currentCenterZ = targetCenterZ +
sqrt(pow((base_radius/(1+branch_depth))/2,2) - pow(currentCenterX,2));
      #local currentCenterY = targetCenterY;
      #local targetCenterX = (Height/(branch_depth+1) );
      #local branchiter = branchiter + 1;
    #end
  #end */
#end

As I paste this now, you may see that a large portion of that is still
commented out. The problem is contained within the while-loop that uses
torus objects. It might be repeated in the 2nd while-loop as well since
they share similar numbers.

I know looking through all that to find a specific answer is probably a bit
much to ask for, and if it is, then even just a general idea of what causes
access violation exceptions might be helpful.

Thanks.


Post a reply to this message

From: ABX
Subject: Re: is this a bug?
Date: 15 Oct 2002 02:40:14
Message: <psdnqu8ca8rc2e0hq1plah57bd7lbobvpa@4ax.com>
On Tue, 15 Oct 2002 01:26:31 EDT, "Justin Smith" <t74### [at] yahoocom> wrote:
> I got an "access violation exception" when I tried to use a macro I created.

Have you checked how many iterations is done before crash ?

ABX


Post a reply to this message

From: Justin Smith
Subject: Re: is this a bug?
Date: 15 Oct 2002 03:05:03
Message: <web.3dabbcfdd8f02cead7bbeaa0@news.povray.org>
ABX wrote:
>On Tue, 15 Oct 2002 01:26:31 EDT, "Justin Smith" <t74### [at] yahoocom> wrote:
>> I got an "access violation exception" when I tried to use a macro I created.
>
>Have you checked how many iterations is done before crash ?
>
>ABX
>
How can I find that out?


Post a reply to this message

From: ABX
Subject: Re: is this a bug?
Date: 15 Oct 2002 03:15:55
Message: <imfnqu8ttgr45pdj32t3pbiupoedd4r9rj@4ax.com>
On Tue, 15 Oct 2002 03:00:13 EDT, "Justin Smith" <t74### [at] yahoocom> wrote:
> > Have you checked how many iterations is done before crash ?
> How can I find that out?

Writing number of current iteration to file ?
You can also verify if the crash appear when you eliminate some elements
(in particular working inside function when 'different' type of parsing is
performed).
I could try it myself but I have no input data you used in your scene. Could
You deliver minimal but complete script for crash replication ?
BTW: there should be some guidelines for bug reporting in documentation of
your installation of POV.

ABX


Post a reply to this message

From: Warp
Subject: Re: is this a bug?
Date: 15 Oct 2002 04:45:22
Message: <3dabd5a2@news.povray.org>
ABX <abx### [at] abxartpl> wrote:
> Writing number of current iteration to file ?

  Wouldn't a simple #debug be handier?

-- 
#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

From: ABX
Subject: Re: is this a bug?
Date: 15 Oct 2002 05:38:32
Message: <p8onqu061cusenhdu8bvsb2jf39bupe2fv@4ax.com>
On 15 Oct 2002 04:45:22 -0400, Warp <war### [at] tagpovrayorg> wrote:
> ABX <abx### [at] abxartpl> wrote:
> > Writing number of current iteration to file ?
>
> Wouldn't a simple #debug be handier?

It can be, but on windows platforms in message windows was observed some
refreshing problems. At least I saw it on more than 2 machines. I'm sure the
file has no problem with refresh :-)

ABX


Post a reply to this message

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