|
From: Joerg L. <jo...@us...> - 2005-09-14 13:43:23
|
On 14.09.05, Andre Wobst wrote:
> On 14.09.05, Jörg Lehmann wrote:
> > Log Message:
> > - introduce _epsilon for checking the singularity of a trafo
> > - only check for singularity in trafo constructor (this should catch
> > all errors automatically)
>
> Great. I like it. But I would also like to have a epsilon kwargs,
> which I can set to None. Use-case is to be able to define a trafo with
> determinate 0, which I'll not use for output. A stable epllise
> implementation could then be as short as:
Ok.
> class ellipse_pt(path):
>
> """ellipse with center (x_pt, y_pt) in pts,
> the two axes (a_pt, b_pt) in pts,
> and the angle angle of the first axis"""
>
> def __init__(self, x_pt, y_pt, a_pt, b_pt, angle, **kwargs):
> t = trafo.scale(a_pt, b_pt, epsilon=None).rotated(angle).translated_pt(x_pt, y_pt)
> return path.circle_pt(0, 0, 1, **kwargs).normpath(epsilon=None).transformed(t).path()
>
> I'm aware that we need the epsilon in the constructor only, but still
> I would do it very much like to keep it in the trafo as an instance
> variable and inherit it to newly created trafos (like by rotated) ...
What do you want to do in the case of __mul__, when there are two
trafos.
> and at some point we might also want to have inplace modification (I
> certainly would like to have them) and for that we should need to keep
> and to check the trafo not just in the constructor. Any doubts left?
Ok, this sounds reasonable.
> André
>
> PS: I think we should set the default for trafo._epsilon to 1e-10 (or
> even lower!), since a determinate for a 2x2 matrix has the
> dimension of its items to the power of two. We should be able to
> scale by a factor of 0.001 without any problems. Currently we
> have:
Definitely, let's go for (1e-5)**2.
Jörg
|