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

Đang mở
#1,201 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@barendgehrels đang làm issue này rồi.

Từ ngày 24/11/2024.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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

Ngôn ngữ chính
C++
Star
519
Fork
240
Merge trung bình
4 ngày 15 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của boostorg/geometry

Tất cả issue của boostorg/geometry

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.