I've just discovered pm3d and I would like to know if it can be used
to plot a triangular mesh surface (all the demos at
http://ayapin.film.s.dendai.ac.jp/~matuda/Gnuplot/pm3d.html use quad
faces).
Also, the glass datafile (glass.dat) at
http://ayapin.film.s.dendai.ac.jp/~matuda/Gnuplot/Pm3d/glass.dat does
not appear to have any structure other than containing what seems to
be a list of vertexes. Would someone please explain the structure of
this file, or does splot simply builds a face out of 4 consecutive
vertexes?
Thanks,
- Olumide
> Also, the glass datafile (glass.dat) at
> http://ayapin.film.s.dendai.ac.jp/~matuda/Gnuplot/Pm3d/glass.dat does
> not appear to have any structure other than containing what seems to
> be a list of vertexes.
It does have structure --- you're just not seeing it. Consult "help
splot datafile", and maybe look at your local copy of glass.dat in a
text editor, instead of looking at a web copy in your browser, to see it.
will do, thanks. Do you mean that glass.dat comes with the
installation? ... In which directory is it? (Sorry, I'm still new to
gnuplot).
On plotting triangular faces: I'm considering repeating the starting
(or ending vertex) e.g. v1,v2,v3,v1 ... if gnuplot only handles quads.
Is this the best way of plotting triangular faces?
> will do, thanks. Do you mean that glass.dat comes with the
> installation? ... In which directory is it? (Sorry, I'm still new to
> gnuplot).
It's in the 'demo' directory. Where your installation has it depends on
how you installed gnuplot.
> On plotting triangular faces: I'm considering repeating the starting
> (or ending vertex) e.g. v1,v2,v3,v1 ... if gnuplot only handles quads.
> Is this the best way of plotting triangular faces?
Not really. gnuplot does require quadrangles, but the best way of
describing those would be more like this:
v1
v2
v3
v3
>
found it in ...\usr\share\doc\gnuplot-4.2.0\demo :-)
The comment: "# 16x16 grid Glass shape." is particularity interesting.
Is it 16x16 because there are 16 levels (i.e. latitude-like
divisions), each having 16 segments (i.e. longitude-like
divisions)? ....
Are the spaces in the file important? ... 'cos the file still looks
like a long list of vertices. Are 4 consecutive vertices used to build
a quad?
> > On plotting triangular faces: I'm considering repeating the starting
> > (or ending vertex) e.g. v1,v2,v3,v1 ... if gnuplot only handles quads.
> > Is this the best way of plotting triangular faces?
>
> Not really. gnuplot does require quadrangles, but the best way of
> describing those would be more like this:
Do you mean that gnuplot wont allow me to simulate triangles by
repeating vertices?
Can someone please recommend a utility that handles ungridded data. I
know of mview (http://mview.sourceforge.net/), unfortunately, mview
supports triangles alone, whereas I wish to plot points and lines and
not just triangles, ... or do I have to resort to OpenGL?
It can handle lots of very small grids, though (again: see "help splot
datafile", and pay particular attention to "index"), and a triangles can
be disguised as quadrangles.
I've been reading the manual (this: http://www.gnuplot.info/docs/node329.html),
and I'm having trouble figuring how to do it. Would you please give me
small example or some more pointers?
Take for example, the following sequence of points,
A: 0 0 0
B: 10 0 0
C: 0 10 0
D: 20 10 0
E: 10 20 0
F: 20 20 0
forming two triangle as shown below (an unusual case, I know)
E .__________. F
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
C \|
. D
|\
| \
| \
| \
| \
| \
| \
| \
| \
----------.
A B
how would the sequence be presented to gnuplot in order to achieve the
desired effect?
> A: 0 0 0
> B: 10 0 0
> C: 0 10 0
> D: 20 10 0
> E: 10 20 0
> F: 20 20 0
Minimally:
splot '-' with lines
0 0 0
10 0 0
0 10 0
0 10 0
20 10 0
10 20 0
20 20 0
20 20 0
E
Erm ... not quite. There's an extra triangle (0, 10, 0) (20, 10, 0)
(10, 20, 0)
That's because you broke the data in copying them from my post. You
removed one empty line.
Thanks Hans, this worked ("-"s represent new lines):
0 0 0
10 0 0
-
0 10 0
0 10 0
-
-
20 10 0
10 20 0
-
20 20 0
2 20 0
Thanks again for helping an annoying n00b like myself. Seriously, tell
me, why do you do it ;-)
?