Drawing a pierced rectangle facet

Jens Simon j.s.strom at hslmg.de
Sat Sep 18 17:30:40 CEST 2010


Hallo Scilab experts,
I have come to the below script. Does anayone know a simpler, more elegant
solution? Please advise.
Kind regards, Jens
-------------------------------------------------------------------------

a=5; b=3; r=1; n=10; ex0=3.75; ey0=1.2; //data of rectangle and regular n-gon
phi=linspace(-3*%pi/4,5*%pi/4,4*n+1);
ex=r*cos(phi)+ex0; ey=r*sin(phi)+ey0; ez=zeros(1,4*n+1);//coordinates of regular
n-gon
zer=zeros(1,n); one=ones(1,n);
ax=0:a/n:a-a/n; ay=zer; az=zer;     //coordinates of rectangle edge a
bx=a*one; by=0:b/n:b-b/n; bz=zer;   //coordinates of rectangle edge b
cx=a:-a/n:a/n; cy=b*one; cz=zer;    //coordinates of rectangle edge c
dx=[zer 0]; dy=b:-b/n:0; dz=[zer 0];//coordinates of rectangle edge d
x=[ax bx cx dx; ex];
y=[ay by cy dy; ey];
z=[az bz cz dz; ez];
xdel(), plot3d2(x,y,z)
ca=gca();
ca.isoview="on";




More information about the users mailing list