<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Computational Geometry in MATLAB R2009a, Part I</title>
	<link>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/</link>
	<description>Loren Shure  works on design of the MATLAB language at &#60;a href="http://www.mathworks.com/"&#62;The MathWorks&#60;/a&#62;. She writes here about once a week on MATLAB programming and related topics. &#60;br&#62;&#60;br&#62;&#60;a href="/images/loren-full.jpg"&#62;&#60;img src="/images/loren.jpg"&#62;&#60;/a&#62;</description>
	<pubDate>Sun, 22 Nov 2009 23:01:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Damian Sheehy</title>
		<link>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30827</link>
		<dc:creator>Damian Sheehy</dc:creator>
		<pubDate>Thu, 19 Nov 2009 22:00:13 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30827</guid>
		<description>Hi Kyle,

You could potentially use a 3D DelaunayTri to compute the intersection. But the implementation may not be simple. I can't say how it would perform relative to the functions you are currently using as I have not tried or looked at geom3d. But if you were performing the intersection computation repeatedly on the same pair of polyhedra, you may be able to make some gains.

Here's the approach... Given two polyheda P and Q construct a DelaunayTri Tp and Tq representing each. Test the boundary edges of Tp against Tq (and vice versa). You have have 3 scenarios;
1) Both edge vertices are contained in Tq. 
2) One vertex contained in Tq the other is not - compute the intersection point. 
3) Both edge vertices are not contained in Tq - the edge could potentially pass through Tq or lie completely outside Tq. More analysis, e.g. ray intersection to qualify. The intersection volume would be given by the convex hull of the interior points and intersection points.

OK, you get the idea. It's not too difficult to get an approximate implementation up and running, but the real effort involves detecting and handling step 3 efficiently. DelaunayTri has a fast pointLocation test that will handle steps 1 and 2 very efficiently.  But whether you can ignore step 3 depends on your accuracy requirements and the "shape" of your polyhedra.

For more ideas see Christer Ericson's excellent book "Real-Time Collision Detection". If you want to have a shot at implementing a Delaunay-based algorithm feel free to contact me off-line with any questions.

Damian</description>
		<content:encoded><![CDATA[<p>Hi Kyle,</p>
<p>You could potentially use a 3D DelaunayTri to compute the intersection. But the implementation may not be simple. I can&#8217;t say how it would perform relative to the functions you are currently using as I have not tried or looked at geom3d. But if you were performing the intersection computation repeatedly on the same pair of polyhedra, you may be able to make some gains.</p>
<p>Here&#8217;s the approach&#8230; Given two polyheda P and Q construct a DelaunayTri Tp and Tq representing each. Test the boundary edges of Tp against Tq (and vice versa). You have have 3 scenarios;<br />
1) Both edge vertices are contained in Tq.<br />
2) One vertex contained in Tq the other is not - compute the intersection point.<br />
3) Both edge vertices are not contained in Tq - the edge could potentially pass through Tq or lie completely outside Tq. More analysis, e.g. ray intersection to qualify. The intersection volume would be given by the convex hull of the interior points and intersection points.</p>
<p>OK, you get the idea. It&#8217;s not too difficult to get an approximate implementation up and running, but the real effort involves detecting and handling step 3 efficiently. DelaunayTri has a fast pointLocation test that will handle steps 1 and 2 very efficiently.  But whether you can ignore step 3 depends on your accuracy requirements and the &#8220;shape&#8221; of your polyhedra.</p>
<p>For more ideas see Christer Ericson&#8217;s excellent book &#8220;Real-Time Collision Detection&#8221;. If you want to have a shot at implementing a Delaunay-based algorithm feel free to contact me off-line with any questions.</p>
<p>Damian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Smith</title>
		<link>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30821</link>
		<dc:creator>Kyle Smith</dc:creator>
		<pubDate>Thu, 19 Nov 2009 18:38:06 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30821</guid>
		<description>Hi Damian,

Considering that polyhedral booleans are not available through CGAL in matlab right now, are you aware of any simple way to calculate intersections of convex polyhedra.  I have utilized some of David Legland's geom3d functions (http://www.mathworks.com/matlabcentral/fileexchange/24484)to do this, but the calculation is much too slow for my application.

Thanks,
Kyle</description>
		<content:encoded><![CDATA[<p>Hi Damian,</p>
<p>Considering that polyhedral booleans are not available through CGAL in matlab right now, are you aware of any simple way to calculate intersections of convex polyhedra.  I have utilized some of David Legland&#8217;s geom3d functions (http://www.mathworks.com/matlabcentral/fileexchange/24484)to do this, but the calculation is much too slow for my application.</p>
<p>Thanks,<br />
Kyle</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damian Sheehy</title>
		<link>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30772</link>
		<dc:creator>Damian Sheehy</dc:creator>
		<pubDate>Thu, 12 Nov 2009 18:57:50 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30772</guid>
		<description>Hi Kyle,

Being a geometry buff I personally would like to have boolean support for polyhedra in MATLAB. But in practice, we have to weigh up the real need of a feature against its usefulness to our customers at large; otherwise MATLAB would grow out of control fairly quickly. Ultimately, it's requests from users like you that get our attention focused on features like this. At this point we do not have near-term plans to provide polyhedral booleans, and I will track your enhancement request as a vote in favor.


Best regards,

Damian</description>
		<content:encoded><![CDATA[<p>Hi Kyle,</p>
<p>Being a geometry buff I personally would like to have boolean support for polyhedra in MATLAB. But in practice, we have to weigh up the real need of a feature against its usefulness to our customers at large; otherwise MATLAB would grow out of control fairly quickly. Ultimately, it&#8217;s requests from users like you that get our attention focused on features like this. At this point we do not have near-term plans to provide polyhedral booleans, and I will track your enhancement request as a vote in favor.</p>
<p>Best regards,</p>
<p>Damian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Smith</title>
		<link>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30771</link>
		<dc:creator>Kyle Smith</dc:creator>
		<pubDate>Thu, 12 Nov 2009 17:59:37 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30771</guid>
		<description>Dear Damian,

Will the boolean operations for polyhedra from CGAL be included in MATLAB in the future?  I am currently using a crude, nonrobust algorithm for computing intersection of polyhedra.  I would like to find intersections of polyhedra in a robust and efficient way.

Thank you,
Kyle</description>
		<content:encoded><![CDATA[<p>Dear Damian,</p>
<p>Will the boolean operations for polyhedra from CGAL be included in MATLAB in the future?  I am currently using a crude, nonrobust algorithm for computing intersection of polyhedra.  I would like to find intersections of polyhedra in a robust and efficient way.</p>
<p>Thank you,<br />
Kyle</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damian Sheehy</title>
		<link>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30477</link>
		<dc:creator>Damian Sheehy</dc:creator>
		<pubDate>Sat, 18 Jul 2009 14:52:47 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30477</guid>
		<description>Hi Luigi,

Thank you for your feedback; you have touched on an important issue here. Most likely your data-set is highly-degenerate where many data points are aligned in a regular manner. The output from meshgrid is a typical example of a highly-degenerate dataset. During the incremental construction of the Delaunay, this data leads to many cases where a newly inserted point lies on the circumsphere of an existing tetrahedron within the triangulation. This invokes EGC to resolve potential ambiguity in the point-in-circumsphere test, and you end up paying a performance penalty in return for a robustness guarantee. 

Research and development on EGC and floating-point filters is on-going, and I am happy to report that the performance in this scenario is considerably improved in the next release of MATLAB (R2009b).

If we were to provide an option in DelaunayTri to bypass EGC, you may get lucky and get a triangulation, or you may not... In a production environment a somewhat slower valid solution is always better than an invalid one or no solution at all.

As you point out the triangulation is 3-4 times faster in the general case, and you only pay a penalty when you hit a highly-degenerate data-set. In practice this is not too common, and it's exactly this type of data that leads to failure in a pure floating-point Delaunay triangulation 
algorithm. 

If you can send me your data I would be more than happy to report the improvements you can expect in the next release (R2009b). 

Based on your impressive posts to the File Exchange you are in a good position to take advantage of the new Computational Geometry tools in MATLAB.

If you have any further enhancement requests please feel free to drop me an email, and keep up the good work!

Damian</description>
		<content:encoded><![CDATA[<p>Hi Luigi,</p>
<p>Thank you for your feedback; you have touched on an important issue here. Most likely your data-set is highly-degenerate where many data points are aligned in a regular manner. The output from meshgrid is a typical example of a highly-degenerate dataset. During the incremental construction of the Delaunay, this data leads to many cases where a newly inserted point lies on the circumsphere of an existing tetrahedron within the triangulation. This invokes EGC to resolve potential ambiguity in the point-in-circumsphere test, and you end up paying a performance penalty in return for a robustness guarantee. </p>
<p>Research and development on EGC and floating-point filters is on-going, and I am happy to report that the performance in this scenario is considerably improved in the next release of MATLAB (R2009b).</p>
<p>If we were to provide an option in DelaunayTri to bypass EGC, you may get lucky and get a triangulation, or you may not&#8230; In a production environment a somewhat slower valid solution is always better than an invalid one or no solution at all.</p>
<p>As you point out the triangulation is 3-4 times faster in the general case, and you only pay a penalty when you hit a highly-degenerate data-set. In practice this is not too common, and it&#8217;s exactly this type of data that leads to failure in a pure floating-point Delaunay triangulation<br />
algorithm. </p>
<p>If you can send me your data I would be more than happy to report the improvements you can expect in the next release (R2009b). </p>
<p>Based on your impressive posts to the File Exchange you are in a good position to take advantage of the new Computational Geometry tools in MATLAB.</p>
<p>If you have any further enhancement requests please feel free to drop me an email, and keep up the good work!</p>
<p>Damian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luigi Giaccari</title>
		<link>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30470</link>
		<dc:creator>Luigi Giaccari</dc:creator>
		<pubDate>Wed, 15 Jul 2009 19:35:23 +0000</pubDate>
		<guid>http://blogs.mathworks.com/loren/2009/07/15/computational-geometry-in-matlab-r2009a-part-i/#comment-30470</guid>
		<description>Hi,

I want to explain my problem maybe in future realese you can modify the computational geometry tools.

I am unsing delaunay in 3d space, I have always used the mex version of qhull. All I want is speed, because I don't care about slivers since in my appication I only need the triangles of tetraedrons. 

I was very happy when I saw then the new tool allows for about 3x time costruction fo delaunay tessellation of uniform dataset.But I sunddenly become sad when I tried it on sparse dataset (for who doesn't know they are critical for delaunay algorithms), it is terribly, but very terribly slow.  For a few thousands points I had to force it to stop before finishing after minutes of computation.


EGC is great thing but there should be a way to turn it off, can you please add it in the next release?

I thing also adding some more feature from CGAL will make MATLAB even more interestign than it si now.

Thank you for your attention and the tool you provided.

Regards

                Luigi

http://giaccariluigi.altervista.org/blog/</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I want to explain my problem maybe in future realese you can modify the computational geometry tools.</p>
<p>I am unsing delaunay in 3d space, I have always used the mex version of qhull. All I want is speed, because I don&#8217;t care about slivers since in my appication I only need the triangles of tetraedrons. </p>
<p>I was very happy when I saw then the new tool allows for about 3x time costruction fo delaunay tessellation of uniform dataset.But I sunddenly become sad when I tried it on sparse dataset (for who doesn&#8217;t know they are critical for delaunay algorithms), it is terribly, but very terribly slow.  For a few thousands points I had to force it to stop before finishing after minutes of computation.</p>
<p>EGC is great thing but there should be a way to turn it off, can you please add it in the next release?</p>
<p>I thing also adding some more feature from CGAL will make MATLAB even more interestign than it si now.</p>
<p>Thank you for your attention and the tool you provided.</p>
<p>Regards</p>
<p>                Luigi</p>
<p><a href="http://giaccariluigi.altervista.org/blog/" rel="nofollow">http://giaccariluigi.altervista.org/blog/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
