|
From: Andre W. <wo...@us...> - 2004-08-03 11:29:52
|
Hi, On 03.08.04, Magnus Lie Hetland wrote: > 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.) 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. > 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 custom-made paths as > brushes in other parhts. Very nice for calligraphic-like looks, for > example. (I guess one heavy-handed 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.) You're talking about pens, not fill patterns, right? I looked at this topic a few months ago after somebody asked me about it. In MetaPost you can do two kind of pen shapes: a polygon pen shape and a elliptic pen shape. For the first MetaPost calculates the boundary of the area to be stroked (i.e. filled, once the outline is calculated). While this is already a interesting part to program, the elliptic curve is quite different. MetaPost does not calculate a outline for that case (it would be an interesting challange, which seems to be related to the enlargment of arbitrary shaped boxes as we started to experiment in one of the test/experimental files some time ago). What metapost does is to draw the path with a circular pen (i.e. that's what PostScript does for a finite linewidth and round setting of linecap and linejoin). However, this drawing does not happen on the original path, but on a transformed path, where the transformation is the one to make the elliptic pen circular. To finally get the correct result, the transformation from the circular pen to the elliptic one is applied to the stroked path. That way you can stroke the path with a elliptic pen, but you can't calculated the outline. (AFAIK that's one of the problems people have to create outline fonts out of Metafont fonts.) > Sorry to turn yet another thread into one about possible features... > These are just a couple of things that came up when I took a stab at > implementing big, flexible braces (such as these: > http://just.letterror.com/ltrwiki/GlyphInterchangeFormat) in PyX. No problem. It's always interesting to look around ... André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ |