From 5da3f8df4b0f58397dfa6010da966d1c241ee3ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Wed, 3 Oct 2007 06:30:15 +0000 Subject: [PATCH] add vcap_pt for 3d graph git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@2889 069f4177-920e-0410-937b-c2a4a81bcd90 --- pyx/graph/graph.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pyx/graph/graph.py b/pyx/graph/graph.py index 3ae833d5..8823373e 100644 --- a/pyx/graph/graph.py +++ b/pyx/graph/graph.py @@ -723,17 +723,12 @@ class graphxyz(graphxy): def vcap_pt(self, coordinate, length_pt, vx, vy, vz): """returns an error cap path for a given coordinate, lengths and point in graph coordinates""" - raise NotImplementedError if coordinate == 0: - return path.line_pt(self.xpos_pt + vx*self.width_pt - 0.5*length_pt, - self.ypos_pt + vy*self.height_pt, - self.xpos_pt + vx*self.width_pt + 0.5*length_pt, - self.ypos_pt + vy*self.height_pt) + return self.vgeodesic(vx-0.5*length_pt/self.size_pt, vy, vz, vx+0.5*length_pt/self.size_pt, vy, vz) elif coordinate == 1: - return path.line_pt(self.xpos_pt + vx*self.width_pt, - self.ypos_pt + vy*self.height_pt - 0.5*length_pt, - self.xpos_pt + vx*self.width_pt, - self.ypos_pt + vy*self.height_pt + 0.5*length_pt) + return self.vgeodesic(vx, vy-0.5*length_pt/self.size_pt, vz, vx, vy+0.5*length_pt/self.size_pt, vz) + elif coordinate == 2: + return self.vgeodesic(vx, vy, vz-0.5*length_pt/self.size_pt, vx, vy, vz+0.5*length_pt/self.size_pt) else: raise ValueError("direction invalid") -- 2.11.4.GIT