<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: In-Polyhedron Test</title>
	<atom:link href="http://www.advancedmcode.org/in-polyhedron-test.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.advancedmcode.org/in-polyhedron-test.html</link>
	<description>Open Blog with: Engineering Solutions, Algorithms, Advanced Matlab Source Code and Science related contents</description>
	<lastBuildDate>Fri, 30 Jul 2010 14:44:54 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Denis Lisin</title>
		<link>http://www.advancedmcode.org/in-polyhedron-test.html/comment-page-1#comment-6330</link>
		<dc:creator>Denis Lisin</dc:creator>
		<pubDate>Fri, 30 Jul 2010 14:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.advancedmcode.org/?p=427#comment-6330</guid>
		<description>Thanks for the code, works fine.
Important issue for me is it considers the points on boundary as inner points.</description>
		<content:encoded><![CDATA[<p>Thanks for the code, works fine.<br />
Important issue for me is it considers the points on boundary as inner points.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: María Herrojo Ruiz</title>
		<link>http://www.advancedmcode.org/in-polyhedron-test.html/comment-page-1#comment-2043</link>
		<dc:creator>María Herrojo Ruiz</dc:creator>
		<pubDate>Tue, 06 Apr 2010 19:15:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.advancedmcode.org/?p=427#comment-2043</guid>
		<description>I got it. 
Now everything works fine.

Great! Thanks for writing Inpolyedron. It is really fast!

Cheers.
María</description>
		<content:encoded><![CDATA[<p>I got it.<br />
Now everything works fine.</p>
<p>Great! Thanks for writing Inpolyedron. It is really fast!</p>
<p>Cheers.<br />
María</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: María Herrojo Ruiz</title>
		<link>http://www.advancedmcode.org/in-polyhedron-test.html/comment-page-1#comment-2038</link>
		<dc:creator>María Herrojo Ruiz</dc:creator>
		<pubDate>Tue, 06 Apr 2010 13:27:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.advancedmcode.org/?p=427#comment-2038</guid>
		<description>Hi Luigi, 

your code seems really nice. It works good with your examples. I would like to test it with some data I have from a brain structure (subthalamic nucleus) and with some empirical (query) points of the electrodes implanted (inside/outside would be the question).

My problem is the following:

I have the coordinates of the set of 3 points constituting each triangle:
polyedron size [329x9] (3 points x 3D: 329 triangles).

Because the original data, ist vtk, it also gives me the following triangles indices:
triangles indices [1974x3]

The problem is that, actually, I don&#039;t know where the triangles indices come from, since they are already given in the original data. 
The indices [1974x3] I have seem not to work for trisurf, when I give the data points of the polyedron as [987x3]. MATLAB says &quot;Faces values must be &gt;= 1.0&quot;.

So, in order to test your method, do you have a suggestion to recompute from the original set of 3 points for each triangle the correct triangle indexes for your method? 
Given &quot;p&quot;, how do you compute &quot;t&quot;(tringle indices) and &quot;tnorm&quot;?

Regarding the normal vectors to each triangle. It is easy to compute the normal to each triangle (cross product of two vectors constititung the triangle, then checking for the outward direction) and locating it, e.g. at the middle of the triangle or at any of its points. The I would have 1 normal vector for the surface of each triangle, right? Or do I need 3 normal vectors at each point of the triangle for your method? 
How comes that your &quot;tnorm&quot; has the same size as &quot;t&quot; (triangle indices) and not as the surface points &quot;p&quot;?

Hope you have a tip.
I&#039;m really looking forward to testing your method with my data!!

Cheers,
María</description>
		<content:encoded><![CDATA[<p>Hi Luigi, </p>
<p>your code seems really nice. It works good with your examples. I would like to test it with some data I have from a brain structure (subthalamic nucleus) and with some empirical (query) points of the electrodes implanted (inside/outside would be the question).</p>
<p>My problem is the following:</p>
<p>I have the coordinates of the set of 3 points constituting each triangle:<br />
polyedron size [329x9] (3 points x 3D: 329 triangles).</p>
<p>Because the original data, ist vtk, it also gives me the following triangles indices:<br />
triangles indices [1974x3]</p>
<p>The problem is that, actually, I don&#8217;t know where the triangles indices come from, since they are already given in the original data.<br />
The indices [1974x3] I have seem not to work for trisurf, when I give the data points of the polyedron as [987x3]. MATLAB says &#8220;Faces values must be &gt;= 1.0&#8243;.</p>
<p>So, in order to test your method, do you have a suggestion to recompute from the original set of 3 points for each triangle the correct triangle indexes for your method?<br />
Given &#8220;p&#8221;, how do you compute &#8220;t&#8221;(tringle indices) and &#8220;tnorm&#8221;?</p>
<p>Regarding the normal vectors to each triangle. It is easy to compute the normal to each triangle (cross product of two vectors constititung the triangle, then checking for the outward direction) and locating it, e.g. at the middle of the triangle or at any of its points. The I would have 1 normal vector for the surface of each triangle, right? Or do I need 3 normal vectors at each point of the triangle for your method?<br />
How comes that your &#8220;tnorm&#8221; has the same size as &#8220;t&#8221; (triangle indices) and not as the surface points &#8220;p&#8221;?</p>
<p>Hope you have a tip.<br />
I&#8217;m really looking forward to testing your method with my data!!</p>
<p>Cheers,<br />
María</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay</title>
		<link>http://www.advancedmcode.org/in-polyhedron-test.html/comment-page-1#comment-1800</link>
		<dc:creator>Ajay</dc:creator>
		<pubDate>Tue, 30 Mar 2010 15:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.advancedmcode.org/?p=427#comment-1800</guid>
		<description>Luigi,

It works fine now. Thanks for your help.

Ajay</description>
		<content:encoded><![CDATA[<p>Luigi,</p>
<p>It works fine now. Thanks for your help.</p>
<p>Ajay</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luigi Giaccari</title>
		<link>http://www.advancedmcode.org/in-polyhedron-test.html/comment-page-1#comment-1796</link>
		<dc:creator>Luigi Giaccari</dc:creator>
		<pubDate>Tue, 30 Mar 2010 10:54:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.advancedmcode.org/?p=427#comment-1796</guid>
		<description>That&#039;s a numerical problem that comes form the presence of almost vertical facets.

Run the algorithm this way and it should be ok:


&lt;pre lang=&quot;MATLAB&quot;&gt;

in1=InPolyedron_v3(p,t,tnorm,qp);
id=[3 2 1]; 
in2=InPolyedron_v3(p(:,id),t,tnorm(:,id),qp(:,id));
id=[1 3 2]; 
in3=InPolyedron_v3(p(:,id),t,tnorm(:,id),qp(:,id));
in=in1&amp;in2&in3;

&lt;/pre&gt;

Luigi</description>
		<content:encoded><![CDATA[<p>That&#8217;s a numerical problem that comes form the presence of almost vertical facets.</p>
<p>Run the algorithm this way and it should be ok:</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;">&nbsp;
in1=InPolyedron_v3<span style="color: #080;">&#40;</span>p,t,tnorm,qp<span style="color: #080;">&#41;</span>;
id=<span style="color: #080;">&#91;</span><span style="color: #33f;">3</span> <span style="color: #33f;">2</span> <span style="color: #33f;">1</span><span style="color: #080;">&#93;</span>; 
in2=InPolyedron_v3<span style="color: #080;">&#40;</span>p<span style="color: #080;">&#40;</span>:,id<span style="color: #080;">&#41;</span>,t,tnorm<span style="color: #080;">&#40;</span>:,id<span style="color: #080;">&#41;</span>,qp<span style="color: #080;">&#40;</span>:,id<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>;
id=<span style="color: #080;">&#91;</span><span style="color: #33f;">1</span> <span style="color: #33f;">3</span> <span style="color: #33f;">2</span><span style="color: #080;">&#93;</span>; 
in3=InPolyedron_v3<span style="color: #080;">&#40;</span>p<span style="color: #080;">&#40;</span>:,id<span style="color: #080;">&#41;</span>,t,tnorm<span style="color: #080;">&#40;</span>:,id<span style="color: #080;">&#41;</span>,qp<span style="color: #080;">&#40;</span>:,id<span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>;
in=in1&amp;in2&amp;in3;</pre></div></div>

<p>Luigi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay</title>
		<link>http://www.advancedmcode.org/in-polyhedron-test.html/comment-page-1#comment-1789</link>
		<dc:creator>Ajay</dc:creator>
		<pubDate>Mon, 29 Mar 2010 18:35:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.advancedmcode.org/?p=427#comment-1789</guid>
		<description>Hi Luigi,

I tried to use this algorithm to find points in a non convex shape and I get some extra points that lie outside the shape. I checked the normal of the facets and they seem to be ok (outward pointing). I have uploaded a screen shot of the points overlapped on the triangulated surface (points.bmp) and also an xls file (data.xls) which contains the vertices (columns A:C) and faces (columns E:G) in the following link. If you could take a look and give your comments that would be great.

http://people.clarkson.edu/~sonarav/

Thanks, 
Ajay</description>
		<content:encoded><![CDATA[<p>Hi Luigi,</p>
<p>I tried to use this algorithm to find points in a non convex shape and I get some extra points that lie outside the shape. I checked the normal of the facets and they seem to be ok (outward pointing). I have uploaded a screen shot of the points overlapped on the triangulated surface (points.bmp) and also an xls file (data.xls) which contains the vertices (columns A:C) and faces (columns E:G) in the following link. If you could take a look and give your comments that would be great.</p>
<p><a href="http://people.clarkson.edu/~sonarav/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/people.clarkson.edu/_sonarav/?referer=');">http://people.clarkson.edu/~sonarav/</a></p>
<p>Thanks,<br />
Ajay</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luigi Giaccari</title>
		<link>http://www.advancedmcode.org/in-polyhedron-test.html/comment-page-1#comment-327</link>
		<dc:creator>Luigi Giaccari</dc:creator>
		<pubDate>Fri, 16 Oct 2009 20:57:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.advancedmcode.org/?p=427#comment-327</guid>
		<description>To get the normals of triangles you don&#039;t need to have normals in points.

If you have Matlab R2009a you can use the computational geometry toolbox to get a conform outward normal for each triangle. There is a built in function.

To get your own code you need to compute the nomral for one triangle (use cross product) and then perform a propagation on the neighborhood triangles keeping the orientation of normals. It is not the easiest thing but not even the most diffucult, try it and let me know.

Luigi</description>
		<content:encoded><![CDATA[<p>To get the normals of triangles you don&#8217;t need to have normals in points.</p>
<p>If you have Matlab R2009a you can use the computational geometry toolbox to get a conform outward normal for each triangle. There is a built in function.</p>
<p>To get your own code you need to compute the nomral for one triangle (use cross product) and then perform a propagation on the neighborhood triangles keeping the orientation of normals. It is not the easiest thing but not even the most diffucult, try it and let me know.</p>
<p>Luigi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tolga</title>
		<link>http://www.advancedmcode.org/in-polyhedron-test.html/comment-page-1#comment-324</link>
		<dc:creator>tolga</dc:creator>
		<pubDate>Fri, 16 Oct 2009 17:23:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.advancedmcode.org/?p=427#comment-324</guid>
		<description>hello.. this looks like a quite useful code...

but there is a problem i cannot figure out. 

i have the parameters for a surface : triangles, points and normals.

my problem starts here:  the normals are not normals for triangles but they are normals at the points.

however your function requires the normals for triangles. Is there a way to estimate the normals for triangles from the normals of the points, so that I can use your function?

i will be so glad to hear your any possible solution for this.

thank you in advance.</description>
		<content:encoded><![CDATA[<p>hello.. this looks like a quite useful code&#8230;</p>
<p>but there is a problem i cannot figure out. </p>
<p>i have the parameters for a surface : triangles, points and normals.</p>
<p>my problem starts here:  the normals are not normals for triangles but they are normals at the points.</p>
<p>however your function requires the normals for triangles. Is there a way to estimate the normals for triangles from the normals of the points, so that I can use your function?</p>
<p>i will be so glad to hear your any possible solution for this.</p>
<p>thank you in advance.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
