bg::intersection result is the second input polygon instead of empty polygon

オープン
#1,201 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@barendgehrels がすでに取り組んでいます。

2024年11月24日 から。

評価

この issue はまだ評価されていません。

説明

on version 1.83 the bg::Intersection generates wrong result for this specific case. The result polygon is same as the second input polygon Q.
When the first polygon P has instead of the value 1e-14 eg. 1e-13 or 1e-15, the result is empty, which is correct.

using boost_point_2d = boost::geometry::model::d2::point_xy;
using boost_polygon_2d = boost::geometry::model::polygon<boost_point_2d, false>;
using boost_multipolygon_2d = boost::geometry::model::multi_polygon<boost_polygon_2d>;

boost_polygon_2d P = {{{1e-14, 0}, {-10, 50}, {-20, 50}, {1e-14, 0}}};
boost_polygon_2d Q = {{{0, 1000}, {0, 0}, {1000, 0}, {1000, 1000}, {0, 1000}}};
boost_multipolygon_2d R;

bg::intersection(P, Q, R);
image

主要言語
C++
スター
519
フォーク
240
平均マージ
4日 15時間
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

boostorg/geometry のほかの issue

boostorg/geometry の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。