POV-Ray : Newsgroups : povray.newusers : Import of measurement data (ASCII format) in animation Server Time
20 Apr 2024 08:11:57 EDT (-0400)
  Import of measurement data (ASCII format) in animation (Message 2 to 11 of 34)  
<<< Previous 1 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Stephen
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 25 Feb 2016 07:58:55
Message: <56cefa8f$1@news.povray.org>
On 2/25/2016 12:17 PM, JorgeAE wrote:
> Hi!
> My name is Jorge. I started using POV-Ray a couple of days ago, so I am actually
> a not very experienced POV-Ray user
>
> I have a question regarding an animation which is supposed to reproduce the
> vibration of a metal plate, that was taken at six different points of the
> plate. The measured values are available in ASCII format.
>
> So far, I know how to define a simple geometry (scene) and start an animation
> with the help of the "clock" command. However, my task is to design a metal
> plate which vibrates according to the vibration values taken at the 6 different
> points of the plate mentioned before. For this reason, I am actually supposed to
> import the vibration data to my POV-Ray code and assign it to 6 points in my
> geometry.
>
> I don't know how this should be implemented and have not found any similar
> example in the web, so I it would be great if someone could give some ideas or
> tips on how to do it.
>
> Thank you very much!
> Jorge
>
>
>

Hi Jorge and welcome.

You could use triangles to build your metal plate.
With only 6 data points you could do that manually. If you had more you 
could build a mesh.

You could define the data points as an array and read the values from a 
file.

Help sections.
3.3.1.10 Array

3.4.5.2.3 Mesh
3.4.5.2.6 Triangle

3.3.2.3 File I/O Directives


-- 

Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 25 Feb 2016 12:22:50
Message: <56cf386a$1@news.povray.org>
Le 16-02-25 07:58, Stephen a écrit :
> On 2/25/2016 12:17 PM, JorgeAE wrote:
>> Hi!
>> My name is Jorge. I started using POV-Ray a couple of days ago, so I
>> am actually
>> a not very experienced POV-Ray user
>>
>> I have a question regarding an animation which is supposed to
>> reproduce the
>> vibration of a metal plate, that was taken at six different points of the
>> plate. The measured values are available in ASCII format.
>>
>> So far, I know how to define a simple geometry (scene) and start an
>> animation
>> with the help of the "clock" command. However, my task is to design a
>> metal
>> plate which vibrates according to the vibration values taken at the 6
>> different
>> points of the plate mentioned before. For this reason, I am actually
>> supposed to
>> import the vibration data to my POV-Ray code and assign it to 6 points
>> in my
>> geometry.
>>
>> I don't know how this should be implemented and have not found any
>> similar
>> example in the web, so I it would be great if someone could give some
>> ideas or
>> tips on how to do it.
>>
>> Thank you very much!
>> Jorge
>>
>>
>>
>
> Hi Jorge and welcome.
>
> You could use triangles to build your metal plate.
> With only 6 data points you could do that manually. If you had more you
> could build a mesh.
>
> You could define the data points as an array and read the values from a
> file.
>
> Help sections.
> 3.3.1.10 Array
>
> 3.4.5.2.3 Mesh
> 3.4.5.2.6 Triangle
>
> 3.3.2.3 File I/O Directives
>
>


Once the triangles are defined, making them into a mesh is very easy. 
Just add "mesh{" before your triangles and a "}" after. That's all there 
is to do.

If you plan of having multiple views of your plate in a single scene, 
this is the way to go.
First define your plate as an object:
Use "#declare Plate = mesh{ Your_Triangles}

Next, place your plate at various locations and orientations:
object{Plate rotate <-5,0,0> translate <0,10,0>}
object{Plate rotate <0,60,0> translate <17,-3,0>}
object{Plate rotate <90,0,60> translate <-17,-3,0>}

This will gives you 3 different views of your plate.


Alain


Post a reply to this message

From: scott
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 26 Feb 2016 06:47:28
Message: <56d03b50$1@news.povray.org>
> I have a question regarding an animation which is supposed to reproduce the
> vibration of a metal plate, that was taken at six different points of the
> plate. The measured values are available in ASCII format.
>
> So far, I know how to define a simple geometry (scene) and start an animation
> with the help of the "clock" command. However, my task is to design a metal
> plate which vibrates according to the vibration values taken at the 6 different
> points of the plate mentioned before. For this reason, I am actually supposed to
> import the vibration data to my POV-Ray code and assign it to 6 points in my
> geometry.

I would read in all the points from the ASCII file to an array first. 
Look up "#read" and "array" in the help, you should be able to figure 
out how to do it.

Then, you can choose which value to use from the array based on the 
"clock" value.

Once you've got that working, you might then want to experiment with 
doing some kind of linear interpolation between frames to get a smoother 
animation.


Post a reply to this message

From: JorgeAE
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 26 Feb 2016 08:20:00
Message: <web.56d04f85a405651bb52369120@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> Le 16-02-25 07:58, Stephen a écrit :
> > On 2/25/2016 12:17 PM, JorgeAE wrote:
> >> Hi!
> >> My name is Jorge. I started using POV-Ray a couple of days ago, so I
> >> am actually
> >> a not very experienced POV-Ray user
> >>
> >> I have a question regarding an animation which is supposed to
> >> reproduce the
> >> vibration of a metal plate, that was taken at six different points of the
> >> plate. The measured values are available in ASCII format.
> >>
> >> So far, I know how to define a simple geometry (scene) and start an
> >> animation
> >> with the help of the "clock" command. However, my task is to design a
> >> metal
> >> plate which vibrates according to the vibration values taken at the 6
> >> different
> >> points of the plate mentioned before. For this reason, I am actually
> >> supposed to
> >> import the vibration data to my POV-Ray code and assign it to 6 points
> >> in my
> >> geometry.
> >>
> >> I don't know how this should be implemented and have not found any
> >> similar
> >> example in the web, so I it would be great if someone could give some
> >> ideas or
> >> tips on how to do it.
> >>
> >> Thank you very much!
> >> Jorge
> >>
> >>
> >>
> >
> > Hi Jorge and welcome.
> >
> > You could use triangles to build your metal plate.
> > With only 6 data points you could do that manually. If you had more you
> > could build a mesh.
> >
> > You could define the data points as an array and read the values from a
> > file.
> >
> > Help sections.
> > 3.3.1.10 Array
> >
> > 3.4.5.2.3 Mesh
> > 3.4.5.2.6 Triangle
> >
> > 3.3.2.3 File I/O Directives
> >
> >
>
>
> Once the triangles are defined, making them into a mesh is very easy.
> Just add "mesh{" before your triangles and a "}" after. That's all there
> is to do.
>
> If you plan of having multiple views of your plate in a single scene,
> this is the way to go.
> First define your plate as an object:
> Use "#declare Plate = mesh{ Your_Triangles}
>
> Next, place your plate at various locations and orientations:
> object{Plate rotate <-5,0,0> translate <0,10,0>}
> object{Plate rotate <0,60,0> translate <17,-3,0>}
> object{Plate rotate <90,0,60> translate <-17,-3,0>}
>
> This will gives you 3 different views of your plate.
>
>
> Alain

Hello Stephen and Alain,

thank you very much for your answers, both of them were very helpfull!! I now
created my plate and defined and array with six elements, in which each array's
element is a data point (measurement point).

Unfortunately I was still not able to solve the problem completely. I am not
sure how the animation should be implemented:
Since the ASCII files, I want to get the data from, contain the measurement data
registered in seven columns (a sort of timestamp and the six measured vibration
signals), I thought of using a linear spline curve (the plate vibrates only in
the z-direction). I would then assign the values in each of the six columns to
each data point in my mesh. In this way, the vibration values would describe the
path of the spline curve. Could this actually work? How would the syntax look
like?
By assigning a spline curve to each data point I will be trying to animate the
movement of a point and not an object, is this actually possible?

Thank you in advance for your help!

Regards
Jorge


Post a reply to this message

From: Stephen
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 26 Feb 2016 09:07:14
Message: <56d05c12@news.povray.org>
On 2/26/2016 1:15 PM, JorgeAE wrote:
> Alain <kua### [at] videotronca> wrote:
>> Le 16-02-25 07:58, Stephen a écrit :
>>> On 2/25/2016 12:17 PM, JorgeAE wrote:
>>>> Hi!
>>>> My name is Jorge. I started using POV-Ray a couple of days ago, so I
>>>> am actually
>>>> a not very experienced POV-Ray user
>>>>
>>>> I have a question regarding an animation which is supposed to
>>>> reproduce the
>>>> vibration of a metal plate, that was taken at six different points of the
>>>> plate. The measured values are available in ASCII format.
>>>>
>>>> So far, I know how to define a simple geometry (scene) and start an
>>>> animation
>>>> with the help of the "clock" command. However, my task is to design a
>>>> metal
>>>> plate which vibrates according to the vibration values taken at the 6
>>>> different
>>>> points of the plate mentioned before. For this reason, I am actually
>>>> supposed to
>>>> import the vibration data to my POV-Ray code and assign it to 6 points
>>>> in my
>>>> geometry.
>>>>
>>>> I don't know how this should be implemented and have not found any
>>>> similar
>>>> example in the web, so I it would be great if someone could give some
>>>> ideas or
>>>> tips on how to do it.
>>>>
>>>> Thank you very much!
>>>> Jorge
>>>>
>>>>
>>>>
>>>
>>> Hi Jorge and welcome.
>>>
>>> You could use triangles to build your metal plate.
>>> With only 6 data points you could do that manually. If you had more you
>>> could build a mesh.
>>>
>>> You could define the data points as an array and read the values from a
>>> file.
>>>
>>> Help sections.
>>> 3.3.1.10 Array
>>>
>>> 3.4.5.2.3 Mesh
>>> 3.4.5.2.6 Triangle
>>>
>>> 3.3.2.3 File I/O Directives
>>>
>>>
>>
>>
>> Once the triangles are defined, making them into a mesh is very easy.
>> Just add "mesh{" before your triangles and a "}" after. That's all there
>> is to do.
>>
>> If you plan of having multiple views of your plate in a single scene,
>> this is the way to go.
>> First define your plate as an object:
>> Use "#declare Plate = mesh{ Your_Triangles}
>>
>> Next, place your plate at various locations and orientations:
>> object{Plate rotate <-5,0,0> translate <0,10,0>}
>> object{Plate rotate <0,60,0> translate <17,-3,0>}
>> object{Plate rotate <90,0,60> translate <-17,-3,0>}
>>
>> This will gives you 3 different views of your plate.
>>
>>
>> Alain
>
> Hello Stephen and Alain,
>
> thank you very much for your answers, both of them were very helpfull!! I now
> created my plate and defined and array with six elements, in which each array's
> element is a data point (measurement point).
>
> Unfortunately I was still not able to solve the problem completely. I am not
> sure how the animation should be implemented:
> Since the ASCII files, I want to get the data from, contain the measurement data
> registered in seven columns (a sort of timestamp and the six measured vibration
> signals), I thought of using a linear spline curve (the plate vibrates only in
> the z-direction). I would then assign the values in each of the six columns to
> each data point in my mesh. In this way, the vibration values would describe the
> path of the spline curve. Could this actually work? How would the syntax look
> like?

I won't attempt to write any code as I use a modeller.
You might not be aware that you can use frame_number instead of the 
clock variable.
If the timestamps are are linearly spaced you can use one per frame. 
That might simplify things.



> By assigning a spline curve to each data point I will be trying to animate the
> movement of a point and not an object, is this actually possible?
>

Yes, that is right but it might be a good idea to experiment. Remember 
to create things at the origin then translate them to where you want 
them. You can lose object if you don't and rotate them.




-- 

Regards
     Stephen


Post a reply to this message

From: Alain
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 26 Feb 2016 11:25:15
Message: <56d07c6b@news.povray.org>


>
> Hello Stephen and Alain,
>
> thank you very much for your answers, both of them were very helpfull!! I now
> created my plate and defined and array with six elements, in which each array's
> element is a data point (measurement point).
>
> Unfortunately I was still not able to solve the problem completely. I am not
> sure how the animation should be implemented:
> Since the ASCII files, I want to get the data from, contain the measurement data
> registered in seven columns (a sort of timestamp and the six measured vibration
> signals), I thought of using a linear spline curve (the plate vibrates only in
> the z-direction). I would then assign the values in each of the six columns to
> each data point in my mesh. In this way, the vibration values would describe the
> path of the spline curve. Could this actually work? How would the syntax look
> like?
> By assigning a spline curve to each data point I will be trying to animate the
> movement of a point and not an object, is this actually possible?
>
> Thank you in advance for your help!
>
> Regards
> Jorge
>
>
If you want to get one frame per data set, you can read them into an 
array, then use "frame_number" to get the specefic ones for the current 
frame.

If you use splines, then you use the "time stamp" as indices to define 
the controle points of the splines. You'll need 6 one dimentional 
splines. It looks like this within a given spline:
[Time	Point]

I recomend that you use the natural spline. It gives smooth curves 
between your points.

Next, you multiply the clock variable by the largest time stamp value 
and use that to "travel" in the splines. The syntax is the same as for 
an array, except that you now can use floats instead of only integers.

This allow you to have an animation with a number of frames that may 
differ from the number of mesurements.



Alain


Post a reply to this message

From: Bald Eagle
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 26 Feb 2016 17:45:01
Message: <web.56d0d487a405651b664116940@news.povray.org>
I'd say that if you have six points on a solid plate, then you may want to
"build" your plate with splines as well, so that you get a smooth curvature from
the edges of the plate to the measured points, as well as the spaces in between.

Bear in mind that you'll need "extra" points as control points for your splines.

I would suggest creating something simple, like a sphere sweep, that uses only
one of the columns of vibration data, as a means to write some SDL code, get a
good looking scene, and produce a working animation.

After you've accomplished something concrete, then you can begin to expand and
add more complicated features to your file (make a copy so that you have the
original saved as a reference) and it won't be so difficult to try to "do it all
at once"

You can always post your WIPs (Works in Progress) and SDL in the appropriate
sections as attachments so that we can see exactly what you're trying to do and
see where any difficult spots and hard-to-spot errors may be.

Welcome to the POV-Ray forums, and good luck    :)


Post a reply to this message

From: Bald Eagle
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 26 Feb 2016 18:10:01
Message: <web.56d0da3aa405651b664116940@news.povray.org>
Just a few things I found that might help you out / interest you.
(cymatics / chladni plates)

http://news.povray.org/povray.binaries.images/thread/%3C3e85f01f%40news.povray.org%3E/

http://manfredkraft.blogspot.com/2016/01/biorhythm-cymatics-23.html

https://www.youtube.com/watch?v=ATErEWDajvw

http://paulbourke.net/geometry/chladni/


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 27 Feb 2016 17:57:59
Message: <56d229f7@news.povray.org>
On 26.02.2016 23:41, Bald Eagle wrote:
>
> I'd say that if you have six points on a solid plate, then you may want to
> "build" your plate with splines as well

Objects of interest here might be "prism" (for 1d profile of vibration)
or "bicubic_patch" (for 2d plate animation)


Post a reply to this message

From: JorgeAE
Subject: Re: Import of measurement data (ASCII format) in animation
Date: 2 Mar 2016 07:15:00
Message: <web.56d6d817a405651babd853180@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

>
> You can always post your WIPs (Works in Progress) and SDL in the appropriate
> sections as attachments so that we can see exactly what you're trying to do and
> see where any difficult spots and hard-to-spot errors may be.
>
> Welcome to the POV-Ray forums, and good luck    :)


Thank you all for your extremely useful advice!

I have been trying out some of the ideas suggested and I am now starting with
the simplest model and will expand it to a more complex and better looking one
after gaining some more experience. I just need to get to that point, where the
basic model works :).

The "prism" function seemed to me a good way of modelling the plate, due to the
given conditions in my case (1D vibration). For the animation I chose the linear
spline curve, since I managed to make it work in other animations I tried
before.

Given this, my approach consists of assigning each of the 6 points the plate is
built up of one linear spline curve generated by the vibration data. Since I
have not yet figured out how to work properly with the array definition and
reading in, I just copied a fraction of the data points from the .txt file into
my spline curve definition. Then I defined a translating vector transformation
"vtransform" along the spline curve and assigned it to a separately declared
point of the prism. Now, this sounds so simple and yet it is not working. I am
afraid, I am committing a huge mistake or omitting a "vital" aspect regarding
the sintax :/ .

It would be awesome, if you guys take a look at my (very simple) code and give
me a hint where the error is. I can't attach anything, so I have to copy my code
in here. Thank you very much in advance!


  background{White}
  camera {
    angle 20
    location <2, 10, -30>
    look_at <0, 0, -1>
    rotate <0,40,0>
  }
  light_source { <20, 20, -20> color White }




#declare P1 = <0, -3.7 >;
#declare P2 = <0, -4.3 >;
#declare P3 = <0, -3.8 >;
#declare P4 = <0, -4.1 >;
#declare P5 = <0, -3.7 >;
#declare P6 = <0, -4.1 > ;
#declare P7 = <0, -4 >  ;
#declare P8 = <0, -3.7 > ;
#declare P9 = <0, -3.8 > ;
#declare P10 = <0, -3.9 >;
#declare P11 = <0, -3.8 >;
#declare P12 = <0, -3.8 >;
#declare P13 = <0, -3.8 >;
#declare P14 = <0, -3.7 >;
#declare P15 = <0, -4.2 >;
#declare P16 = <0, -3.6 >;
#declare P17 = <0, -3.6 >;
#declare P18 = <0, -3.9 >;
#declare P19 = <0, -4.2 >;
#declare P20 = <0, -3.7 >;
#declare P21 = <0, -3.8 >;



#declare Spline_1 =
  spline {
    linear_spline

0.00,P1,
0.05,P2,
0.10,P3,
0.15,P4,
0.20,P5,
0.25,P6,
0.30,P7,
0.35,P8,
0.40,P9,
0.45,P10,
0.50,P11,
0.55,P12,
0.60,P13,
0.65,P14,
0.70,P15,
0.75,P16,
0.80,P17,
0.85,P18,
0.90,P19,
0.95,P20,
1.00,P21,

  }// end of spline ---------------
//---------------------------------------------


   prism {
    linear_sweep
    linear_spline
    0,
    0,
    7,
    <-2,-3>,<2,-3>, <2,0>, <2,3>, <-2, 3>, <-2,0>, <-2,-3>
    pigment { Blue }
  }

  #declare A = <-2,-3,0>;
  #declare Trans1 = transform{
            translate Spline_1(clock)};
  #declare B = vtransform(A,Trans1);


Post a reply to this message

<<< Previous 1 Messages Goto Latest 10 Messages Next 10 Messages >>>

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