Closed IsakNaslundBh closed 1 month ago
@BHoMBot check compliance
@BHoMBot check compliance
After chat with @pawelbaran have fixed the comments and agreed on the following:
@BHoMBot check compliance
@BHoMBot check unit-tests
@BHoMBot check compliance @BHoMBot check unit-tests @BHoMBot check required
@BHoMBot check ready-to-merge
NOTE: Depends on
https://github.com/BHoM/BHoM/pull/1632
Issues addressed by this PR
Closes #3235 also should resolve all issues for polylines in #1333. Leaving that issue open though, as PolyCurves are not handled by this PR.
Full refactor of Polyline offset.
Test files
On SharePoint
Changelog
Additional comments
Started this off as a little side project, that ended up as a quite massive PR, as I went through and thought of more and more edge cases to be handled. Think this now, thoguh, should be really quite stable as well as quick and able to handle many many weird and wonderful edge cases.
The main offset method could for some cases return ever so slightly different results compared to before, but I am pretty confident that what it doing now is more sane and reliable, and gives better control over the behaviour.
Logic I have put in place (by default) is for the offset curve once a self-intersection occurs, is to keep the part with largest area for a closed curve, and always keep the start and end bits for an open curve. Could ofc be changed to longest length or something like that instead, but area, and start and end felt the most sensible to me. as a starting point.
A lot of the code gets a wee bit complex in places, and there is quite a lot of vector maths going on that I have tried to comment as much as possible. Happy to have a chat through it though.