Opened 8 years ago

Closed 8 years ago

#10843 closed Bugs (fixed)

polygon / voronoi: points on line segments yield errors

Reported by: maik.nijhuis@… Owned by: Andrii Sydorchuk
Milestone: To Be Determined Component: polygon
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

http://www.boost.org/doc/libs/1_57_0/libs/polygon/doc/voronoi_main.htm says: "input segments should not overlap except their endpoints"

Their is no restriction on input *points*, though, so I conclude that points may lie on line segments. However, construct_voronoi fails with the following input:

  • One point, at (1, 0)
  • One line segment, from (0, 0) to (2, 0)

The output has only one vertex, with invalid x and y coordinates.

Fortunately, I can easily work around the issue:

  • Before calling construct_voronoi, I was already using intersect_segments for creating proper input segments. When I add the points as zero-length segments in the input for intersect_segments, intersect_segments will cut segments when there is a point at the segment.
  • Since intersect_segments discards zero-length segments, I still pass the points separately, as I did before.

Could you please either update the documentation or resolve the issue otherwise?

Change History (2)

comment:1 by Andrii Sydorchuk, 8 years ago

Owner: changed from Lucanus Simonson to Andrii Sydorchuk
Version: Boost 1.57.0Boost 1.58.0

Hi Maik,

Thank you for the report!

You are right, the documentation is not complete. Input geometries should not intersect except their endpoints. I updated the docs in the development branch and they should be merged in 1.58 release.

comment:2 by Andrii Sydorchuk, 8 years ago

Resolution: fixed
Status: newclosed

The change was merged to the master branch. You can either start using new documentation from the github repo: https://github.com/boostorg/polygon or wait for the Boost 1.58 release.

Note: See TracTickets for help on using tickets.