cgal icon indicating copy to clipboard operation
cgal copied to clipboard

CGAL::create_interior_straight_skeleton_2 failed

Open Supranaturaler opened this issue 2 years ago • 2 comments

Issue Details

CGAL::create_interior_straight_skeleton_2 returned null pointer for certain case. image

Here is the shape: image

Source Code

#include "CGAL/Exact_predicates_exact_constructions_kernel.h"
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;

#include "CGAL/Polygon_with_holes_2.h"
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes;

#include "CGAL/create_straight_skeleton_from_polygon_with_holes_2.h"

int main(int argc, char* argv[])
{
    Polygon_with_holes polygon;
    polygon.outer_boundary().push_back(Point_2(55800, 205857));
    polygon.outer_boundary().push_back(Point_2(52508.25, 202565.25));
    polygon.outer_boundary().push_back(Point_2(49216.5, 205857));
    polygon.outer_boundary().push_back(Point_2(48960, 205600.5));
    polygon.outer_boundary().push_back(Point_2(52251.75, 202308.75));
    polygon.outer_boundary().push_back(Point_2(48960, 199017));
    polygon.outer_boundary().push_back(Point_2(49216.5, 198760.5));
    polygon.outer_boundary().push_back(Point_2(52508.25, 202052.25));
    polygon.outer_boundary().push_back(Point_2(55800, 198760.5));
    polygon.outer_boundary().push_back(Point_2(56056.5, 199017));
    polygon.outer_boundary().push_back(Point_2(52764.75, 202308.75));
    polygon.outer_boundary().push_back(Point_2(56056.5, 205600.5));

    typedef boost::shared_ptr<Straight_skeleton> Straight_skeleton_ptr;
    Straight_skeleton_ptr pSkeleton = CGAL::create_interior_straight_skeleton_2(polygon, Kernel());
    if (pSkeleton)
    {
        return EXIT_SUCCESS;
    }
    else
    {
        std::cout << "CGAL::create_interior_straight_skeleton_2 failed!" << std::endl;
        return EXIT_FAILURE;
    }
}

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits): Windows 11 home basic 64 bits
  • Compiler: MSVC-2019-Community
  • Release or debug mode: debug
  • Specific flags used (if any):
  • CGAL version: CGAL5.2.2 CGAL5.4
  • Boost version: boost_1_76_0
  • Other libraries versions if used (Eigen, TBB, etc.):

Supranaturaler avatar Jan 19 '22 08:01 Supranaturaler

@MaelRL Hi, I would like to know when this issue can be fixed or how can I avoid this.

Supranaturaler avatar Feb 07 '22 02:02 Supranaturaler

I also encountered this problem, because there is a random scattering process, so my bone generation is occasionally successful, uncertain failure

for-heart-peace avatar Jul 25 '22 02:07 for-heart-peace

@Supranaturaler Hi, I would like to know when this issue can be fixed or how can I avoid this.

Sorry for the delay.

I can reproduce this with 5.2 and 5.3, but it's fine from 5.4 on.

Screenshot from 2022-12-14 12-27-55

MaelRL avatar Dec 14 '22 11:12 MaelRL