[Tutor] Triangle structure for triangulation

2007-08-30 Thread János Juhász
Dear All, I have written a Delaunay triangulation 10 years ago in C based on triangle structure. It was 400 lines, so it seems to be a fine task to turn into python. My problem is the translation of the C structure and the OO thinking. I tried to draft it so. /* The triangle, its

Re: [Tutor] Triangle structure for triangulation

2007-08-30 Thread Alan Gauld
János Juhász [EMAIL PROTECTED] wrote ## I can translate it into python in this way class Triangle: def __init__(self, points, neighbours): self.points = points self.neighbours = neighbours def TOR(self, direction): return (self, (direction+1)%3) def

[Tutor] Triangle structure for triangulation

2007-08-30 Thread János Juhász
Dear Allan, thanks for your coments. ## I can translate it into python in this way class Triangle: def __init__(self, points, neighbours): self.points = points self.neighbours = neighbours def TOR(self, direction): return (self, (direction+1)%3)

Re: [Tutor] Triangle structure for triangulation

2007-08-30 Thread Alan Gauld
János Juhász [EMAIL PROTECTED] wrote ## I can translate it into python in this way class Triangle: def __init__(self, points, neighbours): def TOR(self, direction): def ROT(self, direction): def RIGHT(self, direction): and store it as an attribute. But it sounds like