[Scilab-users] Compute normals to 3D surface

Rafael Guerra jrafaelbguerra at hotmail.com
Mon Jun 18 11:46:52 CEST 2018


Lester,

To just show the vector arrows close to level Z ~ 0, you can define the # of points for each parametric coordinate of the Mobius strip:

Nl = 40;  // long axis #points
Ns = 10;  // short axis #points
u = linspace(0,2*%pi,Nl); 
v = linspace(-0.5,0.5,Ns);

and then at the end of the code write:

// Compute normals to surface
[x1,y1,z1]=surfnorm(x,y,z);
x0 = x(Ns/2,:);
y0 = y(Ns/2,:);
z0 = z(Ns/2,:);
sf = 0.2;  // arrows scale factor
x1 = sf*x1(Ns/2,:) + x0;
y1 = sf*y1(Ns/2,:) + y0;
z1 = sf*z1(Ns/2,:) + z0;
// Plot normal vectors to surface along Z~0
xarrows([x0;x1],[y0;y1],[z0;z1],-1,2)

You'll then get the less busy picture attached.
As pointed out by Stephane, as the Mobius strip is non-orientable it will be impossible to extend the definition of normal to the whole surface.

Regards,
Rafael

-----Original Message-----
From: users [mailto:users-bounces at lists.scilab.org] On Behalf Of arctica1963
Sent: Monday, June 18, 2018 10:55 AM
To: users at lists.scilab.org
Subject: Re: [Scilab-users] Compute normals to 3D surface

Hi Rafael,

Xarrows() worked to generate the normals in  Scilab 6.0.1.

<http://mailinglists.scilab.org/file/t495709/Moebius2_arrows.jpg> 

Getting closer to the solution, but it gets "confused" at position (x=1.5, y=0, z=0) where the vectors should change to inbound rather than outbound as the surface folds as shown in the illustrative figure before. At this point we actually see a double vector. From x=0 to -1 it should be on the "inner"
part if I'm looking at this right?

Is it possible to just show the vector arrows along say z=0 only? Hopefully I am explaining this properly.

Thanks for the help, very informative.

Lester


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Moebius_strip_normal_vector.png
Type: image/png
Size: 24563 bytes
Desc: Moebius_strip_normal_vector.png
URL: <https://lists.scilab.org/pipermail/users/attachments/20180618/c29280ec/attachment.png>


More information about the users mailing list