Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer() Seg Faults with Ring as Input #370

Closed
xmrflipflop opened this issue Dec 1, 2016 · 3 comments
Closed

Buffer() Seg Faults with Ring as Input #370

xmrflipflop opened this issue Dec 1, 2016 · 3 comments
Assignees
Labels

Comments

@xmrflipflop
Copy link

On boost version 1.58.0 and C++14, boost geometry buffer with strategies fails when the input geometry given is a ring. Changing the type to a polygon behaves as expected.

I don't have newer boost versions available for testing unfortunately.

Test code below.

        std::cout << "Using Boost "
                  << BOOST_VERSION / 100000     << "."  // major version
                  << BOOST_VERSION / 100 % 1000 << "."  // minor version
                  << BOOST_VERSION % 100                // patch level
                  << std::endl;

        // Set up boost geometry types
        namespace bg = boost::geometry;
        using point_type = bg::model::point<float, 2, bg::cs::cartesian>;
        using polygon_type = bg::model::polygon<point_type>;
        using ring_type = bg::model::ring<point_type>;

        // Declare strategies
        constexpr float buffer_distance = 0.5F;
        const int points_per_circle = 36;
        bg::strategy::buffer::distance_symmetric<float> distance_strategy(buffer_distance);
        bg::strategy::buffer::join_round join_strategy(points_per_circle);
        bg::strategy::buffer::end_round end_strategy(points_per_circle);
        bg::strategy::buffer::point_circle circle_strategy(points_per_circle);
        bg::strategy::buffer::side_straight side_strategy;

        bg::model::multi_polygon<polygon_type> bufferedPolygon;
        ring_type originalPolygon;
//        polygon_type originalPolygon;

        bg::append(originalPolygon, point_type { 14.4980001F, 10.5F });
        bg::append(originalPolygon, point_type { 14.4980001F, 12.420001F });
        bg::append(originalPolygon, point_type { 15.9980001F, 12.420001F });
        bg::append(originalPolygon, point_type { 15.9980001F, 10.5F });
        bg::append(originalPolygon, point_type { 14.4980001F, 10.5F });

        bg::correct(originalPolygon);

        bg::buffer(originalPolygon, bufferedPolygon, distance_strategy, side_strategy,
            join_strategy, end_strategy, circle_strategy);
@xmrflipflop xmrflipflop changed the title Buffer Throws Abort with Ring Buffer() Aborts with Ring as Input Dec 1, 2016
@xmrflipflop xmrflipflop changed the title Buffer() Aborts with Ring as Input Buffer() Seg Faults with Ring as Input Dec 1, 2016
@xmrflipflop
Copy link
Author

Can confirm same behaviour with C++11 and current geometry-develop branch.

@barendgehrels barendgehrels self-assigned this Dec 1, 2016
@barendgehrels
Copy link
Collaborator

I can reproduce this. Will look at it next Wednesday.

@barendgehrels
Copy link
Collaborator

Sorry, it was not next Wednesday, but (hopefully) still in time to make it for 1.64.
It is now fixed by b320ddf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants