On 19.03.07, Joerg Lehmann wrote:
> On 16.03.07, Michael J Gruber wrote:
> > > On 15.03.07, Michael J Gruber wrote:
> > >> Lander venit, vidit, dixit 2007-03-15 15:56:
> > >>
> > >> 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.
> > > 
> > > The same has already been reported by Stefan Schenk (see pyx bug
> > > 1632988). Also the manual has been corrected in the svn version.
> > 
> > Who's looking at the manual ;)
> > 
> > I meant the docstrings for path.path.tangent(),
> > normpath.normpath.tangent() and the _pt variants.
> > 
> > > 
> > > However, J?rg did not seem to be quite satisfied with the
> > > length=1 solution.
> > 
> > I was quite surprised, too. That indeed does scale the tangent in a way
> > which depends on the default unit and the current scale factor. It seems
> > it's done just in order to save one or two if's.

No. The scaling is intended. When a user scales everything -- why not also the
tangent?

> I agree, this was one of the reasons, I didn't like the patch. The
> scaling problem could be solved by using true cms. But the question is
> whether one should really introduce a more or less arbitrary length
> scale here?

I do not see the problem. As I introduced the default value as a
simple number and not a pyx.length, I will be scaled as many other
default lengths in pyx.
The following minimal example scales both the circle and the tangent
by 5:

    from pyx import *
    unit.set(uscale=5)

    p = path.circle(0, 0, 1)
    c = canvas.canvas()
    c.stroke(p)
    c.stroke(p.tangent(1.57))


This is the behaviour I would expect from a useful default length.

The only other possibility I see is to omit the default argument completely.
This would avoid the -- somehow artificial -- introduction of a length scale
here.

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

Reply via email to