[Scilab-users] Stacked 2D plot in 3D

Samuel Gougeon sgougeon at free.fr
Sat Feb 3 21:27:27 CET 2018


Le 03/02/2018 à 20:11, Claus Futtrup a écrit :
> Hi Samuel
>
> Thank you. This thing with the direction of the lines is difficult to 
> "discover" by accident. :-)
>
> ... And thanks for the good help for param3d(1). I hope Scilab will 
> adopt it.

When parts of curves are behind each others, there is a mess due to the 
perspective.
Here is a way to avoid this (i will also add it in the page):

[Xo,  Yo]  =  ndgrid(-10:0.5:10);
R  =  sqrt(Xo.*Xo  +  Yo.*Yo)  +  %eps;
Zo  =  sin(R)./R;

clf

// Simple plot with messed curves in the perspective
subplot(1,  3,  1)
param3d1(Xo,  Yo,  Zo,  150,  85,  flag=[2,4])

// With a curtain and filled curved (to avoid messed areas)
subplot(1,3,2)
nc  =  size(Xo,"c");
zmin  =  min(Zo);

X  =  [Xo(1,:)  ;  Xo  ;  Xo($,:)];
Y  =  [Yo(1,:)  ;  Yo  ;  Yo($,:)];
Z  =  [zmin*ones(1,nc)  ;  Zo  ;  zmin*ones(1,nc)];

param3d1(X,  Y,  Z,  150,  85,  flag=[2,4])
e  =  gce();
e.children.fill_mode  =  "on";

// Try to mask the curtain with %nan
// =>unsuccessful due to the bug http://bugzilla.scilab.org/11803
subplot(1,3,3)
X  =  [Xo([1  1],:)  ;  Xo  ;  Xo([$  $],:)];
Y  =  [Yo([1  1],:)  ;  Yo  ;  Yo([$  $],:)];
Z  =  [[zmin  ;  %nan]*ones(1,nc)  ;  Zo  ;  [%nan  ;  zmin]*ones(1,nc)];

param3d1(X,  Y,  Z,  150,  85,  flag=[2,4])
e  =  gce();
e.children.fill_mode  =  "on";

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180203/681fc97f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ienkeelbbkjkgmal.png
Type: image/png
Size: 18027 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20180203/681fc97f/attachment.png>


More information about the users mailing list