Interesting, but I think subdividing triangles like this is unnecessary.  For 
most cases, when one triangle completely covers the other, all that is required 
it to Z order the triangles.  This is what mplot3d does already.  The only case 
we have yet to handle is when one triangle "pierces" the other.  As seen in the 
attached image.  Triangle B is mostly behind triangle A, except for a small 
piece labeled C.  All we would have to do is determine the line of 
intersection, then create a new triangle C.  Then we just draw B first, then A, 
then C.  

I think the hardest part is probably doing this for general polygons and 
handling the edges properly.  But that should not be super hard.

-Ben



________________________________________
From: Friedrich Romstedt [friedrichromst...@gmail.com]
Sent: Saturday, February 27, 2010 11:28 AM
To: matplotlib-users
Subject: Re: [Matplotlib-users] mplot3d stays?

http://www.friedrichromstedt.org/python/pyclip/a01.Zerteilung.pdf
(It's unfortunately in german, but the graphics are self-explaining)
A school mate working together with me on the project has worked that out.

H = number of corners of the front triangle lying inside of the back triangle

V = number of corners of the back triangle lying inside of the front triangle

S = number of the collinear edges of the two triangles

Z = number of intersection points of the two tringles' edges, minus
the number of those occuring because of collinear edges.

Red: front triangle
Black: back triangle
Green: subdivision lines in the back triangle.

I will check my implementation in C++ today.  I will maybe need some
advice in making a Python module out of it.

Friedrich

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

<<attachment: triangles.png>>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to