On 03.03.07, Andy Buckley wrote: > Hi, > > I've been writing a PyX-based 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 self-intersection, > 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 self-intersections 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 self-intersections 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 in-place 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 self-intersection 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. ------------------------------------------------------------------------- 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
