<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<BR>Hi, Karthik<BR>
&nbsp;<BR>
Thanks for the clarification.&nbsp;&nbsp;Why the "n"&nbsp;has only one vector?&nbsp; It is a normal direction with respect to which point? <BR>
I dig into the source code and it seems to me that n is the first well-defined normal vector (length != 0) when you consider the three ajacent points.<BR>
&nbsp;<BR>
By the way, the result I have when I loop all the points&nbsp;using&nbsp;PointInPolygon&nbsp;returns the whole region in the bounding box as "inside". What possibly goes wrong?<BR>
&nbsp;<BR>
Thanks<BR>
Siqi<BR>
&nbsp;<BR>
<BR>&gt; Date: Tue, 16 Dec 2008 04:11:13 -0500<BR>&gt; From: karthik.krishnan@kitware.com<BR>&gt; To: pidanchen@hotmail.com<BR>&gt; CC: vtkusers@vtk.org<BR>&gt; Subject: Re: [vtkusers] polygon fill / PointInPolygon<BR>&gt; <BR>&gt; chensiqi wrote:<BR>&gt; &gt;<BR>&gt; &gt; Hi, VTKers<BR>&gt; &gt;<BR>&gt; &gt; I wonder if there is any Polygon fill algorithm implemented in<BR>&gt; &gt; VTKPolygon class?<BR>&gt; &gt;<BR>&gt; &gt; If not, maybe Loop through all the points using PointInPolygon is the<BR>&gt; &gt; only way I can think of.<BR>&gt; Yes, at present the only way in VTK.<BR>&gt; &gt;<BR>&gt; &gt; Is that " n " in the parameter list of PointInpolygon the normal<BR>&gt; &gt; direction? How to estimate it?<BR>&gt; Yes it is.<BR>&gt; vtkPolygon::ComputeNormal should do the job for you.<BR>&gt; <BR>&gt; The method works by firing rays and checking the number of times a ray<BR>&gt; drawn through the line intersects the polygon. Even times implies<BR>&gt; outside, odd times =&gt; inside. The normal is needed to get the direction<BR>&gt; the rays are fired in (they are perpendicular to the normal). The class<BR>&gt; could have computed the normal for you, but it is left to the user for<BR>&gt; efficiency, since its likely that you will call the methods several<BR>&gt; times and wouldn't want to recompute the polygon normal each time.<BR>&gt; <BR>&gt; &gt; int vtkPolygon::*PointInPolygon* (double x[3], int numPts, double<BR>&gt; &gt; *pts, double bounds[6], double *n)<BR>&gt; &gt;<BR>&gt; &gt; Thanks for your help.<BR>&gt; &gt;<BR>&gt; &gt; Siqi<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt; 更多热辣资讯尽在新版MSN首页! 立刻访问! &lt;http://cn.msn.com/&gt;<BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt;<BR>&gt; &gt; _______________________________________________<BR>&gt; &gt; This is the private VTK discussion list.<BR>&gt; &gt; Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>&gt; &gt; Follow this link to subscribe/unsubscribe:<BR>&gt; &gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>&gt; &gt; <BR>&gt; <BR>&gt; -- <BR>&gt; Karthik Krishnan<BR>&gt; R &amp; D Engineer,<BR>&gt; Kitware Inc,<BR>&gt; Ph: 518 371 3971 x119<BR>&gt; Fax: 518 371 3971<BR>&gt; <BR><BR><br /><hr />更多热辣资讯尽在新版MSN首页! <a href='http://cn.msn.com/' target='_new'>立刻访问!</a></body>
</html>