comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Compute_Mesh_Normals returns normal vector [0, 0, 0]
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Compute_Mesh_Normals returns normal vector [0, 0, 0] [message #49115] Thu, 22 June 2006 10:40 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
spidersapiens@gmail.com wrote:
> According to the online help, the function "Compute_Mesh_Normals"
> should return "a 3 x M array containing a unit normal for each vertex
> in the input array.". However when I used it in my program, it's
> returning a couple ZERO vector [0, 0, 0] though the rest are normal
> unit vectors. What does zero vector mean in this case or should I say
> this is an IDL bug?

I'm not familiar with the algorithm used, though I assume it involves
calculating cross-products of the edges which meet at the corresponding
edge. However, you can imagine which situations might produce such a
result without knowing the details of the algorithm.

If all of the edges are parallel to each other, all of the cross
products would produce a 0 vector. If three edges meet at a vertex, and
two of them are parallel to each other, a simple average would involve
one cross product of exactly 0, and two cross products that exactly
cancel each other. This is just the mathematical way of saying that the
two pairs of edges give exactly conficting hints about the direction of
the normal vector. The same can be said if four edges meet at a vertex,
and any two of them are parallel.

Therefore, the thing you need to do is find out what the edges of the
mesh are, that meet at the vertices where the normal vector comes out
0.
[Message index]
 
Read Message
Read Message
Previous Topic: Compute_Mesh_Normals returns normal vector [0, 0, 0]
Next Topic: Space Camper

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 00:48:20 PDT 2025

Total time taken to generate the page: 0.71881 seconds