POV-Ray : Newsgroups : povray.newusers : Visualization of a sand grain Server Time
8 Oct 2024 17:09:29 EDT (-0400)
  Visualization of a sand grain (Message 1 to 7 of 7)  
From: Wallace
Subject: Visualization of a sand grain
Date: 1 Apr 2019 02:25:00
Message: <web.5ca1ae30810213ff40886540@news.povray.org>
Hi folks, I am new to the software and this community. I am a year 4 civil
engineering student. To finish my final year project, I am required to learn
this software. I use Pack3D in matlab to generate some particles with a lot of
xyz coordiantes as well as radius from central point. I wonder how could I use
Povray visualize a single particle with lots of x-y-z coordinate. I cant find
the correct coding for my visualization. Hope can find some help here. Thank
you!


Post a reply to this message

From: Thomas de Groot
Subject: Re: Visualization of a sand grain
Date: 1 Apr 2019 03:00:27
Message: <5ca1b70b$1@news.povray.org>
On 1-4-2019 8:22, Wallace wrote:
> Hi folks, I am new to the software and this community. I am a year 4 civil
> engineering student. To finish my final year project, I am required to learn
> this software. I use Pack3D in matlab to generate some particles with a lot of
> xyz coordiantes as well as radius from central point. I wonder how could I use
> Povray visualize a single particle with lots of x-y-z coordinate. I cant find
> the correct coding for my visualization. Hope can find some help here. Thank
> you!
> 
> 

Welcome! Interesting to learn that POV-Ray is part of your curriculum.

If, as I deduce from the title, you have modelled grains of sands with 
many facets, I guess the best you can do is:

1- export the model(s) as e.g. .obj files;

2- load the .obj models in a conversion program like Poseray 
[https://sites.google.com/view/poseray] and export to POV-Ray as mesh2 
files;

3- Build a scene in POV-Ray in which you can import the mesh2 models of 
the sand grain(s). As a start, the basic POV-Ray scene can be used.

Hope this helps. Feel free to yell if things are unclear. We are here a 
(mostly) comprehending and patient community ;-)

-- 
Thomas


Post a reply to this message

From: Alain
Subject: Re: Visualization of a sand grain
Date: 1 Apr 2019 17:55:33
Message: <5ca288d5$1@news.povray.org>
Le 19-04-01 à 02:22, Wallace a écrit :
> Hi folks, I am new to the software and this community. I am a year 4 civil
> engineering student. To finish my final year project, I am required to learn
> this software. I use Pack3D in matlab to generate some particles with a lot of
> xyz coordiantes as well as radius from central point. I wonder how could I use
> Povray visualize a single particle with lots of x-y-z coordinate. I cant find
> the correct coding for my visualization. Hope can find some help here. Thank
> you!
> 
> 

When you say «visualize a single particle with lots of x-y-z coordinate.»
Do you mean a particle at a given coordinates from a list of 
coordinates, or a complex particle whose vertices are defined by those 
coordinates ?

In the first case, you simply iterate through the list of coordinates 
until you get to the desired ones and place some object there.
You may place some object at each set. Make them all transparent except 
the one that interest you.

In the second case, you need to generate a mesh from those coordinates, 
then, place it in your scene so that it can be rendered.


Post a reply to this message

From: Bald Eagle
Subject: Re: Visualization of a sand grain
Date: 1 Apr 2019 20:15:00
Message: <web.5ca2a8db3897cbe3765e06870@news.povray.org>
"Wallace" <819### [at] qqcom> wrote:
> Hi folks, I am new to the software and this community. I am a year 4 civil
> engineering student. To finish my final year project, I am required to learn
> this software. I use Pack3D in matlab to generate some particles with a lot of
> xyz coordiantes as well as radius from central point. I wonder how could I use
> Povray visualize a single particle with lots of x-y-z coordinate. I cant find
> the correct coding for my visualization. Hope can find some help here. Thank
> you!

Write the <x,y,z> vector and radius to a file.
Read in the values, generate a sphere of that radius at that point.
loop.

Points for style would be to figure out where the camera should be located to
make sure all the spheres are in the raytraced image.


This has been covered before, and I replied rather frequently to Ari -

http://news.povray.org/povray.newusers/thread/%3Cweb.5942a025555127989d2528170%40news.povray.org%3E/


Post a reply to this message

From: Wallace
Subject: Re: Visualization of a sand grain
Date: 2 Apr 2019 02:55:01
Message: <web.5ca3068b3897cbe35b7561110@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Wallace" <819### [at] qqcom> wrote:
> > Hi folks, I am new to the software and this community. I am a year 4 civil
> > engineering student. To finish my final year project, I am required to learn
> > this software. I use Pack3D in matlab to generate some particles with a lot of
> > xyz coordiantes as well as radius from central point. I wonder how could I use
> > Povray visualize a single particle with lots of x-y-z coordinate. I cant find
> > the correct coding for my visualization. Hope can find some help here. Thank
> > you!
>
> Write the <x,y,z> vector and radius to a file.
> Read in the values, generate a sphere of that radius at that point.
> loop.
> Could you explain more in details? Since I have no coding background before, I have
to start from zero. The data I go
t from matlab is a particle with 162 points, a list of xyz coordinates and the
distance between every point and the cen
tral point of the particle. I wonder any coding example that i could refer to?
> Points for style would be to figure out where the camera should be located to
> make sure all the spheres are in the raytraced image.
>
>
> This has been covered before, and I replied rather frequently to Ari -
> Thank you so much for your help.
>
http://news.povray.org/povray.newusers/thread/%3Cweb.5942a025555127989d2528170%40news.povray.org%3E/


Post a reply to this message

From: Le Forgeron
Subject: Re: Visualization of a sand grain
Date: 2 Apr 2019 12:02:14
Message: <5ca38786$1@news.povray.org>
Le 02/04/2019 à 08:51, Wallace a écrit :
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>> "Wallace" <819### [at] qqcom> wrote:
>>> Hi folks, I am new to the software and this community. I am a year 4 civil
>>> engineering student. To finish my final year project, I am required to learn
>>> this software. I use Pack3D in matlab to generate some particles with a lot of
>>> xyz coordiantes as well as radius from central point. I wonder how could I use
>>> Povray visualize a single particle with lots of x-y-z coordinate. I cant find
>>> the correct coding for my visualization. Hope can find some help here. Thank
>>> you!
>>
>> Write the <x,y,z> vector and radius to a file.
>> Read in the values, generate a sphere of that radius at that point.
>> loop.
>> Could you explain more in details?


> Since I have no coding background before, I have to start from zero. The data I go
> t from matlab is a particle with 162 points, a list of xyz coordinates and the
distance between every point and the cen
> tral point of the particle. I wonder any coding example that i could refer to?

Sound like you want to see the hull of the points around the central
point... connecting the cloud of points back to make a surface...

Something I would rather try in meshlab, because the involved
algorithm(s) to select the "right" neighbours of a point to make a
triangle is a vast field (something specialized software for 3D scanners
have to do, as part of reconstruction of the mesh from the scanned points).

Are the 162 points ordered in any way ? or do you have to assume they
are random ?

One thing you can start with povray is reading the data in an array
(povray supports up to 5D vector, so xyz + distance fits easily in 4D array)

#declare MyPoint=array[162];

// and here come the hope the points are in a file as
// "X, Y, Z, Distance" one point per line
#fopen MyDataFile "filename.ext" read
#local Entry = 0;
#local XValue = 0;
#local YValue = 0;
#local ZValue = 0;
#local DistanceValue = 0;
#while(Entry<162)
#read (MyDataFile, XValue, YValue, ZValue, DistanceValue)
#declare MyPoint[Entry] = < XValue, YValue, ZValue, DistanceValue >;
#declare Entry = Entry + 1;
#end

#fclose MyDataFile


This would not show any shape so far, but you could then use the SDL to
manipulate your data for further operations.

http://wiki.povray.org/content/Reference:File_I/O_Directives


>> Points for style would be to figure out where the camera should be located to
>> make sure all the spheres are in the raytraced image.
>>
>>
>> This has been covered before, and I replied rather frequently to Ari -
>> Thank you so much for your help.
>>
http://news.povray.org/povray.newusers/thread/%3Cweb.5942a025555127989d2528170%40news.povray.org%3E/
> 
> 
> 
>


Post a reply to this message

From: Bald Eagle
Subject: Re: Visualization of a sand grain
Date: 2 Apr 2019 14:00:01
Message: <web.5ca3a2213897cbe3765e06870@news.povray.org>
"Wallace" <819### [at] qqcom> wrote:

> > Could you explain more in details?

Since I have no coding background before, I have to start from zero.

Just because a lot of people have been super busy IRL lately, it would be best
to look at the POV-Ray wiki
http://wiki.povray.org/content/Main_Page
and the "Search" part of this newsgroup and the "F1 help" while running POV-Ray
to familiarize yourself with the basics and some of the commands ("directives")
you are likely to use.

Otherwise it's a little too much like "do my homework for me".


> The data I got from matlab is a particle with 162 points, a list of xyz
> coordinates and the distance between every point and the central point of the
> particle.

you have 162 particles?
define "the central point of the particle" as POV-Ray's origin, and there ya go.


> I wonder any coding example that I could refer to?

There's likely hundreds if you search the newsgroups for read write data array
etc because over the past 20+ years people have written tens of thousands of
scenes using these very same basic data structures.

Post a copy of your actual data, and that would help us to see exactly what
you're working with.


Post a reply to this message

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