Yqnn / svg-path-editor

Online editor to create and manipulate SVG paths
https://yqnn.github.io/svg-path-editor/
Apache License 2.0
4.04k stars 326 forks source link

Feature Request: Split exiting command into two #102

Open sunnygoyal opened 1 year ago

sunnygoyal commented 1 year ago

Following up on issue #99 since it was closed based on wrong context.

Provide ability to split a command into two, by inserting a new point in the middle.

For example, if the command is h 10 it should become h 5 h 5. Optionally provide an option so that user can control the split ration (or default to half split)

For reference, bezier curve can be split using the following method: https://stackoverflow.com/questions/18655135/divide-bezier-curve-into-two-equal-halves

This is useful when trying to match two path commands for morphing.