Invalid result of intersection for MLs, MPo -> MLs
- Dominant language
- C++
- Stars
- 517
- Forks
- 232
- PR merge metrics
- No merged PRs in 30d
Description
Geometry develop (1.72.0), with VS2017 x64.

```
typedef bg::model::point point;
typedef bg::model::linestring linestring;
typedef bg::model::polygon polygon;
typedef bg::model::multi_linestring multi_linestring;
typedef bg::model::multi_polygon multi_polygon;
multi_polygon mpo{ { { {0, 0}, {0, 1}, {1, 1}, {1, 0}, {0, 0} },
{ {0, 0}, {0.2, 0.1}, {0.1, 0.2}, {0, 0} } } };
multi_linestring mls{ { {0, 0}, {1, 0}, {1, 1}, {2, 0}, {3, 0} },
{ {-1, -1}, {0, 0}, {0, -1} } };
multi_linestring res_mls;
bg::intersection(mls, mpo, res_mls);
```
Result is: `MULTILINESTRING((0 0, 1 0, 1 1), (1.249e-16 2.498e-16, 0 0, 0 -1))`
should be: `MULTILINESTRING((0 0, 1 0, 1 1))`
Contributor guide
Research direction
Start at the bg::intersection(mls, mpo, res_mls) entry point using the supplied multi_linestring and multi_polygon inputs. Compare the produced geometry with the expected MULTILINESTRING and trace why the second line is retained; done means the intersection excludes that outside segment while preserving the valid first segment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100