János Juhász wrote:
> Dear Tutors,
>
> I made an OO style triangulation based on an old C progam I made about 10
> years ago.
> The sample is working finally.
> First time I made the triangulation with recursion, but I reached the
> recursion limit very shortly.
> So I changed the recursion to a queue.
>
> I am interested about your opinions about the OO style.
> It hasn't got too much comments, but probably readable.
> [snip some code]
>
> def Swap(self, C): ## Ta2 Ta2
> """ Swap a triangle pair """ ## / \ /
> \
> D = self.NextPoint(C) ## / a2 \ /
> a2 \
> A = self.PrevPoint(C) ## A---------B
> A---------B
> t2 = self.BottomTriangle(C) ## / | \ | \ / |
> / | \
> B = t2.NextPoint(D) ## a1| \ t2 | a1
> |self / |
> a1 = self.BottomTriangle(D) ## |self \ | d2 |
> / t2 | d2
> d1 = self.BottomTriangle(A) ## \ | \ | / \ |
> / | /
> a2 = t2.BottomTriangle(D) ## C---------D
> C---------D
> d2 = t2.BottomTriangle(A) ## \ d1 / \
> d1 /
> Ta2 = a2.NextPoint(B) ## \ / \
> /
> Td1 = d1.NextPoint(C) ## Td1 Td1
>
As you can see, your code is not very readable.
Please post large sections of code as attachments in the future.
This is probably the main reason you've gotten no replies.
-Luke
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor