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

2D Convex hull crash in CGAL #1871

Closed
kintel opened this issue Nov 24, 2016 · 7 comments
Closed

2D Convex hull crash in CGAL #1871

kintel opened this issue Nov 24, 2016 · 7 comments

Comments

@kintel
Copy link
Member

kintel commented Nov 24, 2016

Reported by @More-Wrong.
See CGAL issue: CGAL/cgal#1703

w = 10;
t = 2;
$fn = 20;
hull() {
   translate([0,3*w/4]) {
      rotate([0,0,60]) {
         translate([-10, -w/2+0.05]) {
            square([10, t]);
         }
      }
   }
   translate([-w/2, -w/2+t]) {
      square([t, 0.000000000000001]);
   }
}

Stack trace:

#3	0x0000000101d57d70 in CGAL::postcondition_fail(char const*, char const*, int, char const*) ()
#4	0x00000001002c3590 in std::__1::back_insert_iterator<std::__1::list<CGAL::Point_2<CGAL::Cartesian<double> >, ... 
#5	0x00000001002bfa75 in std::__1::back_insert_iterator<std::__1::list<CGAL::Point_2<CGAL::Cartesian<double> >, ... 
#6	0x00000001002bfa21 in std::__1::back_insert_iterator<std::__1::list<CGAL::Point_2<CGAL::Cartesian<double> >, ... 
#7	0x00000001002b477d in std::__1::back_insert_iterator<std::__1::list<CGAL::Point_2<CGAL::Cartesian<double> >, ... 
#8	0x00000001002a1c80 in GeometryEvaluator::applyHull2D(AbstractNode const&) at /Users/kintel/code/OpenSCAD/openscad/src/GeometryEvaluator.cc:169

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@kintel kintel added the Ext: CGAL Related to upstream CGAL bug/issue label Nov 24, 2016
@kintel kintel added this to the 2016.12 milestone Nov 24, 2016
@kintel
Copy link
Member Author

kintel commented Nov 24, 2016

Update from CGAL: convex_hull_2 needs an exact kernel

@kintel kintel added Dep: CGAL and removed Ext: CGAL Related to upstream CGAL bug/issue labels Nov 24, 2016
@nophead
Copy link
Member

nophead commented Nov 24, 2016

I thought OpenSCAD no longer used CGAL for 2D operations?

@kintel
Copy link
Member Author

kintel commented Nov 24, 2016

In general not, but we haven't found a suitable replacement for 2D convex hulls

@nophead
Copy link
Member

nophead commented Nov 24, 2016 via email

@donbright
Copy link
Sponsor Member

i would imagine that if you use fixed-width floating point coordinates, then translating and rotating a set of points in space will result in different topology for the hull at different orientations and locations. in other words if you traverse the points of the hull clockwise and print out each point's coordinates, you will get a different list depending on where the object is located in space.

@kintel
Copy link
Member Author

kintel commented Nov 27, 2016

@donbright That's pretty accurate. Not sure that topology would differ but certainly vertex count and relative position. Otoh, it already does as we perform 2D hulls using floating point coordinates.

@kintel
Copy link
Member Author

kintel commented Mar 27, 2024

The reported example now works without crashing.

@kintel kintel closed this as completed Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants