From: mathog <ma...@ca...> - 2012-09-04 19:54:44
|
On 04-Sep-2012 12:28, Johan Engelen wrote: > On 4-9-2012 21:14, mathog wrote: >> subpath = make_sub_path(P,from,start,end,&trunc); > Have a look at Path::portion. The parameters are "time-values" > along > the path I believe, not distance. To match time values with distance > along the path, you can do an arc_length_parametrization, but I think > that is only available for Piecewise<D2<SBasis> > paths. But it may > not > be necessary to do that (expensive) operation, if you can derive your > start/end points as time-values in a different way. By "time-values" you mean the "t" paramter 0->1 for a Bezier curve? Does portion() work for a path that consists of more than one Bezier curve? Here is a specific example using line segments (which could be represented by Beziers): P = {{0,0},{0,1},{1,1},{1,2}}; subpath = make_sub_path(P,{0,0},0.5,1.7,&trunc); Results in subpath = {{0,0.5},{0,1},{1,1}{1,1.2}} I don't see what a 0->1 "t" could be in this situation other than by first calculating the length of P and then making it a fraction of that length. Thanks, David Mathog ma...@ca... Manager, Sequence Analysis Facility, Biology Division, Caltech |