{"_id":"polytope-closest-point","_rev":"7-ff8ed266b8475cd0a91850ea5c0e91ca","name":"polytope-closest-point","description":"Computes the closest point to a polytope in arbitrary dimensions","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"polytope-closest-point","version":"0.0.0","description":"Computes the closest point to a polytope in arbitrary dimensions","main":"index.js","directories":{"test":"test"},"dependencies":{"numeric":"~1.2.6"},"devDependencies":{"tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/polytope-closest-point.git"},"keywords":["polytope","geometry","closest","point","triangle","line","segment","polygon","polyhedra","convex","math","3d"],"author":{"name":"Mikola Lysenko"},"license":"BOOST","gitHead":"bb0d7df62f074dfb2354b04aa414e29083deb98a","_id":"polytope-closest-point@0.0.0","dist":{"shasum":"352a4ccfc8e4ad4cf1e06c3999adef7e018e49ef","tarball":"https://registry.npmjs.org/polytope-closest-point/-/polytope-closest-point-0.0.0.tgz","integrity":"sha512-HVduwxSQDcz1O154sSRb/VG6RWuWKXPhxS/x14mpGmbifxE/mZqWOH2TwGlEbvZcRN9qk6qLwBta69JFcMnCzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGxVJX5rgrOzgxOPNMD2MzYyKNg4zUMnM88TFY86gh5CAiAF4Tjq5H6HZ0dp/5EFa2sDW4lX80j5uz006aoMmx8MlA=="}]},"_from":".","_npmVersion":"1.2.3","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"1.0.0":{"name":"polytope-closest-point","version":"1.0.0","description":"Computes the closest point to a polytope in arbitrary dimensions","main":"index.js","directories":{"test":"test"},"dependencies":{"numeric":"^1.2.6"},"devDependencies":{"tap":"~0.4.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/polytope-closest-point.git"},"keywords":["polytope","geometry","closest","point","triangle","line","segment","polygon","polyhedra","convex","math","3d"],"author":{"name":"Mikola Lysenko"},"license":"BOOST","gitHead":"bb0d7df62f074dfb2354b04aa414e29083deb98a","bugs":{"url":"https://github.com/mikolalysenko/polytope-closest-point/issues"},"homepage":"https://github.com/mikolalysenko/polytope-closest-point","_id":"polytope-closest-point@1.0.0","_shasum":"e6e57f4081ab5e8c778b811ef06e2c48ae338c3f","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.26","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"dist":{"shasum":"e6e57f4081ab5e8c778b811ef06e2c48ae338c3f","tarball":"https://registry.npmjs.org/polytope-closest-point/-/polytope-closest-point-1.0.0.tgz","integrity":"sha512-rvmt1e2ci9AUyWeHg+jsNuhGC4eBtxX4WjD9uDdvQzv2I1CVJSgbblJTslNXpGUu4KZSsUtSzvIdHKRKfRF3kw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBmZL8Vs5dGrgh9FuAGQtMYjVXm93VPVKBy9/KHJ2YZIAiEA0kX4wdRDPpGvzDCHA9k6JwAlbLemRHFFxFXX3sZf89k="}]}}},"readme":"polytope-closest-point\n======================\nComputes the closest point in a convex polytope to a given point.\n\nInstall\n=======\nUsing npm, type the following command into your shell:\n\n    npm install polytope-closest-point\n\nUsage\n=====\nHere is an example of how to find the closest point to a triangle in a mesh:\n\n    var mesh = require(\"bunny\");\n    var result = new Array(3);\n    var sqr_distance = require(\"polytope-closest-point\")(\n                          mesh.cells[0],\n                          mesh.positions,\n                          [0,0,0],\n                          result);\n\nWhich computes the closest point in the first facet of the mesh to the point `[0,0,0]`, storing the resulting point in `result` and the squared distance in `sqr_distance`.\n\nFor more examples, see test/simple.js.\n\n### `require(\"polytope-closest-point\")(cell, positions, x[, result])`\n\nComputes the closest point in a polytope to `x`, storing the result in `result`.\n\n* `cell` is a list of indices into a positions representing the vertices of the polytope.\n* `positions` is an array of tuples representing the vertices of the polytope\n* `x` is the point we are querying against\n* `result` (optional) is the array to store the closest point in.\n\nReturns a float representing the squared Euclidean distance from x to the polytope.  If no such point can be found, it returns Number.NaN\n\nNotes:  For polytopes with fewer than 4 vertices, the code uses hand optimized routines derived from WildMagick.  For higher dimensions, it falls back to a general purpose quadratic programming solver that is ported from somewhat slower R/FORTRAN codes.  If you are planning on using this code to do distance queries on meshed surfaces, it is recommend you triangulate all your polygons first.\n\nCredits\n=======\nTriangle/tetrahedra closest point code derived from WildMagick (c) David Eberly 1998-2012.\n\nOther dimensions, (c) 2013 Mikola Lysenko\n\nBOOST License.\n","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"time":{"modified":"2022-06-24T07:33:56.450Z","created":"2013-02-15T21:30:28.997Z","0.0.0":"2013-02-15T21:30:30.762Z","1.0.0":"2014-11-14T23:21:25.907Z"},"author":{"name":"Mikola Lysenko"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/polytope-closest-point.git"},"homepage":"https://github.com/mikolalysenko/polytope-closest-point","keywords":["polytope","geometry","closest","point","triangle","line","segment","polygon","polyhedra","convex","math","3d"],"bugs":{"url":"https://github.com/mikolalysenko/polytope-closest-point/issues"},"license":"BOOST","readmeFilename":"README.md"}