boostorg / boostorg/geometry

Buffer problem and understanding chord error

Ouverte
#578 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
517
Forks
232
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I have a problem with boost::geometry::buffer. Basically I offset/buffer one linestring by a certain value (e.g. 4) using a certain number of points_per_circle (in my case 180). Now, I offset a second linestring, which lies inside or at most on the first linestring. The second linestring is offset by a value smaller than the first
4 - chord_error
and I expected there to be no intersections. However, in (few) cases there are intersection points between the two offsets.

I compute the chord error as
chord_error(npts, radius) = ( 1. - cos( Pi / npts)) * radius

Maybe the problem has to do with my interpretation of **points_per_circle** as I expected to be able to derive from it a smallest number that can be used to guarantee that the second offset lies completely within the first.

Please advice.

The following program demonstrates my problem:
https://wandbox.org/permlink/wvGM3SFlM5MXLx5Z

LineString ls0 (green) lies within or on ls1 (red).
![image](https://user-images.githubusercontent.com/31598216/54916544-0984cf00-4efa-11e9-9fb3-1d537b52ebe0.png)

From a large box around ls1 is subtract the buffer of ls1, this yields **remains_of_aabb** (brown).
![image](https://user-images.githubusercontent.com/31598216/54916625-3a650400-4efa-11e9-992f-b9e059162658.png)

The buffer of ls0 (blue) now intersects remains_of_aabb, and lies as much as 89.9959-89.9987 = -0.0028 outside.
![image](https://user-images.githubusercontent.com/31598216/54916663-59fc2c80-4efa-11e9-8b37-b2bbe9ccb1b5.png)

![image](https://user-images.githubusercontent.com/31598216/54916807-a47da900-4efa-11e9-93e7-a90ee89a2410.png)

Thanks in advance

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.