jscad / csg.js

DEPRECATED: CSG Library for JSCAD (See the link below)
https://github.com/jscad/OpenJSCAD.org/tree/master/packages/modeling
MIT License
217 stars 56 forks source link

Feature Request: Polygon is self intersecting! error message should show details #162

Closed WolfgangFahl closed 2 years ago

WolfgangFahl commented 5 years ago

Currently the error is created like this:

if (isSelfIntersecting(result)) {
    throw new Error('Polygon is self intersecting!')
}

and the issue is only shown by some magic debug which can be switched on in the console

if (doLinesIntersect(side0[0], side0[1], side1[0], side1[1])) {
        if (debug) { console.log('side ' + i + ': ' + side0); console.log('side ' + ii + ': ' + side1) }
        return true
      }

since there is only one pair of points that causes the issue the information about the pair of points could be part of the error message and would be a major improvement in finding the culprit for such an issue e.g. when importing svg files.

z3dev commented 2 years ago

@WolfgangFahl This issue will not be fixed as part of this library, which is obsolete now.

If this is an issue inside the modeling library of OpenJSCAD.org then this can be fixed, but I believe this check is no longer performed.

If satisfied then please close this issue.

z3dev commented 2 years ago

This will not be fixed. Please reopen issues at OpenJSCAD.org