[Scilab-users] Scilab and gmsh to plot surfaces

2019-06-27 Thread Carrico, Paul
Dear All

After a tesselation using cgal library (delaunay_2), I used gmsh 
(http://gmsh.info/) to plot the triangles ... just an idea of sharing about 2 
powerful tools :-)
(useful with a huge amount of nodes)

A basic "saddle" surface has been used to test it

Hope it help

Paul

###
clc, mode(0), clear

PATH = get_absolute_file_path("saddle.sce");
fich = mopen(PATH + "/saddle.msh","w");

// saddle surface
function [z]=saddle(x, y)
z = x^2 - y^2
endfunction

n = 100;
x = linspace(-2,2,n)'; // (n,1) matrix
y = linspace(-1,3,n)'; // (n,1) matrix

i = (1:n)'; j = ones(n,1);
X = x .*. j;
Y = j .*. y;
Z = saddle(X,Y);

// ### plot in gmsh ###
// Surface number
SurfaceNumber = 1;

//tri = delaunay_2(X,Y);
triangles = delaunay_2(X',Y');
NumberOfTriangles = size(triangles,"r");

mfprintf(fich,"$MeshFormat\n");
mfprintf(fich,"2.2 0 8\n");
mfprintf(fich,"$EndMeshFormat\n");
// Nodes
mfprintf(fich,"$Nodes\n");
mfprintf(fich,"%d\n",n*n);
i = (1:n*n)';
mfprintf(fich,"%d %g %g %g\n",i,X(i),Y(i),Z(i));
mfprintf(fich,"$EndNodes\n");

// elements
mfprintf(fich,"$Elements\n")
mfprintf(fich,"%d\n",NumberOfTriangles);
i = (1 : NumberOfTriangles)';
SurfaceNumber = SurfaceNumber*ones(NumberOfTriangles,1);
mfprintf(fich,"%d 2 2 %d %d %d %d 
%d\n",i,SurfaceNumber,SurfaceNumber,triangles(i,1),triangles(i,2),triangles(i,3));
mfprintf(fich,"$EndElements\n")
mclose(fich);

// ### plot in scilab ###
scf(0);
drawlater();
f = gcf();
f.figure_size = [1000, 1000];
f.background = color(255,255,255);
a = gca();
a.font_size = 2;
a.x_label.text = '$X$';
a.x_label.font_size = 4;
a.y_label.text = '$Y$';
a.Y_label.font_size = 4;
a.z_label.text = "$\sigma$";
a.z_label.font_size = 4;
plot3d(x, y, feval(x, y, saddle));
drawnow();

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] question on graphic children order

2019-06-27 Thread RolandB
Hi,

> After the first interesting Stéphane's attempt, i am also afraid that
> changing the order now would break a lot of code. 

It would definitely break a lot of my code.
So if that behaviour would be changed, I would ask for an announcement
lng before it is taking effect.

If you want to index the children in the order they have been created, you
may use ($+1-creationindex).

IMO also the order different children are drawn (polylines...) depends on
their index. They are drawn from $ to 1 so that child 1, which is the most
recent one, is drawn on top.

Regards,
Roland




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] (no subject)

2019-06-27 Thread RolandB
This is a test. Please excuse me for hijacking this empty thread.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] [EXTERNAL] Re: plots remain white under CentOS (redhat based OS) and Scilab 6.0.2

2019-06-27 Thread Carrico, Paul
I’m under CentOS Linux release 7.6.1810 (Core) where all the updates have been 
done … issue with a graphical library?



De : users [mailto:users-boun...@lists.scilab.org] De la part de Adelson 
Oliveira
Envoyé : jeudi 27 juin 2019 11:23
À : International users mailing list for Scilab.
Objet : [EXTERNAL] Re: [Scilab-users] plots remain white under CentOS (redhat 
based OS) and Scilab 6.0.2

Doesn't happen with Scilab 6.01 and Centos 6.9. I'll try with Scilab 6.02.

Em qui, 27 de jun de 2019 5:46 AM, Carrico, Paul 
mailto:paul.carr...@auxitrolweston.com>> 
escreveu:
Dear All

When I’m trying to use either plot2D or plot3D under CentOS, all the figures 
remains white ; I guess it’s a library issue and I think it has ever been 
noticed in the past, but I do not remember what or I cannot find the 
workaround: what it is?

Thanks for your help

Paul
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plots remain white under CentOS (redhat based OS) and Scilab 6.0.2

2019-06-27 Thread Adelson Oliveira
Doesn't happen with Scilab 6.01 and Centos 6.9. I'll try with Scilab 6.02.

Em qui, 27 de jun de 2019 5:46 AM, Carrico, Paul <
paul.carr...@auxitrolweston.com> escreveu:

> Dear All
>
>
>
> When I’m trying to use either plot2D or plot3D under CentOS, all the
> figures remains white ; I guess it’s a library issue and I think it has
> ever been noticed in the past, but I do not remember what or I cannot find
> the workaround: what it is?
>
>
>
> Thanks for your help
>
>
>
> Paul
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] plots remain white under CentOS (redhat based OS) and Scilab 6.0.2

2019-06-27 Thread Carrico, Paul
Dear All

When I'm trying to use either plot2D or plot3D under CentOS, all the figures 
remains white ; I guess it's a library issue and I think it has ever been 
noticed in the past, but I do not remember what or I cannot find the 
workaround: what it is?

Thanks for your help

Paul
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users