Lander venit, vidit, dixit 2007-03-15 15:56: > Hello, > > I'd like to thank the PyX developers for this amazing > package. Congratulations and keep up the good work. > > This is for PyX 0.9. There's something I don't understand > about the tangent method provided by path. After reading > the documentation, I thought that "length" was an optional > argument, with None as default value. In this case, a > normalized unit vector would be returned. Please, consider > the following trivial example: > > cir = path.circle(0, 0, 1) > tg = cir.tangent(cir.atbegin()) > > When Python executes the second line, it throws a TypeError > exception. Here's the traceback:
You want to use cir.begin() instead of cir.atbegin(). begin() returns the path parameter, whereas atbegin() returns the coordinates, i.e. at(begin()). Still, there's the error thrown by the unit conversion for None. In PyX 0.8.1 things worked the way it ought to, so it's a regression. I'll attach a patch which fixes this. Oh, I see it's kind of patched in svn already: Now, the default value of length is 1, not None, so that things work if you don't specify a length. Passing "length=None" still doesn't work, so I guess the description should be changed. Cheers, Michael ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ PyX-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyx-user
