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

Problem cutting polyline with point. #285

Open
MarekBak opened this issue Sep 23, 2021 · 3 comments
Open

Problem cutting polyline with point. #285

MarekBak opened this issue Sep 23, 2021 · 3 comments

Comments

@MarekBak
Copy link

I'm trying to cut polyline using two points. I use getNearestCoordinate to cast them on polyline. Then I'm creating two cutters:

Polyline cutter1 = new Polyline(castedFirstPoint, castedFirstPoint);
Polyline cutter2 = new Polyline(castedSecondPoint, castedSecondPoint);

The problem is that cut operator fails if cutter len is 0. It would be nice to make such case (polyline, point which lies on poly line) working since I'm not seeing any other way to get part of polyline from firstPoint to secondPoint. Or maybe I'm missing something.

@alocke
Copy link
Member

alocke commented Sep 24, 2021

What if you made the cutter a polyline from the first point to the second point?

Polyline cutter = new Polyline(castedFirstPoint, castedSecondPoint);

@MarekBak
Copy link
Author

As far as I understand cut operator it will fail since cutter line will cross cutee more than two times (the cutee is zig-zag alike). Below is example what I'm trying to achieve.
example

@DaveInCaz
Copy link
Contributor

I would form two cutters, each perpendicular to the cuttee at the given points. I imagine the length of the cutters could be very close to zero.

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

No branches or pull requests

3 participants