[SciPy-user] Triangulation of L-shaped domains

Rob Hetland hetland at tamu.edu
Tue Jul 11 09:47:59 EDT 2006


>
> A very simple implementation (not heavily tested) of this method is
> attached.  Again, unfortunately, not vectorised.
>
> Cheers
> Stéfan
> <poly.py>

[I sent this message a while ago, but it appears to have been  
lost...  so again:]



I modified Stéfan's code (he may not recognize it anymore -- now it's  
ugly), so that the area and centroid methods are vectorized (using  
numpy arrays).  I also simplified the inside method (was call  
contains, but I think inside is more common).  Finally, I renamed the  
entire class from Poly to Polygon to prevent confusion with  
polynomial classes.  Everything seems to work, but I have not had a  
chance to test it extensively.

The inside class is slow when there are many points.  The code  
available here:

http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html

seems to work great.

Unfortunately, I am not very good at wrapping C into python, and I  
also not good at putting compiled code into distutils.  If anyone  
else has the skills and is so motivated, could we make a small class  
(with a compiled inside method) and throw it in the scipy sandbox?

-Rob


----
Rob Hetland, Assistant Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamue.edu/~rob
phone: 979-458-0096, fax: 979-845-6331


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20060711/8551c734/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: polygon.py
Type: text/x-python-script
Size: 4904 bytes
Desc: not available
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20060711/8551c734/attachment.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20060711/8551c734/attachment-0001.html>


More information about the SciPy-User mailing list