How to divide the path into several segments?

2019-09-19 19:08发布

I need to divide the Path into several sections. For example, a Path has a dashArray parameter that specifies the length of the dash and length of the gap. I need to get one or more paths that match only the dashes. That is, I need to get a path like this

path like this, but withoud dashArray

but without dashArray attribute. How can I do this using paper.js or some other library?

1条回答
甜甜的少女心
2楼-- · 2019-09-19 20:05

I found the solution to my problem. PaperJS have a method Path.getPointAt(offset) Here offset - is ofsset in pixels from start of path. I maked simple sketch

查看更多
登录 后发表回答