From: Michael Schindler <mschindler@us...>  20040803 12:47:36

Hi, As far as I know this is what people use: 1. For the interpolation problem: Curves passing through given points: (A) smooth curves built by piecewise polynoms (parameterized by the spacial coordinates). This requires to solve quite large systems of linear equations  not a problem in principle, but the outcome is often poor because the polynoms are too restrictive. > IIRC Michael Schindler played with some smooth curve thru some given > points before already. I'm not sure whether any code is laying around > somewhere, which could be usefull in that respect. But in principle > you're right: it might be added on top of the existing PyX. for the case of equal spacing this problem needs no numeric solver, and I am planning to implement this as a graph.style.curve (B) parametric curves. In principle one gets nonlinear equations for the parameter values  a really hard problem. This requires a lot of information on the specific geometric case. Especially, using boundary constraints like a certain tangent of a curve or so is not straightforward formulated in terms of a general parameterization. This is maybe what Magnus Lie Hetland asks for. > > The curve construction reminds me of a feature (or set of features) > > from MetaPost that I believe is not available in PyX, but which can be > > quite nice... Basically, it's the spline stuff that tries to fit a > > curve to the points you give (without you having to give the Bezier > > contour points explicitly). Also, you can give such (very useful) > > constraints as the direction of the curve at a given point, and the > > spline will adapt to that. I assume this could quite easily be built > > on *top* of PyX  I just thought it might be nice to have it as an > > integrated part of the path mechanism? (I don't know the details of > > the splines used by MP/MF, but they look fine, IMO.) I do not know how metafont is doing that, but I think MF knows some generic cases and uses a kind of "optimal" parameterization  depending on the problem it has to solve. I do not even think that it is really an interpolating program  rather a mixture of interpolating and optimisation... Another example is finding the outline of brushes or enlarging arbitrarily shaped boxes. > > And another thing... I have no idea how it's done in MP (in MF I can > > sort of understand it) but MP allows you to use custommade paths as > > brushes in other parhts. Very nice for calligraphiclike looks, for > > example. (I guess one heavyhanded way of doing it would be simply to > > replicate the brush all along the path, with the appropriate spacing > > calcilated somehow, perhaps even dynamically along the path.) 2. Optimization problem: Approximating curves (C) Mainly used are extended bezier curves that have a wellspecified starting and ending point and try to pass through several other points on their way. To me this never looked very useful ... Maybe there is the "quadrature of the circle": The bezier curves depend linearly on their endpoints. For them one can build up a linear system of equations  again with some (linear) constraints ... This would merge the advantages of the (ordinary) splines and the parametric curves ... Does anyone know the name of this method or where to find this? I would say that this might be the most promising way to build a general algorithm in PyX for these nonstandard path operations. Michael.  "A mathematician is a device for turning coffee into theorems" Paul Erdös. 