boostorg / boostorg/geometry

Error in validity (report) (was: multipolygon buffer result either invalid geometry or valid geometry but wrong)

Open
#1,192 6 comments 0 reactions 1 assignee Claimed by @barendgehrels View on GitHub
Dominant language
C++
Stars
517
Forks
232
PR merge metrics
No merged PRs in 30d

Description

I want to buffer of a small amount the multipolygon in the following picture (I apologize if it is quite complicated, I tried to replicate the issue in a simpler shape but I could not make it):

![image](https://github.com/boostorg/geometry/assets/37936526/6cda47db-7011-4603-bc44-ca06b641e65f)

When applying the buffer algorithm, I have encountered two problems:
1. if the buffer amount is 0.05, we obtain an invalid geometry due to self-intersections in the external border;
2. if the buffer amount is 0.050005, we obtain a valid geometry, but the result is wrong (see image below).
![image](https://github.com/boostorg/geometry/assets/37936526/2730afe2-ee52-4124-9db2-39dcbbd0a3e1)

Here below a godbolt link to replicate this problem:
https://godbolt.org/z/vM9ex7MrW

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.