@@ -367,17 +367,33 @@ class Path
367
367
length += seg\ getLength!
368
368
return length
369
369
370
+ -- Gets the normalized tangent on the Path given a time
370
371
-- Gets the normalized tangent on the Path given a time
371
372
getNormalized : ( t = 0.5 ) =>
372
- sumLength, length, tan, p, u = 0 , t * @getLength !, nil , nil , nil
373
- @callBackPath ( id, seg) ->
374
- segmentLen = seg\ getLength!
373
+ sumLength, length, newPath, tan, p, u = 0 , t * @getLength !, Path !, nil , nil , nil
374
+ @callBackPath ( id, seg, k) ->
375
+ path, segmentLen = {} , seg\ getLength!
376
+ if newPath. path[ k] == nil
377
+ newPath. path[ k] = { seg. a}
375
378
if sumLength + segmentLen >= length
376
379
u = ( length - sumLength) / segmentLen
377
380
tan, p, u = seg\ getNormalized u
378
- return " break"
381
+ spt = seg\ split( u) [ 1 ]
382
+ if id == ' l'
383
+ insert newPath. path[ k] , spt. b
384
+ else if id == ' b'
385
+ insert newPath. path[ k] , spt. b
386
+ insert newPath. path[ k] , spt. c
387
+ insert newPath. path[ k] , spt. b
388
+ return " break" , p, u, newPath
389
+ if id == ' l'
390
+ insert newPath. path[ k] , seg. b
391
+ else
392
+ insert newPath. path[ k] , seg. b
393
+ insert newPath. path[ k] , seg. c
394
+ insert newPath. path[ k] , seg. d
379
395
sumLength += segmentLen
380
- return tan, p, u
396
+ return tan, p, u, newPath
381
397
382
398
-- Distort the Path into another Path
383
399
-- http://www.planetclegg.com/projects/WarpingTextToSplines.html
0 commit comments