Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support object group deformation along curves #101

Open
ajyoon opened this issue May 18, 2023 · 3 comments
Open

Support object group deformation along curves #101

ajyoon opened this issue May 18, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@ajyoon
Copy link
Collaborator

ajyoon commented May 18, 2023

It would be great it neoscore could support things like curved staves. It's not obvious how this could be easily implemented though. I think a reasonable initial approach doesn't need to do add any special logic for staves, just deformation of arbitrary paths. (Note that the underlying text implementation uses paths, so in theory we should be able to implement this just for paths and get text behavior for free.) Ideally this deformation would operate as a sort of effect layer so a user could modify staff contents normally while the staff is under deformation. If users want to manipulate the path as deformed, they should be able to irreversibly commit the effect to the path contents (also irreversibly converting text objects into paths).

I see Inkscape supports this, maybe we can port their implementation.

A basis path in black, with a desired deformation path in green:
original

The basis path deformed:
bent

@ajyoon
Copy link
Collaborator Author

ajyoon commented May 18, 2023

here's how it looks when you deform an imported musescore system naively:

staff

there are some artifacts, but i think it's a good first step

@ajyoon ajyoon added the enhancement New feature or request label May 18, 2023
@Xavman42
Copy link
Contributor

The Inkscape implementation is surprisingly simple: https://gitlab.com/inkscape/inkscape/-/blob/master/src/live_effects/lpe-bendpath.cpp (putting this here mainly for personal reference)

@Xavman42
Copy link
Contributor

Another approach that may be mathematically simpler would be to deform a path or collection of paths to fit an envelope rather than a skeleton path or spline.

See the discussion here: benjamminf/warpjs#11
and the implementation here: https://codepen.io/benjamminf/pen/LLmrKN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants