octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: basic implementation for isosurface, isocolors, isonormals


From: Martin Helm
Subject: Re: basic implementation for isosurface, isocolors, isonormals
Date: Sun, 12 Apr 2009 13:56:42 +0200
User-agent: KMail/1.10.3 (Linux/2.6.27.21-0.1-default; KDE/4.1.3; x86_64; ; )

> Thomas Treichl wrote:
> > David Bateman schrieb:
> >> Ok, well it was a little bit harder than I thought for a few reasons
> >>
> >> 1) gnuplot's depth order pm3d code only works for a single surface
> >> and so a set of patches that need to be depth sorted need to be
> >> plotted with a single splot command
> >> 2) The gnuplot binary file format doesn't support "index" for splot
> >> and so constraint 1) means the data has to be written as ASCII
> >> 3) As pm3d uses the color palette, any fixed color patches need to
> >> have their color added to the colormap, and then the other things
> >> plotted with the colormap need to be treated carefully..
> >>
> >> In any  case I committed the attached patch that appears to work fine
> >> for all the tests I ran with the gnuplot CVS version. One issue I
> >> have is with gnuplot 4.2.4 I see the attached for the command
> >> "demo('patch',6); colorbar" for the X11 terminal. This appears to be
> >> a gnuplot bug as it works for other terminals like png, eps, etc and
> >> it works for the CVS version of gnuplot.. Should I care about this bug?
> >
> > Hi David,
> >
> > thanks for this work. However, I've some smaller problems running the
> > new __patch__.m command. The function "field" you're using in lines
> > 37, 39, 42 and further is undefined to me. Is this another function
> > file you are using but maybe forgot to check in?
>
> No it was supposed to be "getfield" and I have a function field in my
> path that was basically an alias.
>
> > Next, if I try to run any of the demos from the help texts of
> > isosurface or isocolors then none does work anymore because of an
> > error that looks like this, for example
> >
> >   octave:22> N = 15;    ## Increase number of vertices in each direction
> >   octave:23> iso = .4;  ## Change isovalue to .1 to display a sphere
> >   octave:24> lin = linspace (0, 2, N);
> >   octave:25> [x, y, z] = meshgrid (lin, lin, lin);
> >   octave:26> c = abs ((x-.5).^2 + (y-.5).^2 + (z-.5).^2);
> >   octave:27> figure (); ## Open another figure window
> >   octave:28>
> >   octave:28> subplot (2, 2, 1); view (-38, 20);
> >   octave:29> [f, v] = isosurface (x, y, z, c, iso);
> >   octave:30> p = patch ("Faces", f, "Vertices", v, "EdgeColor", "none");
> >   error: A(I): Index exceeds matrix dimension.
> >   error: called from:
> >   error:   /Users/Thomas/Development/octave/scripts/plot/__patch__.m at
> >   line 220, column 4
> >   error:   /Users/Thomas/Development/octave/scripts/plot/__patch__.m at
> >   line 138, column 12
> >   error: `tmp' undefined near line 59 column 14
> >   error: called from:
> >   error:   /Users/Thomas/Development/octave/scripts/plot/patch.m at
> > line 59,
> >   column 12
> >
> > Any ideas? Thanks,
> >
> >   Thomas
>
> The demo's work as in demo("patch"), but yes effectively there is an
> issue with the demo in the help text.. I'll look at that but not today
>
> D.

First of all,

thank you for your effort David. I can confirm the errors reported by Thomas. 
To be precise they happen with the first two examples in the "subplot" example 
group which use the syntax 

patch ("Faces", f, "Vertices", v, "EdgeColor", whatever)

The other two examples which use "FaceVertexCData" and facecoloring work well.

If I simply add the "FaceColor" attribute with some value to the failing patch 
command, the problem disappears, so the bug seems to be trivial (a misssing 
default value for "FaceColor")

e.g.

patch ("Faces", f, "Vertices", v, "FaceColor", "blue","EdgeColor", "none")

works well. I'll look through the code.

- mh




reply via email to

[Prev in Thread] Current Thread [Next in Thread]