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

Segment/segment intersections #194

Open
simoncozens opened this issue Sep 9, 2021 · 6 comments
Open

Segment/segment intersections #194

simoncozens opened this issue Sep 9, 2021 · 6 comments
Labels
enhancement New feature or request in progress Someone is working on the issue, or a related PR is waiting for review

Comments

@simoncozens
Copy link
Collaborator

We currently have a line/segment intersection method, which is great, but I think a generic segment/segment intersection trait would be very useful: line/line, line/curve, curve/curve. I have this code in beziers.py and not having it in kurbo is a blocker for me in moving some projects to kurbo.

The only problem is that segment/segment intersections have many gnarly edge cases, and I'm not 100% convinced that my code handles all of them.

@simoncozens
Copy link
Collaborator Author

I have got most of this implemented, leaning on intersect_line for everything apart from the curve/curve intersection case, but I'm having problems terminating the bisection at the right point. (Which I think was a problem with the Python implementation too.)

@tylers-epilog
Copy link

Hi Simon.

Is this still being worked on? I'd like to contribute to this library by providing a way to add operators to paths. For example, get the union of two paths, or subtracting filled shapes of one path from another. Intersections between Beziers/line is necessary to do this.

If you have any code that you can provide for a starting point, that would be great. If not, I plan to add the GeoClip intersection algorithm. I have quite a bit of experience in a similar algorithm, BezClip, so I'm not going into this completely blind, but if you have any tips from your past experience on doing this, please let me know

Thanks,
Tyler

@simoncozens
Copy link
Collaborator Author

I implemented it in #199; waiting for review...

@raphlinus
Copy link
Contributor

Ah, I should take a look at that. On quick skim, it looks pretty good. I'm uneasy about adding a new trait, as those are really intended for user-defined curves (think Euler spirals and similar) and I doubt that trait will get implemented for anything other than existing beziers. (See #6 for thoughts). But that's not a showstopper.

If someone else knowledgeable were to go through that code carefully, I'd be happy to approve after another light skim myself.

@richard-uk1 richard-uk1 added enhancement New feature or request needs discussion This change requires some more discussion before we decide we definitely want it in progress Someone is working on the issue, or a related PR is waiting for review and removed needs discussion This change requires some more discussion before we decide we definitely want it labels Mar 18, 2023
@StudioLE
Copy link

StudioLE commented Jul 9, 2024

Are there any plans for this issue to be picked up again?

It sounds like @simoncozens implemented a solution in #199

@simoncozens
Copy link
Collaborator Author

#219 supersedes #199.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress Someone is working on the issue, or a related PR is waiting for review
Projects
None yet
Development

No branches or pull requests

5 participants