Hi Gianluca,
I think the issue might be that the normal, being the average of the cell
normals around the point, is not reflecting the actual orientation of the
surface with the needed accuracy.
Unfortunately at the present stage the script does only output the distance to
the closest surface point, not to the node. You would have to work in VTK
directly to achieve this, in
a rather easy way, though. Specifically, take a look at the vtkPointLocator
class, it does what you need.
The "right" way of doing what you need is probably to compute cell normals
(vmtksurafcenormals -cellnormals 1), locate the closest cell (or the closest
cells) and dot the point-cell distance with the cell normal.
Just my 2 cents
Luca
On Feb 13, 2012, at 5:53 PM, gianluca de santis wrote:
> Dear Luca,
>
> I am using the vmtksurfacedistance to check whether a point is inside or
> outside a closed manifold surface.
> Points inside and points outside are generally correct but sometimes I get a
> wrong sign.
> By looking at the wrong points it seems that a wrong sign is assigned when
> the closest surface point (on the distancevectorsarray)
> is too close to a surface node or a surface edge.
> 1) The distancevectorsarray is correct. So, is it possible that during the
> DOT product, the normal is not well defined if the point is too close
> to a node or an edge?
> 2) Is it possible to force vmtksurfacedistance to return the
> distancevectorsarray with the closest surface nodes (cartesian distance)
> instead of closest surface points? In this way, one could calculate the dot
> product outside vmtksurfacedistance.
>
> Kind regards
> Gianluca
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2_______________________________________________
> vmtk-users mailing list
> vmtk-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/vmtk-users
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
vmtk-users mailing list
vmtk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vmtk-users