POV-Ray : Newsgroups : povray.advanced-users : Help with MegaPov 1.o Mech Sim feature Server Time
1 Nov 2024 01:20:55 EDT (-0400)
  Help with MegaPov 1.o Mech Sim feature (Message 1 to 3 of 3)  
From: Merrin
Subject: Help with MegaPov 1.o Mech Sim feature
Date: 16 Aug 2003 08:59:52
Message: <3f3e2ac8$1@news.povray.org>
I am trying to use the mechsim feature to create a sail. The problem is that
I keep getting a "mass index out of range" error. Can anybody tell me what
this error indicates, so that I can fix the problem? I am stumped.

Here is the code I am using if it helps.




#declare SailArray = array[50][50];

#declare A1X = -16000+200+ (16000+200 -
cos(radians(SpankerBoomRotate))*(16000+200));
#declare A1Y = 4200;
#declare A1Z = sin(radians(SpankerBoomRotate))*(16000+200);

#declare A4X = -200;
#declare A4Y = 300;
#declare A4Z = 0;

#declare D1X = -9000 + (9000 - cos(radians(SpankerGaffRotate))*9000);
#declare D1Y = 17500;
#declare D1Z = sin(radians(SpankerGaffRotate))*9000;

#declare D4X = -200;
#declare D4Y = 11300;
#declare D4Z = 0;

#declare B4X = -200;
#declare B4Z = 0;

#declare C4X = -200;
#declare C4Z = 0;


//#declare SailArray [0][0] = <A1X,A1Y,A1Z>;
//#declare SailArray [49][0] = <A4X,A4Y,A4Z>;

//create points on outline of sail
#declare n=0;
#while(n<50)
        #declare SailArray [n][49] = <D4X,D4Y,D4Z> +
<n*(D1X-D4X)/49,n*(D1Y-D4Y)/49,0>;

        #declare SailArray [n][0] = <A4X,A4Y,A4Z> +
<n*(A1X-A4X)/49,n*(A1Y-A4Y)/49,0>;

        #declare SailArray [49][n] = <A4X,A4Y,A4Z> +
<n*(D4X-A4X)/49,n*(D4Y-A4Y)/49,0>;

        #declare SailArray [0][n] = <A1X,A1Y,A1Z> +
<n*(D1X-A1X)/49,n*(D1Y-A1Y)/49,0>;

        #declare n=n+1;
#end


//creat points on inside of sail
#declare n=1;
#while(n<49)

        #declare i = 1;
        #while(i<49)
                #declare SailArray [n][i] = <SailArray [n][0].x,SailArray
[n][0].y,SailArray [n][0].z> + <i*(SailArray [n][49].x-SailArray
[n][0].x)/49,i*(SailArray [n][49].y-SailArray [n][0].y)/49,0>;


                #declare i = i +1;
        #end

        #declare n=n+1;
#end

//Create sail


global_settings {
        assumed_gamma 1.0

        mechsim {
                gravity <0, -9.81, 0>
                method 1

                #if (clock_on)
                        step_count 100
                        time_step (1/30)/800

                        topology {
                        load_file "SpankerSail.dat"
                        save_file "SpankerSail.dat"
                        }
                #else
                        step_count 0

                        topology {

                                mass { <SailArray [0][0].x, SailArray
[0][0].y, SailArray [0][0].z>, <0, 0, 0>, 100 density 5 fixed on }
                                mass { <SailArray [0][1].x, SailArray
[0][1].y, SailArray [0][1].z>, <0, 0, 0>, 100 density 5 fixed on }


                                save_file "SpankerSail.dat"
                        }
                #end
        }
}




MechSim_Show_All_Objects(-1, false, -1, "")


Thanks for taking a look at this,

Tim


Post a reply to this message

From: Christoph Hormann
Subject: Re: Help with MegaPov 1.o Mech Sim feature
Date: 16 Aug 2003 09:47:01
Message: <3F3E35D4.CAC0CFB8@gmx.de>
Merrin wrote:
> 
> I am trying to use the mechsim feature to create a sail. The problem is that
> I keep getting a "mass index out of range" error. Can anybody tell me what
> this error indicates, so that I can fix the problem? I am stumped.
> 
> Here is the code I am using if it helps.
> 
> [...]

Without needing to test - this code won't generate an Error saying "mass
index out of range".  The only possible error messages containing these
words are generated when you create a connection or face referencing a
non-existing mass.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 17 Jun. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Merrin
Subject: Re: Help with MegaPov 1.o Mech Sim feature
Date: 16 Aug 2003 10:29:12
Message: <3f3e3fb8$1@news.povray.org>
Thak you very much Christoph, I found the error in a earlier piece of code
thanks to your help.

Tim


"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:3F3E35D4.CAC0CFB8@gmx.de...
>
>
> Merrin wrote:
> >
> > I am trying to use the mechsim feature to create a sail. The problem is
that
> > I keep getting a "mass index out of range" error. Can anybody tell me
what
> > this error indicates, so that I can fix the problem? I am stumped.
> >
> > Here is the code I am using if it helps.
> >
> > [...]
>
> Without needing to test - this code won't generate an Error saying "mass
> index out of range".  The only possible error messages containing these
> words are generated when you create a connection or face referencing a
> non-existing mass.
>
> Christoph
>
> -- 
> POV-Ray tutorials, include files, Sim-POV,
> HCR-Edit and more: http://www.tu-bs.de/~y0013390/
> Last updated 17 Jun. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

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