From: Michael SCHINDLER <mschindler@us...>  20070305 10:23:41

On 03.03.07, Andy Buckley wrote: > Hi, > > I've been writing a PyXbased library > (http://projects.hepforge.org/pyfeyn/) which makes a lot of use of the > coil deformer for arbitrary lines. For display reasons, it would be nice > if I can offer a "3D" variant of the coil line, where the line isn't > drawn for a short distance around one branch of its selfintersection, > giving the impression that you're actually looking at a 3D coil. > > (It's hard to describe... (Not really: It is absolutely clear what you mean) For this you need all selfintersections of the path. There is another deformer which uses the same technique, namely deformer.parallel There, you find a method deformer.parallel.normpath_selfintersections(...) which returns parameter values for all the intersections that occur between different elementary curves. Note, that selfintersections of a curve (to be distinguished from a path, which consists of several curves or lines) is not returned. Actually, this routine does not make use of its "self" argument and could therefore either be abused inplace at some parallel deformer  or, you just copy the code. Then, you have to fiddle around which of the intersecting curves you want to cut around this parameter value. You will have to convert several times from parameter to arclength to parameter (at least, this will be done internally) For the standard intersections which would occur for a line as the original path and a coil with thin intersecting loops, this will be straight forward. When two adjacent loops do intersect as well, it might become more complicated. > Any suggestions how I can get this effect? The obvious thing would be to > know the line param values for the selfintersection and then to split > the line and remove the segments around those points. But I don't know > how to get those intersection parameters  the fact that it's a > deformation of an arbitrary line means I can't use a standard regular > parameterisation and I get a roughly infinite number of points if I > actually ask the line for its intersection points with itself! Michael. 