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

Crashes on these points #5

Closed
paulharris opened this issue Jul 14, 2017 · 1 comment
Closed

Crashes on these points #5

paulharris opened this issue Jul 14, 2017 · 1 comment

Comments

@paulharris
Copy link

> var qh = require('quickhull3d');
> var pts =
[ [ 38, 89, 0 ],
  [ 85, 91, 0 ],
  [ 94, 89, 0 ],
  [ 70, 40, 0 ],
  [ 63, 90, 0 ],
  [ 60, 52, 0 ],
  [ 20, 16, 0 ],
  [ 38, 13, 0 ],
  [ 25, 82, 0 ],
  [ 7, 80, 0 ],
  [ 28, 80, 0 ],
  [ 43, 64, 0 ],
  [ 48, 68, 0 ],
  [ 86, 64, 0 ],
  [ 52, 60, 0 ],
  [ 56, 75, 0 ],
  [ 47, 3, 0 ],
  [ 68, 13, 0 ],
  [ 50, 44, 0 ],
  [ 82, 54, 0 ],
  [ 96, 45, 0 ],
  [ 85, 1, 0 ],
  [ 30, 24, 0 ],
  [ 54, 3, 0 ],
  [ 65, 95, 0 ],
  [ 95, 7, 0 ],
  [ 97, 42, 0 ],
  [ 44, 73, 0 ],
  [ 79, 55, 0 ],
  [ 72, 34, 0 ],
  [ 8, 18, 0 ],
  [ 79, 46, 0 ],
  [ 92, 32, 0 ],
  [ 61, 29, 0 ],
  [ 21, 7, 0 ],
  [ 24, 25, 0 ],
  [ 41, 32, 0 ],
  [ 72, 91, 0 ],
  [ 1, 63, 0 ],
  [ 18, 8, 0 ],
  [ 44, 99, 0 ],
  [ 59, 90, 0 ],
  [ 12, 15, 0 ],
  [ 81, 60, 0 ],
  [ 21, 10, 0 ],
  [ 9, 71, 0 ],
  [ 12, 86, 0 ],
  [ 99, 41, 0 ],
  [ 32, 48, 0 ],
  [ 40, 20, 0 ],
  [ 47, 89, 0 ],
  [ 41, 9, 0 ],
  [ 29, 80, 0 ],
  [ 56, 63, 0 ],
  [ 36, 11, 0 ],
  [ 25, 14, 0 ],
  [ 44, 40, 0 ],
  [ 60, 41, 0 ],
  [ 32, 81, 0 ],
  [ 64, 56, 0 ],
  [ 41, 90, 0 ],
  [ 29, 73, 0 ],
  [ 68, 97, 0 ],
  [ 91, 90, 0 ],
  [ 57, 0, 0 ],
  [ 67, 34, 0 ],
  [ 64, 8, 0 ],
  [ 66, 65, 0 ],
  [ 39, 90, 0 ],
  [ 72, 62, 0 ],
  [ 63, 13, 0 ],
  [ 45, 94, 0 ],
  [ 2, 34, 0 ] ];
> qh(pts);
TypeError: Cannot read property 'point' of undefined
    at QuickHull.createInitialSimplex (/tmp/node-v6.11.1-linux-x64/qhull3/node_modules/quickhull3d/dist/QuickHull.js:398:32)
    at QuickHull.build (/tmp/node-v6.11.1-linux-x64/qhull3/node_modules/quickhull3d/dist/QuickHull.js:835:12)
    at runner (/tmp/node-v6.11.1-linux-x64/qhull3/node_modules/quickhull3d/dist/index.js:18:12)
    at repl:1:1
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:73:12)
    at ContextifyScript.Script.runInThisContext (vm.js:21:12)
    at REPLServer.defaultEval (repl.js:340:29)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
@mauriciopoppe
Copy link
Owner

Thanks for the report! For a degenerate case where the input belongs to a plane the program couldn't find a point with distance > 0, the solution was to set the minimal distance allowed to be >= 0

fixed in v2.0.1

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

No branches or pull requests

2 participants