Support for reversing the path
See original GitHub issueAre there any plans to have support for reversing the path?
const path = svgpath(__your_path__)
const reversed = path.reverse();
Direct Path | Inverse Path |
---|---|
d="M50,300 L50,250 C50,150 75,150 100,250 C150,450 200,450 200,250 Q200,100 400,100" |
d="M400,100 Q200,100 200,250 C200,450 150,450 100,250 C75,150 50,150 50,250 L50,300" |
Issue Analytics
- State:
- Created 3 years ago
- Comments:23 (14 by maintainers)
Top Results From Across the Web
How do I inverse/reverse a path? - Adobe Support Community
Since an update long ago all paths I create become inverse. Anyone know what the settings need to be to avoid this? Or...
Read more >Support for Compile ("Reverse" Path-To-RegExp)? #41 - GitHub
Adding compile() based on the pattern support should be simple - path-to-regexp implementation is pretty short (even with the regexp validation ...
Read more >What is the "reverse" path in the case of a piecewise defined ...
You want to map a to γ2(d), b and c to γ2(c)=γ1(b) and d to γ1(a). Looking for a linear map φ(t)=At+B taking...
Read more >Reverse-path forwarding - Wikipedia
Reverse -path forwarding (RPF) is a technique used in modern routers for the purposes of ensuring loop-free forwarding of multicast packets in multicast ......
Read more >Reverse tree path - GeeksforGeeks
Given a tree and node data, the task to reverse the path to that particular Node. ... The idea is to use a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I did not declined
.reverse()
yet. IMO, those are candidates to add by priority:.from()
- useful for clone-related things in extentions.bbox() => [x, y, w, h]
- PR closed, but feature not declined.reverse()
- just because not trivial but small, and fits well into svgpath api.If (2) & (3) cost no much time for me [read as “your code can be reused” 😃] - i have no principal objections and can prepare commits.
IMO, countours split task is:
a) specific b) primitive (has trivial implementation,
string.split(/(?<=[zZ])\s*(?=[mM])/g)
)=> not a good candidate.
Consider
svgpath
not as lib with thousand of method, but as engine easy to extend.May be, it worth add
SvgPath.from()
(likeArray.from()
) for easy data clone.