basic implementation for isosurface, isocolors, isonormals
David Bateman
dbateman at dbateman.org
Sun Apr 12 04:10:03 CDT 2009
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.
--
David Bateman dbateman at dbateman.org
35 rue Gambetta +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)
More information about the Octave-maintainers
mailing list