Skip to content

feature request: split or mask a curve #374

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

Open
keszegh opened this issue Feb 9, 2021 · 5 comments
Open

feature request: split or mask a curve #374

keszegh opened this issue Feb 9, 2021 · 5 comments
Assignees

Comments

@keszegh
Copy link

keszegh commented Feb 9, 2021

It occurs quite often that one needs to draw different parts of a complicated shape with different styles (e.g. if two curves intersect at a point and one wants the two parts before and after the intersection to have different width/color etc.). as far as i know there is no way to do this properly in Ipe. Possibility to split/break a curve at any given point such that the two sub-curves look exactly as before would be a best solution. but also hiding (masking) parts of a curve would be a possible workaround, where one creates multiple copies of the same curve with different styles and hide the appropriate parts of the two curves.

@otfried
Copy link
Owner

otfried commented Feb 9, 2021

Both are already possible:

You can clip any object by making it a group (Ctrl+G), then using "Add clipping path"

The "Edit path" tool has options to cut a curve at any point.

@keszegh
Copy link
Author

keszegh commented Feb 9, 2021

Thanks, I missed those. And even with your pointers it was not easy to find them:

  1. actually "Edit path" tool is not mentioned in the manual, although i've found it in the context menu. still i did not find a way to cut at any point until i've by luck converted the spline to a bezier curve and then i've noticed that one can add a new vertex anywhere and cut there. it's really a revelation, but i guess should be detailed more in the manual.

  2. the 'add clipping path' works but it seems that when editing a group and then ending editing, the clipping path is removed. also i do not see any way to edit the clipping path after making it a clipping path. perhaps it should be visible on a special layer when editing the group.

@otfried
Copy link
Owner

otfried commented Feb 9, 2021

It's no secret that the manual needs a lot of work...

  1. Converting your spline to Beziers is a drastic step, it makes it much harder to modify it in the future. Unfortunately it's simply not possible to cut the splines at arbitrary points. For B-splines (the default spline format), the trick is to insert knots around the point where you want to cut, leaving you with a single Bezier curve that can be cut at any position.

  2. Putting the clipping path in a separate layer during group edit is a good idea.

@keszegh
Copy link
Author

keszegh commented Feb 9, 2021

  1. This is another nice trick that one can essentially convert only a part of a spline into a bezier curve. Thanks

@otfried otfried self-assigned this Feb 10, 2021
@otfried
Copy link
Owner

otfried commented Feb 10, 2021

Come to think of it, a function to cut a B-spline at any point would also be good. It would insert the knots around the cut point and then cut the Bezier curve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants