BHoM / BHoM_Engine

Internal manipulation of the BHoM
GNU Lesser General Public License v3.0
26 stars 13 forks source link

Geometry_Engine: Split(Polyline, List<Line>, double) does not work against chained splitting lines #3282

Closed pawelbaran closed 6 months ago

pawelbaran commented 6 months ago

Description:

Due to the way in which Split(Polyline, List<Line>, double) method is written, it yields wrong results in cases where splitting curves consist of multiple segments, as in the picture below: image

In the above case, the splitting curve consists of 3 segments, while the alternative path along the outline is only 2 segments, therefore it is considered 'shorter' by the algorithm, resulting in the splitting curve being simply ignored: image

After investigation I believe this issue cannot be solved by simply fixing the current implementation, we will need something more complex, based on angles between edges (luckily in my work on https://github.com/BHoM/BHoM_Engine/issues/3260 I may have came up with a faster solution).

Happy to attempt to fix it as I have lots of code ready. Adding @FraserGreenroyd as 2nd assignee because he overviewed the original implementation.

Test file(s):

On SharePoint.