jbuckmccready / cavalier_contours

2D polyline/shape library for offsetting, combining, etc.
Apache License 2.0
144 stars 12 forks source link

Support polyline with multiple offsets #19

Open WindingWinter opened 2 years ago

WindingWinter commented 2 years ago

I posted this question at the C++ issue tracker-- I'm not sure whether this or that place is the right place to post. Anyway feel free to close the one that is not relevant.

The question is this: Is there any plan to support variable offsets? Something like NetTopologySuite VariableBuffer. Currently only uniform offset can be done throughout all the vertexes on the polylines.

jbuckmccready commented 2 years ago

I think the algorithm used by this library would not work with variable offset distance because distance checks are used to remove invalid/collapsed offset parts (global invalid segments), I am not sure what that means when comparing distances between two variable offset distance segments - it would definitely have to be modified to get it to work. There may be other modifications required to make the raw offset join/trim code work as well.

I currently have no plan to to work on variable offsets, but pull requests/contributions are welcome if the algorithm is implemented and working.

WindingWinter commented 2 years ago

Thank you for your email. Do you have any ideas on how to modify your algorithm to make it work on variable offsets?

On Fri, Jan 7, 2022 at 4:44 AM Jedidiah Buck McCready < @.***> wrote:

I think the algorithm used by this library would not work with variable offset distance because distance checks are used to remove invalid/collapsed offset parts (global invalid segments), I am not sure what that means when comparing distances between two variable offset distance segments - it would definitely have to be modified to get it to work. There may be other modifications required to make the raw offset join/trim code work as well.

I currently have no plan to to work on variable offsets, but pull requests/contributions are welcome if the algorithm is implemented and working.

— Reply to this email directly, view it on GitHub https://github.com/jbuckmccready/cavalier_contours/issues/19#issuecomment-1006921906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADENIZUGBJHJY4QYROGK4XDUUX5LDANCNFSM5LLXSDOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

jbuckmccready commented 2 years ago

I don't have any ideas offhand - I think it would require a fairly deep dive into it.

FishOrBear commented 2 years ago

Maybe something like this? image

WindingWinter commented 1 year ago

Yes, but is that doable?

On Tue, Apr 26, 2022 at 3:28 PM FishOrBear @.***> wrote:

Maybe something like this? [image: image] https://user-images.githubusercontent.com/19372111/165245505-eeb5bb41-243a-4d30-9b82-846259b6e688.png

— Reply to this email directly, view it on GitHub https://github.com/jbuckmccready/cavalier_contours/issues/19#issuecomment-1109445026, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADENIZSF7P3377PJLLSI723VG6LJTANCNFSM5LLXSDOQ . You are receiving this because you authored the thread.Message ID: @.***>